5.10. Notification types

The notification type represents the type of notification. When you create a notification in Rackspace Cloud Monitoring, you must specify the notification type. Rackspace Cloud Monitoring currently supports the following notification types:

Email

Email alerts where the message is delivered to a specified address.

Webhook

Industry-standard web hooks, where JSON is posted to a configurable URL.

PagerDuty

Use PagerDuty, an incident management system, integrated with Rackspace Cloud Monitoring.

SMS

Text alerts where the message is delivered to any phone number.

 5.10.1. Email notification type

A notification sent by email.

Table 5.8. Attributes
NameDescriptionValidation
address Email address to send notifications to
  • Email address

 5.10.2. Webhook notification type

The webhook notification takes the following parameters:

Table 5.9. Attributes
NameDescriptionValidation
url An HTTP or HTTPS URL to POST to
  • URL

 

Example 5.69. Webhook notification POST to a specified URL with JSON Payload

{
    "event_id": "acOne:enOne:alOne:chOne:1326910500000:WARNING",
    "log_entry_id": "6da55310-4200-11e1-aaaf-cd4c8801b6b1",
    "details": {
        "target": null,
        "timestamp": 1326905540481,
        "metrics": {
            "tt_firstbyte": {
                "type": "I",
                "data": 2,
                "unit": "milliseconds"
            },
            "duration": {
                "type": "I",
                "data": 2,
                "unit": "milliseconds"
            },
            "bytes": {
                "type": "i",
                "data": 17,
                "unit": "bytes"
            },
            "tt_connect": {
                "type": "I",
                "data": 0,
                "unit": "milliseconds"
            },
            "code": {
                "type": "s",
                "data": "200",
                "unit": "unknown"
            }
        },
        "state": "WARNING",
        "status": "warn.",
        "txn_id": "sometransaction",
        "collector_address_v4": "127.0.0.1",
        "collector_address_v6": null,
        "observations": [
            {
                "monitoring_zone_id": "mzOne",
                "state": "WARNING",
                "status": "warn.",
                "timestamp": 1326905540481
            }
        ]
    },
    "entity": {
        "id": "enOne",
        "label": "entity one",
        "ip_addresses": {
            "default": "127.0.0.1"
        },
        "metadata": null,
        "managed": false,
        "uri": null,
        "agent_id": null,
        "created_at": 1326905540481,
        "updated_at": 1326905540481
    },
    "check": {
        "id": "chOne",
        "label": "ch a",
        "type": "remote.http",
        "details": {
            "url": "http://www.foo.com",
            "body": "b",
            "method": "GET",
            "follow_redirects": true,
            "include_body": false
        },
        "monitoring_zones_poll": [
            "mzOne"
        ],
        "timeout": 30,
        "period": 60,
        "target_alias": "default",
        "target_hostname": "",
        "target_resolver": "",
        "disabled": false,
        "metadata": null,
        "confd_name": null,
        "confd_hash": null,
        "created_at": 1326905540481,
        "updated_at": 1326905540481
    },
    "alarm": {
        "id": "alOne",
        "label": "Alarm 1",
        "check_type": "remote.http",
        "check_id": null,
        "criteria": "if (metric[\"t\"] >= 2.1) { return WARNING } return WARNING",
        "disabled": false,
        "notification_plan_id": "npOne",
        "metadata": null,
        "confd_name": null,
        "confd_hash": null,
        "created_at": 1326905540481,
        "updated_at": 1326905540481
    },
    "tenant_id": "91111"
}


 5.10.2.1. Notification payload

The following fields are contained within a single payload:

Field Description
eventId The ID for the event in the system.
logEntryId The ID for the log entry.
entity The entity record that triggered the alert.
check The check record that triggered the alert.
alarm The alarm record that triggered the alert.

 5.10.2.2. Notification header contents

The following fields will be populated in the request header when your webhook is called.

Header Field Description
x-rackspace-webhook-token The webhook token defined in an account. This is used in your web application to verify that your webhook is called by an authorized Rackspace service.

 5.10.3. PagerDuty notification type

A notification sent through PagerDuty.

To learn how to use this notification type, read the PagerDuty blog Rackspace Cloud Monitoring Now Integrates with PagerDuty .

Table 5.10. Attributes
NameDescriptionValidation
service_key The PagerDuty service key to use.
  • Alphanumeric string

  • String between 1 and 32 characters long

 5.10.4. SMS notification type

A notification sent by text to your phone, including international phone numbers. Standard text messaging rates charged by your phone service provider will apply.

Table 5.11. Attributes
NameDescriptionValidation
phone_number Phone number to send the notification to, with leading + and country code (E.164 format)
  • String matching the regex //^\+[0-9]{6,15}$//

 5.10.5. Notification types API operations

Use the notification types API operations to view and manage notifications.

[Note]Note

Users cannot create, update, or delete notification types.

MethodURIDescription
GET/notification_types

Lists available notification types.

GET/notification_types/{notificationTypeId}

Returns information about the specified Notification type.

 5.10.5.1. List notification types

 
MethodURIDescription
GET/notification_types

