A notification is a destination to send an alarm, it can be a variety of different types, and will evolve over time.
For instance, with a webhook type notification Rackspace Cloud Monitoring posts JSON
formatted data to a user-specified URL on an alert condition
(Check goes from OK -> CRITICAL and
so on).
| Name | Description | Validation |
| details | A hash of notification specific details based on the notification type. |
|
| label | Friendly name for the notification. |
|
| type | The notification type to send. |
|
| Verb | URI | Description | |||||
| POST | /notifications | Check that a token is valid and that it belongs to a particular user and return the permissions relevant to a particular client. | |||||
Normal Response Code: (201) 'Location' header contains a link to the newly created notification.
Error Response Codes: 400, 401, 403, 500, 503
Example 4.80. Create Notification Request: XML
<?xml version="1.0" encoding="utf-8"?>
<notification>
<label>my webhook #1</label>
<type>webhook</type>
<details>
<url>https://systems.example.org/alert</url>
</details>
</notification>
Example 4.81. Create Notification Request: JSON
{
"label": "my webhook #1",
"type": "webhook",
"details": {
"url": "https://systems.example.org/alert"
}
}
| Verb | URI | Description | |||||
| POST | /test-notification | Test a notification. | |||||
Normal Response Code: 200
Error Response Codes: 400, 401, 403, 500, 503
This operation allows you to test a notification before creating it. The actual notification comes from the same server where the actual alert messages come from. This allow you to, among other things, verify that your firewall is configured properly.
Example 4.82. Test Notification Request: XML
<?xml version="1.0" encoding="utf-8"?>
<test_notification>
<type>webhook</type>
<details>
<url>http://my.web-server.com:5981/</url>
</details>
</test_notification>
Example 4.83. Test Notification Request: JSON
{
"type": "webhook",
"details": {
"url": "http://my.web-server.com:5981/"
}
}
Example 4.84. Test Notification Response: XML
<?xml version="1.0" encoding="utf-8"?> <notification_data> <status>success</status> <message>Success: Webhook successfully executed</message> </notification_data>
Example 4.85. Test Notification Response: JSON
{
"status": "success",
"message": "Success: Webhook successfully executed"
}
| Verb | URI | Description | |||||
| POST | /notifications/notificationId/test |
Test an existing notification. | |||||
Normal Response Code: 200
Error Response Codes: 400, 401, 403, 500, 503
This operation allows you to test an existing notification. The actual notification comes from the same server where the actual alert messages come from. This allow you to, among other things, verify that your firewall is configured properly.
Example 4.86. Test Existing Notification Response: XML
<?xml version="1.0" encoding="utf-8"?> <notification_data> <status>success</status> <message>Success: Webhook successfully executed</message> </notification_data>
Example 4.87. Test Existing Notification Response: JSON
{
"status": "success",
"message": "Success: Webhook successfully executed"
}
| Verb | URI | Description | |||||
| GET | /notifications | Lists the notifications for this particular account. | |||||
There are no parameters for this call.
Normal Response Code: 200
Error Response Codes: 401, 403, 500, 503
Example 4.88. List Notifications Response: XML
<?xml version="1.0" encoding="utf-8"?>
<container>
<values>
<notification id="ntAAAA">
<label>my webhook #1</label>
<type>webhook</type>
<details>
<url>https://systems.example.org/alert</url>
</details>
</notification>
</values>
<metadata>
<count>1</count>
<limit>50</limit>
<marker/>
<next_marker/>
<next_href/>
</metadata>
</container>
Example 4.89. List Notifications Response: JSON
{
"values": [
{
"id": "ntAAAA",
"label": "my webhook #1",
"type": "webhook",
"details": {
"url": "https://systems.example.org/alert"
}
}
],
"metadata": {
"count": 1,
"limit": 50,
"marker": null,
"next_marker": null,
"next_href": null
}
}
| Verb | URI | Description | |||||
| GET | /notifications/notificationId |
Get information for a single notification. | |||||
There are no parameters for this call.
Normal Response Code: 200
Error Response Codes: 401, 403, 500, 503
Example 4.90. Get Notification Response: XML
<?xml version="1.0" encoding="utf-8"?>
<notification id="ntAAAA">
<label>my webhook #1</label>
<type>webhook</type>
<details>
<url>https://systems.example.org/alert</url>
</details>
</notification>
Example 4.91. Get Notification Response: JSON
{
"id": "ntAAAA",
"label": "my webhook #1",
"type": "webhook",
"details": {
"url": "https://systems.example.org/alert"
}
}
| Verb | URI | Description | |||||
| PUT | /notifications/notificationId |
Updates a notification with the specified notificationId. | |||||
Normal Response Code: (204) This code contains no content with an empty response body.
Error Response Codes: 400, 401, 403, 404, 500, 503
Example 4.92. Notification Update Request: XML
<?xml version="1.0" encoding="utf-8"?>
<notification>
<type>webhook</type>
<details>
<url>https://systems.example.org/new_alert</url>
</details>
</notification>
Example 4.93. Notification Update Request: JSON
{
"type": "webhook",
"details": {
"url": "https://systems.example.org/new_alert"
}
}

