Update a cluster monitor
PATCHhttps://api.spice.ai/v1/clusters/{clusterId}/monitors/{alertId}
Updates the rule, destination, or status and reprovisions the monitor. Requires monitors:write and organization admin privileges.
Authorizations
AuthorizationstringRequiredBearer <token>. Authentication lists the tokens it accepts.
Path parameters
clusterIdstringRequiredalertIdstring (uuid)Required
Header parameters
X-Org-NamestringThe organization to act on, by handle. Omit it to act on the organization the credential is bound to; sending it blank is a 400, not the same as omitting it. A user credential may name any organization its owner belongs to; a machine credential is pinned to its own. A portal session token is bound to none, so it must send this header on every route but
GET /v1/orgs(400org_assertion_requiredotherwise).- Pattern:
^[A-Za-z0-9._-]{1,255}$
- Pattern:
Body
application/jsonRequired
namestring- Minimum length:
1 - Maximum length:
100
- Minimum length:
descriptionstring | null- Maximum length:
500
- Maximum length:
statusstring- Allowed values:
active,disabled
- Allowed values:
templateIdstring- Allowed values:
cluster_cpu,cluster_memory,cluster_availability
- Allowed values:
specobject14 properties
opstringRequired- Allowed values:
GT,GEQ,LT,LEQ,EQ,NEQ
- Allowed values:
thresholdnumberRequiredwindowstring- Allowed values:
1m,5m,15m,30m,1h - Default:
5m
- Allowed values:
sustainSecsinteger- Default:
300 - Minimum:
0 - Maximum:
86400
- Default:
severitystring- Allowed values:
warn,critical - Default:
critical
- Allowed values:
datasetstring- Minimum length:
1 - Maximum length:
128 - Pattern:
^(?!.*\.\.)[A-Za-z_][A-Za-z0-9_.-]*$
- Minimum length:
columnstring- Minimum length:
1 - Maximum length:
64 - Pattern:
^[A-Za-z_][A-Za-z0-9_]*$
- Minimum length:
valuestring | numberdatasetsarray of string- Maximum items:
20
- Maximum items:
conditionsarray of object- Maximum items:
20
4 properties
datasetstringRequired- Minimum length:
1 - Maximum length:
128 - Pattern:
^(?!.*\.\.)[A-Za-z_][A-Za-z0-9_.-]*$
- Minimum length:
columnstringRequired- Minimum length:
1 - Maximum length:
64 - Pattern:
^[A-Za-z_][A-Za-z0-9_]*$
- Minimum length:
opstringRequired- Allowed values:
EQ,NEQ,GT,GEQ,LT,LEQ,CONTAINS,STARTS_WITH,ENDS_WITH,IS_NULL,IS_NOT_NULL
- Allowed values:
valuestring | number
- Maximum items:
queryLanguagestring- Allowed values:
cypher,gql
- Allowed values:
returnFieldsarray of objectDataset fields returned by generated row-match queries. Include identity and all monitored fields.
- Maximum items:
20
2 properties
datasetstringRequiredcolumnsarray of stringRequired- Minimum items:
1 - Maximum items:
1000
- Minimum items:
- Maximum items:
querystring- Maximum length:
10000
- Maximum length:
includeDetailsboolean
targetobjectOmit to keep the existing destination.
3 options
One of
type: emailobject
typestringRequired- Value:
email
- Value:
recipientUserIdsarray of integerOrganization members to email, by user ID.
- Maximum items:
50
- Maximum items:
emailsarray of string (email)- Maximum items:
20
- Maximum items:
type: httpobject
typestringRequired- Value:
http
- Value:
urlstring (uri)RequiredThe URL each notification is sent to, using
method. Must be https and must resolve to a public address.- Minimum length:
1 - Maximum length:
2048
- Minimum length:
methodstringA create that omits it uses POST. An update that omits it keeps the stored method.
- Allowed values:
POST,PUT,PATCH
- Allowed values:
tokenstringBearer token sent with each delivery. Stored encrypted and never returned.
- Minimum length:
1 - Maximum length:
512
- Minimum length:
type: slackobject
typestringRequired- Value:
slack
- Value:
channelIdstringRequiredSlack conversation id. The organization must already have Slack connected.
- Minimum length:
9 - Maximum length:
32 - Pattern:
^[CGD][A-Z0-9]{8,31}$
- Minimum length:
channelNamestring- Minimum length:
1 - Maximum length:
80
- Minimum length:
targetsarray of objectFull destination set. When present, replaces the stored sinks. Omit to keep them.
- Minimum items:
1 - Maximum items:
3
3 options
One of
type: emailobject
typestringRequired- Value:
email
- Value:
recipientUserIdsarray of integerOrganization members to email, by user ID.
- Maximum items:
50
- Maximum items:
emailsarray of string (email)- Maximum items:
20
- Maximum items:
type: httpobject
typestringRequired- Value:
http
- Value:
urlstring (uri)RequiredThe URL each notification is sent to, using
method. Must be https and must resolve to a public address.- Minimum length:
1 - Maximum length:
2048
- Minimum length:
methodstringA create that omits it uses POST. An update that omits it keeps the stored method.
- Allowed values:
POST,PUT,PATCH
- Allowed values:
tokenstringBearer token sent with each delivery. Stored encrypted and never returned.
- Minimum length:
1 - Maximum length:
512
- Minimum length:
type: slackobject
typestringRequired- Value:
slack
- Value:
channelIdstringRequiredSlack conversation id. The organization must already have Slack connected.
- Minimum length:
9 - Maximum length:
32 - Pattern:
^[CGD][A-Z0-9]{8,31}$
- Minimum length:
channelNamestring- Minimum length:
1 - Maximum length:
80
- Minimum length:
- Minimum items:
recipientUserIdsarray of integer
Responses
200Monitor updated
400Invalid request or monitor ID
401Unauthorized
403Insufficient scope or role
404Cluster or monitor not found
409Duplicate monitor name or monitor changed during updateapplication/json
errorstringRequiredcodestringRequired- Allowed values:
monitor_name_conflict,monitor_changed
- Allowed values:
413Request body too large
422Destination is unavailable
500Internal server error
502Monitor backend update failed; the saved rule may be pending and the request can be retried
curl -X PATCH "https://api.spice.ai/v1/clusters/<clusterId>/monitors/<alertId>" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"name": "string",
"description": "string",
"status": "active",
"templateId": "cluster_cpu",
"spec": {
"op": "GT",
"threshold": 0
},
"target": {
"type": "email"
},
"targets": [
{
"type": "email"
}
],
"recipientUserIds": [
0
]
}'PATCH /v1/clusters/<clusterId>/monitors/<alertId> HTTP/1.1
Host: api.spice.ai
Authorization: Bearer <token>
Content-Type: application/json
Content-Length: 282
{
"name": "string",
"description": "string",
"status": "active",
"templateId": "cluster_cpu",
"spec": {
"op": "GT",
"threshold": 0
},
"target": {
"type": "email"
},
"targets": [
{
"type": "email"
}
],
"recipientUserIds": [
0
]
}No response body
No response body
No response body
No response body
No response body
{
"error": "string",
"code": "monitor_name_conflict"
}application/json
No response body
No response body
No response body
No response body
PATCHhttps://api.spice.ai/v1/orgs/{orgId}/clusters/{clusterId}/monitors/{alertId}
The org is orgId in the path. Updates the rule, destination, or status and reprovisions the monitor. Requires monitors:write and organization admin privileges.
Authorizations
AuthorizationstringRequiredBearer <token>. Authentication lists the tokens it accepts.
Path parameters
orgIdintegerRequiredThe org id from GET /v1/orgs
- Minimum:
1
- Minimum:
clusterIdstringRequiredalertIdstring (uuid)Required
Header parameters
X-Org-NamestringWhen present, X-Org-Name must name the same org as orgId. Otherwise the request returns org_path_mismatch (400).
- Pattern:
^[A-Za-z0-9._-]{1,255}$
- Pattern:
Body
application/jsonRequired
namestring- Minimum length:
1 - Maximum length:
100
- Minimum length:
descriptionstring | null- Maximum length:
500
- Maximum length:
statusstring- Allowed values:
active,disabled
- Allowed values:
templateIdstring- Allowed values:
cluster_cpu,cluster_memory,cluster_availability
- Allowed values:
specobject14 properties
opstringRequired- Allowed values:
GT,GEQ,LT,LEQ,EQ,NEQ
- Allowed values:
thresholdnumberRequiredwindowstring- Allowed values:
1m,5m,15m,30m,1h - Default:
5m
- Allowed values:
sustainSecsinteger- Default:
300 - Minimum:
0 - Maximum:
86400
- Default:
severitystring- Allowed values:
warn,critical - Default:
critical
- Allowed values:
datasetstring- Minimum length:
1 - Maximum length:
128 - Pattern:
^(?!.*\.\.)[A-Za-z_][A-Za-z0-9_.-]*$
- Minimum length:
columnstring- Minimum length:
1 - Maximum length:
64 - Pattern:
^[A-Za-z_][A-Za-z0-9_]*$
- Minimum length:
valuestring | numberdatasetsarray of string- Maximum items:
20
- Maximum items:
conditionsarray of object- Maximum items:
20
4 properties
datasetstringRequired- Minimum length:
1 - Maximum length:
128 - Pattern:
^(?!.*\.\.)[A-Za-z_][A-Za-z0-9_.-]*$
- Minimum length:
columnstringRequired- Minimum length:
1 - Maximum length:
64 - Pattern:
^[A-Za-z_][A-Za-z0-9_]*$
- Minimum length:
opstringRequired- Allowed values:
EQ,NEQ,GT,GEQ,LT,LEQ,CONTAINS,STARTS_WITH,ENDS_WITH,IS_NULL,IS_NOT_NULL
- Allowed values:
valuestring | number
- Maximum items:
queryLanguagestring- Allowed values:
cypher,gql
- Allowed values:
returnFieldsarray of objectDataset fields returned by generated row-match queries. Include identity and all monitored fields.
- Maximum items:
20
2 properties
datasetstringRequiredcolumnsarray of stringRequired- Minimum items:
1 - Maximum items:
1000
- Minimum items:
- Maximum items:
querystring- Maximum length:
10000
- Maximum length:
includeDetailsboolean
targetobjectOmit to keep the existing destination.
3 options
One of
type: emailobject
typestringRequired- Value:
email
- Value:
recipientUserIdsarray of integerOrganization members to email, by user ID.
- Maximum items:
50
- Maximum items:
emailsarray of string (email)- Maximum items:
20
- Maximum items:
type: httpobject
typestringRequired- Value:
http
- Value:
urlstring (uri)RequiredThe URL each notification is sent to, using
method. Must be https and must resolve to a public address.- Minimum length:
1 - Maximum length:
2048
- Minimum length:
methodstringA create that omits it uses POST. An update that omits it keeps the stored method.
- Allowed values:
POST,PUT,PATCH
- Allowed values:
tokenstringBearer token sent with each delivery. Stored encrypted and never returned.
- Minimum length:
1 - Maximum length:
512
- Minimum length:
type: slackobject
typestringRequired- Value:
slack
- Value:
channelIdstringRequiredSlack conversation id. The organization must already have Slack connected.
- Minimum length:
9 - Maximum length:
32 - Pattern:
^[CGD][A-Z0-9]{8,31}$
- Minimum length:
channelNamestring- Minimum length:
1 - Maximum length:
80
- Minimum length:
targetsarray of objectFull destination set. When present, replaces the stored sinks. Omit to keep them.
- Minimum items:
1 - Maximum items:
3
3 options
One of
type: emailobject
typestringRequired- Value:
email
- Value:
recipientUserIdsarray of integerOrganization members to email, by user ID.
- Maximum items:
50
- Maximum items:
emailsarray of string (email)- Maximum items:
20
- Maximum items:
type: httpobject
typestringRequired- Value:
http
- Value:
urlstring (uri)RequiredThe URL each notification is sent to, using
method. Must be https and must resolve to a public address.- Minimum length:
1 - Maximum length:
2048
- Minimum length:
methodstringA create that omits it uses POST. An update that omits it keeps the stored method.
- Allowed values:
POST,PUT,PATCH
- Allowed values:
tokenstringBearer token sent with each delivery. Stored encrypted and never returned.
- Minimum length:
1 - Maximum length:
512
- Minimum length:
type: slackobject
typestringRequired- Value:
slack
- Value:
channelIdstringRequiredSlack conversation id. The organization must already have Slack connected.
- Minimum length:
9 - Maximum length:
32 - Pattern:
^[CGD][A-Z0-9]{8,31}$
- Minimum length:
channelNamestring- Minimum length:
1 - Maximum length:
80
- Minimum length:
- Minimum items:
recipientUserIdsarray of integer
Responses
200Monitor updated
400Bad Request
Invalid request or monitor ID. orgId is not a valid org id (invalid_org_id), or X-Org-Name does not name that org (org_path_mismatch).
401Unauthorized
403Forbidden
Insufficient scope or role. The caller is not a member of the org (org_forbidden). A machine credential named a different org (org_assertion_mismatch). The org is deleted (org_deleted).
404Cluster or monitor not found
409Duplicate monitor name or monitor changed during updateapplication/json
errorstringRequiredcodestringRequired- Allowed values:
monitor_name_conflict,monitor_changed
- Allowed values:
413Request body too large
422Destination is unavailable
500Internal server error
502Monitor backend update failed; the saved rule may be pending and the request can be retried
OpenAPIapi.spice.ai/openapi.json
curl -X PATCH "https://api.spice.ai/v1/orgs/<orgId>/clusters/<clusterId>/monitors/<alertId>" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"name": "string",
"description": "string",
"status": "active",
"templateId": "cluster_cpu",
"spec": {
"op": "GT",
"threshold": 0
},
"target": {
"type": "email"
},
"targets": [
{
"type": "email"
}
],
"recipientUserIds": [
0
]
}'PATCH /v1/orgs/<orgId>/clusters/<clusterId>/monitors/<alertId> HTTP/1.1
Host: api.spice.ai
Authorization: Bearer <token>
Content-Type: application/json
Content-Length: 282
{
"name": "string",
"description": "string",
"status": "active",
"templateId": "cluster_cpu",
"spec": {
"op": "GT",
"threshold": 0
},
"target": {
"type": "email"
},
"targets": [
{
"type": "email"
}
],
"recipientUserIds": [
0
]
}No response body
No response body
No response body
No response body
No response body
{
"error": "string",
"code": "monitor_name_conflict"
}application/json
No response body
No response body
No response body
No response body