Lists available notification types.

This operation can be paginated. For information, see Paginated collections

This table shows the possible response codes for this operation:

Response CodeNameDescription
200OK

The request completed.

401Unauthorized

The system received a request from a user that is not authenticated.

403Forbidden

The system received a request that the user is not authorized to make.

500Internal Server Error

An unexpected condition was encountered.

503Service Unavailable

The system is experiencing heavy load or another system failure.

 5.10.5.1.1. Request

This table shows the header parameters for the list notification types request:

NameTypeDescription

X-Auth-Token

​String

(Required)

A valid authentication token with administrative access.

This operation does not accept a request body.

 5.10.5.1.2. Response
 

Example 5.70. List notification types: XML response

<?xml version="1.0" encoding="utf-8"?>
<container>
  <values>
    <notification_type id="webhook">
      <fields>
        <field>
          <name>url</name>
          <description>An HTTP or HTTPS URL to POST to</description>
          <optional>false</optional>
        </field>
      </fields>
    </notification_type>
    <notification_type id="email">
      <fields>
        <field>
          <name>address</name>
          <description>Email address to send notifications to</description>
          <optional>false</optional>
        </field>
      </fields>
    </notification_type>
    <notification_type id="pagerduty">
      <fields>
        <field>
          <name>service_key</name>
          <description>The PagerDuty service key to use.</description>
          <optional>false</optional>
        </field>
      </fields>
    </notification_type>
    <notification_type id="sms">
      <fields>
        <field>
          <name>phone_number</name>
          <description>Phone number to send the notification to, with leading + and country code (E.164 format)</description>
          <optional>false</optional>
        </field>
      </fields>
    </notification_type>
    <notification_type id="managed">
      <fields/>
    </notification_type>
    <notification_type id="technicalContactsEmail">
      <fields/>
    </notification_type>
    <notification_type id="atomHopper">
      <fields>
        <field>
          <name>category</name>
          <description>A category by which to identify this notification. Categories will be prefixed by 'monitoring.alerts.', so they will end up looking like: 'monitoring.alerts.USER_DEFINED_CATEGORY'</description>
          <optional>false</optional>
        </field>
      </fields>
    </notification_type>
  </values>
  <metadata>
    <count>7</count>
    <limit>50</limit>
    <marker/>
    <next_marker/>
    <next_href/>
  </metadata>
</container>

 

Example 5.71. List notification types: JSON response

{
    "values": [
        {
            "id": "webhook",
            "fields": [
                {
                    "name": "url",
                    "description": "An HTTP or HTTPS URL to POST to",
                    "optional": false
                }
            ]
        },
        {
            "id": "email",
            "fields": [
                {
                    "name": "address",
                    "description": "Email address to send notifications to",
                    "optional": false
                }
            ]
        },
        {
            "id": "pagerduty",
            "fields": [
                {
                    "name": "service_key",
                    "description": "The PagerDuty service key to use.",
                    "optional": false
                }
            ]
        },
        {
            "id": "sms",
            "fields": [
                {
                    "name": "phone_number",
                    "description": "Phone number to send the notification to, with leading + and country code (E.164 format)",
                    "optional": false
                }
            ]
        },
        {
            "id": "managed",
            "fields": null
        },
        {
            "id": "technicalContactsEmail",
            "fields": null
        },
        {
            "id": "atomHopper",
            "fields": [
                {
                    "name": "category",
                    "description": "A category by which to identify this notification. Categories will be prefixed by 'monitoring.alerts.', so they will end up looking like: 'monitoring.alerts.USER_DEFINED_CATEGORY'",
                    "optional": false
                }
            ]
        }
    ],
    "metadata": {
        "count": 7,
        "limit": 50,
        "marker": null,
        "next_marker": null,
        "next_href": null
    }
}

 5.10.5.2. Get notification type by ID

 
MethodURIDescription
GET/notification_types/{notificationTypeId}

Returns information about the specified Notification type.

This table shows the possible response codes for this operation:

Response CodeNameDescription
200OK

The request completed.

401Unauthorized

The system received a request from a user that is not authenticated.

403Forbidden

The system received a request that the user is not authorized to make.

500Internal Server Error

An unexpected condition was encountered.

503Service Unavailable

The system is experiencing heavy load or another system failure.

 5.10.5.2.1. Request

This table shows the header parameters for the get notification type by id request:

NameTypeDescription

X-Auth-Token

​String

(Required)

A valid authentication token with administrative access.

This operation does not accept a request body.

 5.10.5.2.2. Response
 

Example 5.72. Get notification type by ID: XML response

<?xml version="1.0" encoding="utf-8"?>
<notification_type id="webhook">
  <fields>
    <field>
      <name>url</name>
      <description>An HTTP or HTTPS URL to POST to</description>
      <optional>false</optional>
    </field>
  </fields>
</notification_type>

 

Example 5.73. Get notification type by ID: JSON response

{
    "id": "webhook",
    "fields": [
        {
            "name": "url",
            "description": "An HTTP or HTTPS URL to POST to",
            "optional": false
        }
    ]
}



loading table of contents...