Atom feed of this document
 
 
 

 4.12. Notifications

 4.12.1. Summary

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).

 4.12.2. Attributes

Table 4.14. Attributes
NameDescriptionValidation
details A hash of notification specific details based on the notification type.
  • Hash [String,String between 1 and 255 characters long:Non-empty string,String between 1 and 4096 characters long]

  • Array or object with number of items between 0 and 256

label Friendly name for the notification.
  • String between 1 and 255 characters long

type The notification type to send.
  • String

  • One of (webhook, email, pagerduty)

 4.12.3. Create Notification

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 Webhook 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 Webhook Notification Request: JSON

	  {
    "label": "my webhook #1",
    "type": "webhook",
    "details": {
        "url": "https://systems.example.org/alert"
    }
}

          

 

Example 4.82. Create Email Notification Request: XML

	  <?xml version="1.0" encoding="utf-8"?>
<notification>
  <label>my email #1</label>
  <type>email</type>
  <details>
    <address>test@example.com</address>
  </details>
</notification>

          

 

Example 4.83. Create Email Notification Request: JSON

	  {
    "label": "my email #1",
    "type": "email",
    "details": {
        "address": "test@example.com"
    }
}

          

 4.12.4. Test Notification

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.84. 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.85. Test Notification Request: JSON

{
    "type": "webhook",
    "details": {
        "url": "http://my.web-server.com:5981/"
    }
}

          

 

Example 4.86. 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.87. Test Notification Response: JSON

{
    "status": "success",
    "message": "Success: Webhook successfully executed"
}


 4.12.5. Test Existing Notification

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.88. 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.89. Test Existing Notification Response: JSON

{
    "status": "success",
    "message": "Success: Webhook successfully executed"
}


 4.12.6.  List Notifications

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.90. 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.91. 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
    }
}


 4.12.7. Get Notifications

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.92. 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.93. Get Notification Response: JSON

{
    "id": "ntAAAA",
    "label": "my webhook #1",
    "type": "webhook",
    "details": {
        "url": "https://systems.example.org/alert"
    }
}


 4.12.8. Update Notifications

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.94. 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.95. Notification Update Request: JSON

{
    "type": "webhook",
    "details": {
        "url": "https://systems.example.org/new_alert"
    }
}


 4.12.9. Delete Notifications

Verb URI Description
DELETE /notifications/notificationId Deletes a notification from your account.

Normal Response Code: (204) This code contains no content with an empty response body.

Error Response Codes: 401, 403, 404, 500, 503



loading table of contents...