API reference
Alarms
Alarm rules and the alarms they raised.
Its operations need the scopes alarms.edit, alarms.view or alarms.delete.
Create an alarm
POST/v1/alarms
Creates an alarm on a resource, named by entity_type and entity_uuid, from a catalogue rule named by rule_slug (read the catalogue with GET /v1/alarm-rules, narrowed by the resource’s sub-type, since the catalogue holds rules a resource of another sub-type does not support). Every other field is optional and falls back to the rule’s default. A second alarm on the same rule and resource is allowed, for two sensitivities of one metric. A resource holds at most 40 alarms, and an alarm that a profile left deleted still counts: it is refused with 422 when the resource is full. active and alarm_policy_uuids cannot be null; an empty alarm_policy_uuids means no policies.
Needs the scope alarms.edit.
Headers
- Idempotency-KeystringOptional
Any text of 1 to 255 visible ASCII characters. A repeat of the same request within 24 hours returns the first answer without running again (the response carries
Idempotent-Replayed: true); the same key on a different request is refused 422invalid_request.
Body parameters
- entity_typestringRequired
The type of resource the alarm is on; required. The same values
GET /v1/alarmstakes.Values:domainserviceserverlog_sourcecustom_metricdatabase_instanceserver_portserver_system_serviceserver_volume(an open set: new values may be added) - entity_uuidstring (uuid)Required
The uuid of the resource the alarm is on; required. A resource of another organisation answers 404.
- rule_slugstringRequired
The slug of the catalogue rule the alarm is based on, from
GET /v1/alarm-rules; required. A slug that does not exist for the entity type is refused. - namestring or nullOptional
The alarm’s own name, up to 255 characters; it tells apart two alarms on one metric. Left out, the alarm takes its rule’s name.
- aggregationstring or nullOptional
How the readings in a window are combined before the comparison:
sum,count,avg,min,maxorlast. Left out, the rule’s default applies.Values:sumcountavgminmaxlast(an open set: new values may be added) - comparison_operatorstring or nullOptional
How a reading is compared with the thresholds:
lt,lte,gt,gteoreq. Left out, the rule’s default applies.Values:ltltegtgteeq(an open set: new values may be added) - warning_thresholdnumber or nullOptional
The warning threshold, a number; negatives and fractions are allowed. Left out, the rule’s default applies.
- critical_thresholdnumber or nullOptional
The critical threshold, a number; negatives and fractions are allowed. A warning threshold past the critical one, in the direction the comparison goes, is refused. Left out, the rule’s default applies.
- warning_window_minutesinteger or nullOptional
The window, in minutes, the warning threshold is judged over, from 1 to 43200 (30 days). Left out, the rule’s default applies.
- critical_window_minutesinteger or nullOptional
The window, in minutes, the critical threshold is judged over, from 1 to 43200 (30 days). Left out, the rule’s default applies.
- warning_consecutive_failures_countinteger or nullOptional
Consecutive evaluations before a warning, from 1 to 100. Left out, the rule’s default applies.
- critical_consecutive_failures_countinteger or nullOptional
Consecutive evaluations before a critical, from 1 to 100; a warning count above it is refused. Left out, the rule’s default applies.
- activebooleanOptional
Whether the alarm starts switched on;
truewhen left out.nullis refused. - notify_on_acknowledgeboolean or nullOptional
Whether acknowledging an incident of the alarm notifies. Left out, the catalogue rule’s flag applies.
- notify_on_resolveboolean or nullOptional
Whether resolving an incident of the alarm notifies. Left out, the catalogue rule’s flag applies.
- alarm_policy_uuidsarray of stringsOptional
The alarm policies the alarm notifies; an empty list or none means no policies, and
nullis refused. Each uuid is a policy of this organisation.
Returns
201 Created:
The created alarm.
Each failure is a problem document with a stable code; the response panel's status selector shows each one this operation can answer, and errors lists them all.
Update an alarm
PUT/v1/alarms/{alarm_uuid}
Changes the fields sent; what is not sent keeps its value. active: false switches the alarm off and resolves its open incidents at once; active: true switches it back on. A null returns a threshold, window, consecutive count, aggregation or comparison_operator to the catalogue rule’s default, name to the rule’s name and a notify flag to the catalogue’s; active and alarm_policy_uuids cannot be null, and alarm_policy_uuids: [] clears the policies. alarm_policy_uuids, when sent, replaces the list. Thresholds out of order are refused with 422. Editing an alarm that came from a profile template makes it overridden, so a later propagation of the template leaves it alone: an alarm switched off here is no longer changed by its profile. An alarm that was deleted answers 404.
Needs the scope alarms.edit.
Headers
- Idempotency-KeystringOptional
Any text of 1 to 255 visible ASCII characters. A repeat of the same request within 24 hours returns the first answer without running again (the response carries
Idempotent-Replayed: true); the same key on a different request is refused 422invalid_request.
Path parameters
- alarm_uuidstring (uuid)Required
The uuid of the alarm in the path. A soft-deleted alarm and a deleted inherited alarm’s tombstone answer 404.
Body parameters
- namestring or nullOptional
The alarm’s own name, up to 255 characters; it tells apart two alarms on one metric. Send
nullto return it to the catalogue rule’s name. - aggregationstring or nullOptional
How the readings in a window are combined before the comparison:
sum,count,avg,min,maxorlast. Sendnullto return it to the rule’s default.Values:sumcountavgminmaxlast(an open set: new values may be added) - comparison_operatorstring or nullOptional
How a reading is compared with the thresholds:
lt,lte,gt,gteoreq. Sendnullto return it to the rule’s default.Values:ltltegtgteeq(an open set: new values may be added) - warning_thresholdnumber or nullOptional
The warning threshold, a number; negatives and fractions are allowed. Send
nullto return it to the rule’s default. - critical_thresholdnumber or nullOptional
The critical threshold, a number; negatives and fractions are allowed. A warning threshold past the critical one, in the direction the comparison goes, is refused. Send
nullto return it to the rule’s default. - warning_window_minutesinteger or nullOptional
The window, in minutes, the warning threshold is judged over, from 1 to 43200 (30 days). Send
nullto return it to the rule’s default. - critical_window_minutesinteger or nullOptional
The window, in minutes, the critical threshold is judged over, from 1 to 43200 (30 days). Send
nullto return it to the rule’s default. - warning_consecutive_failures_countinteger or nullOptional
Consecutive evaluations before a warning, from 1 to 100. Send
nullto return it to the rule’s default. - critical_consecutive_failures_countinteger or nullOptional
Consecutive evaluations before a critical, from 1 to 100; a warning count above it is refused. Send
nullto return it to the rule’s default. - activebooleanOptional
Whether the alarm is switched on.
falseswitches it off and resolves its open incidents at once;nullis refused. An alarm that came from a profile template becomesoverriddenwhen it is edited, so a later propagation leaves it alone. - notify_on_acknowledgeboolean or nullOptional
Whether acknowledging an incident of the alarm notifies. Send
nullto return it to the catalogue rule’s flag. - notify_on_resolveboolean or nullOptional
Whether resolving an incident of the alarm notifies. Send
nullto return it to the catalogue rule’s flag. - alarm_policy_uuidsarray of stringsOptional
The alarm policies the alarm notifies, a full replacement of the saved ones;
[]detaches every policy andnullis refused. Each uuid is a policy of this organisation.
Returns
200 OK:
The alarm after the change.
Each failure is a problem document with a stable code; the response panel's status selector shows each one this operation can answer, and errors lists them all.
Get one alarm
GET/v1/alarms/{alarm_uuid}
Returns one alarm by its uuid, as the alarm list gives it: its thresholds, live state, resource and the policies it notifies. An alarm that was deleted answers 404, whether it was removed or left as a tombstone by a profile.
Needs the scope alarms.view.
Path parameters
- alarm_uuidstring (uuid)Required
The uuid of the alarm in the path. A soft-deleted alarm and a deleted inherited alarm’s tombstone answer 404.
Returns
200 OK:
The alarm.
Each failure is a problem document with a stable code; the response panel's status selector shows each one this operation can answer, and errors lists them all.
List alarms of a resource
GET/v1/alarms
Lists the alarms set on one resource, named by entity_type and entity_uuid, both required, with each alarm’s thresholds and live state. The state and the time it began are read from the alarm’s open incident, if any. For every alarm of the organisation in one call use GET /v1/organisation/alarms; for a server with its volumes, ports and units, GET /v1/servers/{server_uuid}/alarms. Pages by page and per_page (limit is the same as per_page); every page carries current_page, per_page, last_page and total.
Needs the scope alarms.view.
Query parameters
- entity_typestringRequired
The type of resource whose alarms are listed; required.
Values:domainserviceserverlog_sourcecustom_metricdatabase_instanceserver_portserver_system_serviceserver_volume(an open set: new values may be added) - entity_uuidstring (uuid)Required
The uuid of the resource whose alarms are listed; required.
- limitinteger or nullOptional
The same as
per_page, kept for existing clients. - include_totalstring or nullOptional
Ignored:
totalis always present.Values:truefalse10(an open set: new values may be added) - per_pageinteger or nullOptional
How many alarms to return in one page, from 1 to 100.
- pageinteger or nullOptional
The page to read, from 1; 1 when omitted. A page past the last answers no rows.
Returns
200 OK:
One page of the resource’s alarms.
Each item of the page:
- uuidstring
The alarm’s uuid.
- namestring
The alarm’s own name, else its rule’s.
- rule_slugstring
The catalogue rule’s slug.
- classificationstring
The catalogue rule’s classification: one of
operations,security,monitoring. On a server it decides which of the server’s three healths an open incident moves; the other resources keep one health that counts every classification. - metric_namestring
The catalogue rule’s name.
- descriptionstring or null
The catalogue rule’s description; null when it has none.
- alarm_typestring or null
booleanorthreshold, as the catalogue rule says. - unitstring or null
The unit of the thresholds; null when the rule has none.
- comparison_operatorstring
How a reading is compared with the thresholds: the alarm’s own operator, else the rule’s default.
- aggregationstring or null
How the readings in a window are combined before the comparison; null when the alarm sets none.
- warning_thresholdnumber or null
The alarm’s own value, else the rule’s default.
- critical_thresholdnumber or null
The alarm’s own value, else the rule’s default.
- warning_window_minutesinteger or null
The window, in minutes, the warning threshold is judged over; null when the alarm has none.
- critical_window_minutesinteger or null
The window, in minutes, the critical threshold is judged over; null when the alarm has none.
- warning_consecutive_failures_countinteger
Consecutive evaluations before a warning: the alarm’s own count, else the rule’s default.
- critical_consecutive_failures_countinteger
Consecutive evaluations before a critical: the alarm’s own count, else the rule’s default.
- self_resolvingboolean
Whether the alarm clears itself when the condition ends (it sends no resolve notification).
- activeboolean
Whether the alarm is switched on.
- notify_on_acknowledgeboolean
Whether acknowledging an incident of this alarm notifies: the alarm’s own flag, else the catalogue’s. Never null.
- notify_on_resolveboolean
Whether resolving an incident of this alarm notifies: the alarm’s own flag, else the catalogue’s. Never null.
- entityobject
The resource the alarm is on, of any type that has alarms.
- typestring
The type of the resource, such as
server. - uuidstring or null
The uuid of the resource; null when it no longer resolves.
- namestring or null
The name of the resource; null when it no longer resolves.
- parent_entityobject or null
The server of a volume, port or unit; null for every other resource.
- typestring
The type of the server, such as
server. - uuidstring
The uuid of the server.
- alarm_policiesarray of objects
The policies the alarm notifies. A caller holding
policies.view(the key’s scope and the user’s permission) gets each policy’sname; without it, the uuid alone.- uuidstring
The policy’s uuid.
- namestring
The policy’s name; present only for a caller holding
policies.view.
- statestring
One of
ok,warning,critical,inactive.Values:criticalwarningokinactive(an open set: new values may be added) - inactive_reasonstring or null
switched_offorresource_inactivewhilestateisinactive; null otherwise. - state_sinceinteger or null
Epoch milliseconds: when the open incident was triggered, while
stateiswarningorcritical; null otherwise.An instant: epoch milliseconds, UTC. - acknowledgedboolean
Whether the open incident has been acknowledged.
Each failure is a problem document with a stable code; the response panel's status selector shows each one this operation can answer, and errors lists them all.
Delete an alarm
DELETE/v1/alarms/{alarm_uuid}
Deletes an alarm. Its open incidents resolve silently and its incident history stays. A deleted alarm does not come back by itself: not when its profile propagates its templates and not at the next deploy. To keep an alarm and turn it back on later, switch it off with PUT /v1/alarms/{alarm_uuid} instead. A second delete answers 404.
Needs the scope alarms.delete.
Headers
- Idempotency-KeystringOptional
Any text of 1 to 255 visible ASCII characters. A repeat of the same request within 24 hours returns the first answer without running again (the response carries
Idempotent-Replayed: true); the same key on a different request is refused 422invalid_request.
Path parameters
- alarm_uuidstring (uuid)Required
The uuid of the alarm in the path. A soft-deleted alarm and a deleted inherited alarm’s tombstone answer 404.
Returns
204 No Content:
Nothing: the answer is 204.
Each failure is a problem document with a stable code; the response panel's status selector shows each one this operation can answer, and errors lists them all.