Webhooks#
The operations described in this section help you create and manage webhooks for a scaling policy.
List webhooks for the policy#
GET /v1.0/{tenantId}/groups/{groupId}/policies/{policyId}/webhooks
This operation lists web hooks and their IDs for a specified scaling policy.
This data is returned in the response body in JSON format.
This table shows the possible response codes for this operation:
Response Code |
Name |
Description |
---|---|---|
200 |
OK |
The request succeeded and the response contains a list of webhooks for the specified scaling policy. |
400 |
InvalidQueryArgument |
Only “pagination” query arguments are valid in this request. |
401 |
InvalidCredentials |
The X-Auth-Token the user supplied is bad. |
403 |
Forbidden |
The user does not have permission to perform the resource; for example, the user only has an observer role and attempted to perform something only available to a user with an admin role. Note, some API nodes also use this status code for other things. |
404 |
NoSuchPolicyError |
The requested scaling policy was not found in the specified scaling group. |
404 |
NoSuchScalingGroupError |
The specified scaling group was not found. |
405 |
InvalidMethod |
The method used is unavailable for the endpoint. |
413 |
RateLimitError |
The user has surpassed their rate limit. |
500 |
InternalError |
An error internal to the application has occurred, please file a bug report. |
503 |
ServiceUnavailable |
The requested service is unavailable, please file a bug report. |
Request#
This table shows the URI parameters for the request:
Name |
Type |
Description |
---|---|---|
{tenantId} |
String (Required) |
A subscriber to the auto scaling service. |
X-Auth-Token |
String (Required) |
A valid authentication token. |
{groupId} |
Uuid (Required) |
A scaling group. |
{policyId} |
Uuid (Required) |
A scaling policy. |
This operation does not accept a request body.
Response#
Example List webhooks for the policy: JSON response
{
"webhooks":[
{
"id":"152054a3-e0ab-445b-941d-9f8e360c9eed",
"links":[
{
"href":"https://dfw.autoscale.api.rackspacecloud.com/v1.0/676873/groups/605e13f6-1452-4588-b5da-ac6bb468c5bf/policies/eb0fe1bf-3428-4f34-afd9-a5ac36f60511/webhooks/152054a3-e0ab-445b-941d-9f8e360c9eed/",
"rel":"self"
},
{
"href":"https://dfw.autoscale.api.rackspacecloud.com/v1.0/execute/1/0077882e9626d83ef30e1ca379c8654d86cd34df3cd49ac8da72174668315fe8/",
"rel":"capability"
}
],
"metadata":{
"notes":"PagerDuty will fire this webhook"
},
"name":"PagerDuty"
},
{
"id":"23037efb-53a9-4ae5-bc33-e89a56b501b6",
"links":[
{
"href":"https://dfw.autoscale.api.rackspacecloud.com/v1.0/676873/groups/605e13f6-1452-4588-b5da-ac6bb468c5bf/policies/eb0fe1bf-3428-4f34-afd9-a5ac36f60511/webhooks/23037efb-53a9-4ae5-bc33-e89a56b501b6/",
"rel":"self"
},
{
"href":"https://dfw.autoscale.api.rackspacecloud.com/v1.0/execute/1/4f767340574433927a26dc747253dad643d5d13ec7b66b764dcbf719b32302b9/",
"rel":"capability"
}
],
"metadata":{
},
"name":"Nagios"
}
],
"webhooks_links":[
]
}
Create webhook#
POST /v1.0/{tenantId}/groups/{groupId}/policies/{policyId}/webhooks
This operation creates one or more webhooks for the specified scaling policy.
Webhooks must have a name. If the operation succeeds, the response body contains the IDs and links to the newly created web hooks. This data is provided in the request body in JSON format.
This table shows the possible response codes for this operation:
Response Code |
Name |
Description |
---|---|---|
201 |
Created |
The webhook has been created. |
400 |
InvalidJsonError |
A syntax or parameter error. The create webhook request body had invalid JSON. |
400 |
InvalidJsonError |
The request is refused because the body was invalid JSON”. |
400 |
ValidationError |
A syntax or parameter error. The create webhook request body had bad. |
400 |
ValidationError |
The request body had valid JSON but with unexpected properties or values in it. Please note that there can be many combinations that cause this error. We will try to list the most common mistakes users are likely to make in a particular request. “. |
401 |
InvalidCredentials |
The X-Auth-Token the user supplied is bad. |
403 |
Forbidden |
The user does not have permission to perform the resource; for example, the user only has an observer role and attempted to perform something only available to a user with an admin role. Note, some API nodes also use this status code for other things. |
404 |
NoSuchPolicyError |
The requested scaling policy was not found in the specified scaling group. |
404 |
NoSuchScalingGroupError |
The specified scaling group was not found. |
405 |
InvalidMethod |
The method used is unavailable for the endpoint. |
413 |
RateLimitError |
The user has surpassed their rate limit. |
415 |
UnsupportedMediaType |
The request is refused because the content type of the request is not “application/json”. |
422 |
WebhookOverLimitsError |
The user has reached their quota for webhooks, currently 25. |
500 |
InternalError |
An error internal to the application has occurred, please file a bug report. |
503 |
ServiceUnavailable |
The requested service is unavailable, please file a bug report. |
Request#
This table shows the URI parameters for the request:
Name |
Type |
Description |
---|---|---|
{tenantId} |
String (Required) |
A subscriber to the auto scaling service. |
X-Auth-Token |
String (Required) |
A valid authentication token. |
{groupId} |
Uuid (Required) |
A scaling group. |
{policyId} |
Uuid (Required) |
A scaling policy. |
This table shows the body parameters for the request:
Name |
Type |
Description |
---|---|---|
[*].name |
String (Required) |
A name for the webhook for logging purposes. |
[*].metadata |
Object (Optional) |
User-provided key-value metadata. Both keys and values should be strings with a maximum length of 256 characters. |
Example Create webhook: JSON request
[
{
"metadata":{
"notes":"PagerDuty will fire this webhook"
},
"name":"PagerDuty"
},
{
"name":"Nagios"
}
]
Response#
Example Create webhook: JSON response
{
"webhooks":[
{
"id":"152054a3-e0ab-445b-941d-9f8e360c9eed",
"links":[
{
"href":"https://dfw.autoscale.api.rackspacecloud.com/v1.0/676873/groups/605e13f6-1452-4588-b5da-ac6bb468c5bf/policies/eb0fe1bf-3428-4f34-afd9-a5ac36f60511/webhooks/152054a3-e0ab-445b-941d-9f8e360c9eed/",
"rel":"self"
},
{
"href":"https://dfw.autoscale.api.rackspacecloud.com/v1.0/execute/1/0077882e9626d83ef30e1ca379c8654d86cd34df3cd49ac8da72174668315fe8/",
"rel":"capability"
}
],
"metadata":{
"notes":"PagerDuty will fire this webhook"
},
"name":"PagerDuty"
},
{
"id":"23037efb-53a9-4ae5-bc33-e89a56b501b6",
"links":[
{
"href":"https://dfw.autoscale.api.rackspacecloud.com/v1.0/676873/groups/605e13f6-1452-4588-b5da-ac6bb468c5bf/policies/eb0fe1bf-3428-4f34-afd9-a5ac36f60511/webhooks/23037efb-53a9-4ae5-bc33-e89a56b501b6/",
"rel":"self"
},
{
"href":"https://dfw.autoscale.api.rackspacecloud.com/v1.0/execute/1/4f767340574433927a26dc747253dad643d5d13ec7b66b764dcbf719b32302b9/",
"rel":"capability"
}
],
"metadata":{
},
"name":"Nagios"
}
]
}
Show webhook details#
GET /v1.0/{tenantId}/groups/{groupId}/policies/{policyId}/webhooks/{webhookId}
This operation retrieves webhook details for a specified scaling policy.
The details appear in the response body in JSON format.
This table shows the possible response codes for this operation:
Response Code |
Name |
Description |
---|---|---|
200 |
OK |
The request succeeded and the response contains details about the specified webhook. |
401 |
InvalidCredentials |
The X-Auth-Token the user supplied is bad. |
403 |
Forbidden |
The user does not have permission to perform the resource; for example, the user only has an observer role and attempted to perform something only available to a user with an admin role. Note, some API nodes also use this status code for other things. |
404 |
NoSuchPolicyError |
The requested scaling policy was not found in the specified scaling group. |
404 |
NoSuchScalingGroupError |
The specified scaling group was not found. |
404 |
NoSuchWebhookError |
The specified webhook was not found. |
405 |
InvalidMethod |
The method used is unavailable for the endpoint. |
413 |
RateLimitError |
The user has surpassed their rate limit. |
500 |
InternalError |
An error internal to the application has occurred, please file a bug report. |
503 |
ServiceUnavailable |
The requested service is unavailable, please file a bug report. |
Request#
This table shows the URI parameters for the request:
Name |
Type |
Description |
---|---|---|
{tenantId} |
String (Required) |
A subscriber to the auto scaling service. |
X-Auth-Token |
String (Required) |
A valid authentication token. |
{groupId} |
Uuid (Required) |
A scaling group. |
{policyId} |
Uuid (Required) |
A scaling policy. |
{webhookId} |
Uuid (Required) |
A webhook. |
This operation does not accept a request body.
Response#
Example Show webhook details: JSON response
{
"webhook":{
"id":"23037efb-53a9-4ae5-bc33-e89a56b501b6",
"links":[
{
"href":"https://dfw.autoscale.api.rackspacecloud.com/v1.0/676873/groups/605e13f6-1452-4588-b5da-ac6bb468c5bf/policies/eb0fe1bf-3428-4f34-afd9-a5ac36f60511/webhooks/23037efb-53a9-4ae5-bc33-e89a56b501b6/",
"rel":"self"
},
{
"href":"https://dfw.autoscale.api.rackspacecloud.com/v1.0/execute/1/4f767340574433927a26dc747253dad643d5d13ec7b66b764dcbf719b32302b9/",
"rel":"capability"
}
],
"metadata":{
},
"name":"Nagios"
}
}
Update webhook#
PUT /v1.0/{tenantId}/groups/{groupId}/policies/{policyId}/webhooks/{webhookId}
This operation updates a webhook for a specified tenant and scaling policy.
If the specified webhook is not recognized, the change is ignored. If you submit a URL, the URL is ignored but that does not invalidate the request. If the change is successful, no response body is returned.
Note
All Rackspace Auto Scale update (PUT) operations completely replace the configuration being updated. Empty values (for example, { } )in the update are accepted and overwrite previously specified parameters. New parameters can be specified. All create (POST) webhook parameters, even optional ones, are required for the update webhook operation, including the metadata
parameter.
This table shows the possible response codes for this operation:
Response Code |
Name |
Description |
---|---|---|
204 |
Success But No Content |
The update webhook request succeeded. |
400 |
InvalidJsonError |
A syntax or parameter error. The create webhook request body had invalid JSON. |
400 |
InvalidJsonError |
The request is refused because the body was invalid JSON”. |
400 |
ValidationError |
A syntax or parameter error. The create webhook request body had bad. |
400 |
ValidationError |
The request body had valid JSON but with unexpected properties or values in it. Please note that there can be many combinations that cause this error. |
401 |
InvalidCredentials |
The X-Auth-Token the user supplied is bad. |
403 |
Forbidden |
The user does not have permission to perform the resource; for example, the user only has an observer role and attempted to perform something only available to a user with an admin role. Note, some API nodes also use this status code for other things. |
404 |
NoSuchPolicyError |
The requested scaling policy was not found in the specified scaling group. |
404 |
NoSuchScalingGroupError |
The specified scaling group was not found. |
404 |
NoSuchWebhookError |
The specified webhook was not found. |
405 |
InvalidMethod |
The method used is unavailable for the endpoint. |
413 |
RateLimitError |
The user has surpassed their rate limit. |
415 |
UnsupportedMediaType |
The request is refused because the content type of the request is not “application/json”. |
422 |
WebhookOverLimitsError |
The user has reached their quota for webhooks, currently 25. |
500 |
InternalError |
An error internal to the application has occurred, please file a bug report. |
503 |
ServiceUnavailable |
The requested service is unavailable, please file a bug report. |
Request#
This table shows the URI parameters for the request:
Name |
Type |
Description |
---|---|---|
{tenantId} |
String (Required) |
A subscriber to the auto scaling service. |
X-Auth-Token |
String (Required) |
A valid authentication token. |
{groupId} |
Uuid (Required) |
A scaling group. |
{policyId} |
Uuid (Required) |
A scaling policy. |
{webhookId} |
Uuid (Required) |
A webhook. |
This table shows the body parameters for the request:
Name |
Type |
Description |
---|---|---|
[*].name |
String (Required) |
A name for the webhook for logging purposes. |
[*].metadata |
Object (Optional) |
User-provided key-value metadata. Both keys and values should be strings not exceeding 256 characters in length. |
Example Update webhook: JSON request
{
"name": "alice",
"metadata": {
"notes": "this is for Alice"
}
}
Response#
This operation does not return a response body.
Delete webhook#
DELETE /v1.0/{tenantId}/groups/{groupId}/policies/{policyId}/webhooks/{webhookId}
This operation deletes a webhook for a specified scaling policy.
If deletion succeeds, no response body is returned.
This table shows the possible response codes for this operation:
Response Code |
Name |
Description |
---|---|---|
204 |
Success But No Content |
The delete webhook request succeeded. |
401 |
InvalidCredentials |
The X-Auth-Token the user supplied is bad. |
403 |
Forbidden |
The user does not have permission to perform the resource; for example, the user only has an observer role and attempted to perform something only available to a user with an admin role. Note, some API nodes also use this status code for other things. |
404 |
NoSuchPolicyError |
The requested scaling policy was not found in the specified scaling group. |
404 |
NoSuchScalingGroupError |
The specified scaling group was not found. |
404 |
NoSuchWebhookError |
The specified webhook was not found. |
405 |
InvalidMethod |
The method used is unavailable for the endpoint. |
413 |
RateLimitError |
The user has surpassed their rate limit. |
500 |
InternalError |
An error internal to the application has occurred, please file a bug report. |
503 |
ServiceUnavailable |
The requested service is unavailable, please file a bug report. |
Request#
This table shows the URI parameters for the request:
Name |
Type |
Description |
---|---|---|
{tenantId} |
String (Required) |
A subscriber to the auto scaling service. |
X-Auth-Token |
String (Required) |
A valid authentication token. |
{groupId} |
Uuid (Required) |
A scaling group. |
{policyId} |
Uuid (Required) |
A scaling policy. |
{webhookId} |
Uuid (Required) |
A webhook. |
This operation does not accept a request body.
Response#
This operation does not return a response body.