Preview — pending review
This reference is generated from the platform API contract and is still under review. Operations, fields, and descriptions can change before publication.
Update an alert rule
Partially updates a rule: only the fields present are applied. A partial condition
keeps the omitted value. Changing the selector (target.match) or the condition
re-evaluates the rule on the next tick without inventing a transition: an instance that is
FIRING stays FIRING while the new selector or condition still breaches it, and resolves
(notifying) when it does not. Instances the new selector no longer matches leave the set
and any open alert of theirs is resolved once.
Disabling a rule resolves EVERY open alert it holds: the rule's state becomes OK, one
event per firing instance with reason=rule_disabled is recorded, the RESOLVED
notifications are sent and billing stops for every matched instance. A disabled rule is
not evaluated; re-enabling starts a fresh for clock for every member. A channel outside
the project is 404; a bad condition or an empty match is 422; a selector whose new match
set would exceed the project's rule-unit limit is 409 QUOTA_EXCEEDED.
RBAC: MANAGE on the observability plane (owner, contributor).
bearerTokenAuthorizationBearer <token>An API token (pc_live_…) or a service-account key (sak_live_…), created in Identity & Access Management and sent as Authorization: Bearer <token>. Requests are rate limited per credential and per tenant: every response carries X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset, and a refused request gets 429 RATE_LIMITED with Retry-After.
scopeId*stringOpaque ownership+authorization scope resolving to tenant + subscription + project.
alertRuleId*stringapplication/json- body
Partial update of an alert rule; only present fields are applied.
name?stringNew display name of the rule.
^[^\p{C}\p{Z}\x{10000}-\x{10FFFF}](?:[^\p{C}\p{Zl}\p{Zp}\x{10000}-\x{10FFFF}]*[^\p{C}\p{Z}\x{10000}-\x{10FFFF}])?$1 <= length <= 255target?The set of resources a rule watches, named by tags. Every key: value pair must match (AND); at least one pair is required -- an empty selector is 422, never "every instance".
condition?The window + for condition. Omitted values take their defaults (create) or keep their current value (update). metric, comparator and threshold are required for a metric rule and ignored for instance_state.
channelIds?array<string>items <= 10enabled?booleanThe updated rule.
application/json- response
An alert rule of a project and its current evaluation state.
id*stringname*stringprovider*AlertRuleProviderSignal the rule evaluates. instance_state fires on an instance in ERROR; metric compares a VM metric of an instance with monitoring ON against a threshold. The vocabulary grows.
"instance_state""metric"target*A rule's tag selector and what it matches RIGHT NOW. matchedCount is resolved on every read, so it is true the moment an instance is tagged -- before the next evaluation has run -- while instances carries the per-instance state of the last evaluation.
condition*The effective window + for condition. The metric fields are present only on metric rules.
channelIds*array<string>Notification channels (same project) that receive FIRING and RESOLVED notifications.
enabled*booleanstate*AlertRuleStateEvaluation state. INSUFFICIENT_DATA before the first evaluation and while the signal has no data (e.g. the target was deleted).
"OK""FIRING""INSUFFICIENT_DATA"stateSince*stringISO-8601 time the rule entered its current state.
lastEvaluatedAt*|ISO-8601 time of the last evaluation; null before the first.
createdAt*stringcreatedBy*stringupdatedAt*stringcurl -X PATCH "https://example.com/scopes/string/observability/alert-rules/string" \ -H "Content-Type: application/json" \ -d '{}'{ "id": "string", "name": "string", "provider": "instance_state", "target": { "kind": "instance_selector", "match": { "property1": "string", "property2": "string" }, "matchedCount": 0, "monitoringDisabledCount": 0, "instances": [ { "id": "string", "name": "string", "state": "OK", "stateSince": "string", "lastValue": 0, "lastEvaluatedAt": "string" } ] }, "condition": { "metric": "cpu.utilization", "aggregation": "avg", "comparator": "gt", "threshold": 0, "windowSeconds": 0, "forSeconds": 0 }, "channelIds": [ "string" ], "enabled": true, "state": "OK", "stateSince": "string", "lastEvaluatedAt": "string", "createdAt": "string", "createdBy": "string", "updatedAt": "string"}