Cloud Management API 1.5
AlertSpecs
An AlertSpec defines the conditions under which an Alert is triggered and escalated. Condition sentence: if <file>.<variable> <condition> '<threshold>' for <duration> min then escalate to '<escalation_name>'.
Actions
index
- URLs
- GET /api/alert_specs
- GET /api/clouds/:cloud_id/instances/:instance_id/alert_specs
- GET /api/server_arrays/:server_array_id/alert_specs
- GET /api/server_templates/:server_template_id/alert_specs
- GET /api/servers/:server_id/alert_specs
- HTTP response code
- 200 OK
- Content-type
- application/vnd.rightscale.alert_spec;type=collection
Required roles
- observer||instance
Required settings
- alerts
Parameters
name | required | type | values | regexp | blank? | description |
---|---|---|---|---|---|---|
filter | no | Array | * | * | no | See below for valid filter parameters. |
view | no | String | default | * | no | Specifies how many attributes and/or expanded nested relationships to include. |
with_inherited | no | String | true, false | * | no | Flag indicating whether or not to include AlertSpecs from the ServerTemplate in the index. |
Filters
name | partial_match? | description |
---|---|---|
description | yes | The alert spec description to filter on. |
escalation_name | no | The name of the alert escalation to filter on. |
name | yes | The name of the alert spec to filter on. |
subject_href | no | The href of the subject to filter on. The subject can be a ServerTemplate, Server, ServerArray, or Instance. |
Example Responses
Click on a format below to see an example response:
JSON XML[{
"name": "NAME_1497346555",
"description": "DESCRIPTION_2914038777",
"created_at": "2023/10/09 11:06:01 +0000",
"updated_at": "2023/10/09 11:06:01 +0000",
"duration": 60,
"threshold": "1",
"condition": "==",
"file": "path/file_name",
"variable": "state",
"links": [
{"rel":"self","href":"/api/alert_specs/1"},
{"rel":"subject","href":"/api/server_templates/2"}
],
"actions": [
],
"escalation_name": "critical"
},{
"name": "NAME_944813613",
"description": "DESCRIPTION_3519903696",
"created_at": "2023/10/09 11:06:03 +0000",
"updated_at": "2023/10/09 11:06:03 +0000",
"duration": 60,
"threshold": "1",
"condition": "==",
"file": "path/file_name",
"variable": "state",
"links": [
{"rel":"self","href":"/api/alert_specs/2"},
{"rel":"subject","href":"/api/server_templates/6"}
],
"actions": [
],
"escalation_name": "critical"
}]
<?xml version="1.0" encoding="UTF-8"?>
<alert_specs>
<alert_spec>
<name>NAME_1497346555</name>
<description>DESCRIPTION_2914038777</description>
<created_at>2023/10/09 11:06:01 +0000</created_at>
<updated_at>2023/10/09 11:06:01 +0000</updated_at>
<duration>60</duration>
<threshold>1</threshold>
<condition>==</condition>
<file>path/file_name</file>
<variable>state</variable>
<links>
<link rel="self" href="/api/alert_specs/1"/>
<link rel="subject" href="/api/server_templates/2"/>
</links>
<actions/>
<escalation_name>critical</escalation_name>
</alert_spec>
<alert_spec>
<name>NAME_944813613</name>
<description>DESCRIPTION_3519903696</description>
<created_at>2023/10/09 11:06:03 +0000</created_at>
<updated_at>2023/10/09 11:06:03 +0000</updated_at>
<duration>60</duration>
<threshold>1</threshold>
<condition>==</condition>
<file>path/file_name</file>
<variable>state</variable>
<links>
<link rel="self" href="/api/alert_specs/2"/>
<link rel="subject" href="/api/server_templates/6"/>
</links>
<actions/>
<escalation_name>critical</escalation_name>
</alert_spec>
</alert_specs>
show
- URLs
- GET /api/alert_specs/:id
- GET /api/clouds/:cloud_id/instances/:instance_id/alert_specs/:id
- GET /api/server_arrays/:server_array_id/alert_specs/:id
- GET /api/server_templates/:server_template_id/alert_specs/:id
- GET /api/servers/:server_id/alert_specs/:id
- HTTP response code
- 200 OK
- Content-type
- application/vnd.rightscale.alert_spec
Required roles
- observer||instance
Required settings
- alerts
Parameters
name | required | type | values | regexp | blank? | description |
---|---|---|---|---|---|---|
view | no | String | default | * | no | Specifies how many attributes and/or expanded nested relationships to include. |
Example Responses
Click on a format below to see an example response:
JSON XML{
"name": "NAME_1497346555",
"description": "DESCRIPTION_2914038777",
"created_at": "2023/10/09 11:06:01 +0000",
"updated_at": "2023/10/09 11:06:01 +0000",
"duration": 60,
"threshold": "1",
"condition": "==",
"file": "path/file_name",
"variable": "state",
"links": [
{"rel":"self","href":"/api/alert_specs/1"},
{"rel":"subject","href":"/api/server_templates/2"}
],
"actions": [
],
"escalation_name": "critical"
}
<?xml version="1.0" encoding="UTF-8"?>
<alert_spec>
<name>NAME_1497346555</name>
<description>DESCRIPTION_2914038777</description>
<created_at>2023/10/09 11:06:01 +0000</created_at>
<updated_at>2023/10/09 11:06:01 +0000</updated_at>
<duration>60</duration>
<threshold>1</threshold>
<condition>==</condition>
<file>path/file_name</file>
<variable>state</variable>
<links>
<link rel="self" href="/api/alert_specs/1"/>
<link rel="subject" href="/api/server_templates/2"/>
</links>
<actions/>
<escalation_name>critical</escalation_name>
</alert_spec>
create
Creates a new AlertSpec with the given parameters.
- URLs
- POST /api/alert_specs
- POST /api/clouds/:cloud_id/instances/:instance_id/alert_specs
- POST /api/server_arrays/:server_array_id/alert_specs
- POST /api/server_templates/:server_template_id/alert_specs
- POST /api/servers/:server_id/alert_specs
- HTTP response code
- 201 Created
- Location
- Href of the created AlertSpec.
Required roles
- designer||instance
Required settings
- alerts
Parameters
name | required | type | values | regexp | blank? | description |
---|---|---|---|---|---|---|
alert_spec | yes | Hash | * | * | no | |
alert_spec[condition] | yes | String | >, >=, <, <=, ==, != | * | no | The condition (operator) in the condition sentence. |
alert_spec[description] | no | String | * | * | no | The description of the AlertSpec. |
alert_spec[duration] | yes | String | * | ^\d+$ | no | The duration in minutes of the condition sentence. |
alert_spec[escalation_name] | no | String | * | * | no | Escalate to the named alert escalation when the alert is triggered. Must either escalate or vote. |
alert_spec[file] | yes | String | * | * | no | The RRD path/file_name of the condition sentence. |
alert_spec[name] | yes | String | * | * | no | The name of the AlertSpec. |
alert_spec[subject_href] | no | String | * | * | no | The href of the resource that this AlertSpec should be associated with. The subject can be a ServerTemplate, Server, ServerArray, or Instance. |
alert_spec[threshold] | yes | String | * | * | no | The threshold of the condition sentence. |
alert_spec[variable] | yes | String | * | * | no | The RRD variable of the condition sentence. |
alert_spec[vote_tag] | no | String | * | * | no | Should correspond to a vote tag on a ServerArray if vote to grow or shrink. |
alert_spec[vote_type] | no | String | grow, shrink | * | no | Vote to grow or shrink a ServerArray when the alert is triggered. Must either escalate or vote. |
update
Updates an AlertSpec with the given parameters.
- URLs
- PUT /api/alert_specs/:id
- PUT /api/clouds/:cloud_id/instances/:instance_id/alert_specs/:id
- PUT /api/server_arrays/:server_array_id/alert_specs/:id
- PUT /api/server_templates/:server_template_id/alert_specs/:id
- PUT /api/servers/:server_id/alert_specs/:id
- HTTP response code
- 204 No Content
Required roles
- designer||instance
Required settings
- alerts
Parameters
name | required | type | values | regexp | blank? | description |
---|---|---|---|---|---|---|
alert_spec | yes | Hash | * | * | no | |
alert_spec[condition] | no | String | >, >=, <, <=, ==, != | * | no | The condition (operator) in the condition sentence. |
alert_spec[description] | no | String | * | * | no | The description of the AlertSpec. |
alert_spec[duration] | no | String | * | ^\d+$ | no | The duration in minutes of the condition sentence. |
alert_spec[escalation_name] | no | String | * | * | no | Escalate to the named alert escalation when the alert is triggered. |
alert_spec[file] | no | String | * | * | no | The RRD path/file_name of the condition sentence. |
alert_spec[name] | no | String | * | * | no | The name of the AlertSpec. |
alert_spec[threshold] | no | String | * | * | no | The threshold of the condition sentence. |
alert_spec[variable] | no | String | * | * | no | The RRD variable of the condition sentence. |
alert_spec[vote_tag] | no | String | * | * | no | Should correspond to a vote tag on a ServerArray if vote to grow or shrink. |
alert_spec[vote_type] | no | String | grow, shrink | * | no | Vote to grow or shrink a ServerArray when the alert is triggered. |
destroy
Deletes a given AlertSpec.
- URLs
- DELETE /api/alert_specs/:id
- DELETE /api/clouds/:cloud_id/instances/:instance_id/alert_specs/:id
- DELETE /api/server_arrays/:server_array_id/alert_specs/:id
- DELETE /api/server_templates/:server_template_id/alert_specs/:id
- DELETE /api/servers/:server_id/alert_specs/:id
- HTTP response code
- 204 No Content
Required roles
- designer||instance
Required settings
- alerts