update-alert
restish dci update-alert id
Updates the alert specified by the Id.
Requestβ
Content-Type: application/json
Schemaβ
{
"required": [
"config"
],
"type": "object",
"description": "Request body for modifying an existing alert.",
"properties": {
"config": {
"type": "object",
"description": "Parameters that define when and how an alert is evaluated.",
"required": [
"metric",
"timeInterval",
"value"
],
"properties": {
"condition": {
"type": "string",
"description": "Condition key or expression used in alert configurations."
},
"currency": {
"description": "Currency code for monetary values.",
"type": "string",
"enum": [
"USD",
"ILS",
"EUR",
"AUD",
"CAD",
"GBP",
"DKK",
"NOK",
"SEK",
"BRL",
"SGD",
"MXN",
"CHF",
"MYR",
"TWD",
"EGP",
"ZAR",
"JPY",
"IDR",
"AED",
"THB",
"COP"
]
},
"metric": {
"type": "object",
"description": "Define how metrics are selected and filtered in reports.",
"required": [
"type",
"value"
],
"properties": {
"type": {
"type": "string",
"description": "Identifier for metric type (e.g., basic, custom, extended)."
},
"value": {
"type": "string"
}
}
},
"operator": {
"type": "string",
"description": "Text/operator used to filter metric values in metric filters.",
"enum": [
"gt",
"lt"
]
},
"evaluateForEach": {
"type": "string",
"description": "Add a dimension to break down the evaluation of the condition. For example, evaluate a condition over an attribution for each \"Service\"."
},
"attributions": {
"type": "array",
"deprecated": true,
"description": "Use 'scopes' instead. The attributions selected define the scope to monitor.",
"items": {
"type": "string"
}
},
"scopes": {
"type": "array",
"description": "The filters selected define the scope of the alert.",
"items": {
"description": "To include or exclude certain values.\nWhen using attributions as a filter, both the type and the ID must be \"attribution\", and the values array contains the attribution IDs.",
"type": "object",
"required": [
"id",
"type",
"mode"
],
"properties": {
"id": {
"type": "string",
"description": "The field to filter on"
},
"type": {
"description": "Enumeration of supported dimension/filter types.",
"type": "string",
"enum": [
"datetime",
"fixed",
"optional",
"label",
"tag",
"project_label",
"system_label",
"attribution",
"attribution_group",
"gke",
"gke_label"
]
},
"mode": {
"type": "string",
"description": "Filter mode to apply",
"enum": [
"is",
"starts_with",
"ends_with",
"contains",
"regexp"
]
},
"inverse": {
"type": "boolean",
"description": "Set to `true` to exclude the values."
},
"values": {
"type": "array",
"description": "Values to filter on.",
"items": {
"type": "string"
}
}
},
"example": {
"id": "cloud_provider",
"type": "fixed",
"inverse": false,
"values": [
"google-cloud"
]
}
}
},
"timeInterval": {
"type": "string",
"description": "The time interval to evaluate the condition.",
"default": "year",
"enum": [
"hour",
"day",
"week",
"month",
"quarter",
"year"
]
},
"dataSource": {
"type": "string"
},
"value": {
"type": "number",
"format": "double"
}
}
},
"name": {
"type": "string",
"description": "Alert name"
},
"recipients": {
"type": "array",
"description": "List of emails to notify when the alert is triggered.",
"items": {
"type": "string"
}
}
}
}
Responsesβ
200 (application/json)β
OK - Alert updated.
{
"required": [
"name"
],
"type": "object",
"description": "Configuration and runtime metadata of an alert.",
"properties": {
"id": {
"type": "string",
"description": "Alert ID."
},
"name": {
"type": "string",
"description": "Alert Name.",
"default": ""
},
"createTime": {
"type": "integer",
"description": "The time when the alert was created (in UNIX timestamp).",
"format": "int64"
},
"updateTime": {
"type": "integer",
"description": "Last time the alert was modified (in UNIX timestamp).",
"format": "int64"
},
"lastAlerted": {
"type": "integer",
"description": "Last time the alert was triggered (in UNIX timestamp).",
"format": "int64"
},
"recipients": {
"type": "array",
"description": "List of emails that will be notified when the alert is triggered.",
"items": {
"type": "string"
}
},
"config": {
"type": "object",
"description": "Parameters that define when and how an alert is evaluated.",
"required": [
"metric",
"timeInterval",
"value"
],
"properties": {
"condition": {
"type": "string",
"description": "Condition key or expression used in alert configurations."
},
"currency": {
"description": "Currency code for monetary values.",
"type": "string",
"enum": [
"USD",
"ILS",
"EUR",
"AUD",
"CAD",
"GBP",
"DKK",
"NOK",
"SEK",
"BRL",
"SGD",
"MXN",
"CHF",
"MYR",
"TWD",
"EGP",
"ZAR",
"JPY",
"IDR",
"AED",
"THB",
"COP"
]
},
"metric": {
"type": "object",
"description": "Define how metrics are selected and filtered in reports.",
"required": [
"type",
"value"
],
"properties": {
"type": {
"type": "string",
"description": "Identifier for metric type (e.g., basic, custom, extended)."
},
"value": {
"type": "string"
}
}
},
"operator": {
"type": "string",
"description": "Text/operator used to filter metric values in metric filters.",
"enum": [
"gt",
"lt"
]
},
"evaluateForEach": {
"type": "string",
"description": "Add a dimension to break down the evaluation of the condition. For example, evaluate a condition over an attribution for each \"Service\"."
},
"attributions": {
"type": "array",
"deprecated": true,
"description": "Use 'scopes' instead. The attributions selected define the scope to monitor.",
"items": {
"type": "string"
}
},
"scopes": {
"type": "array",
"description": "The filters selected define the scope of the alert.",
"items": {
"description": "To include or exclude certain values.\nWhen using attributions as a filter, both the type and the ID must be \"attribution\", and the values array contains the attribution IDs.",
"type": "object",
"required": [
"id",
"type",
"mode"
],
"properties": {
"id": {
"type": "string",
"description": "The field to filter on"
},
"type": {
"description": "Enumeration of supported dimension/filter types.",
"type": "string",
"enum": [
"datetime",
"fixed",
"optional",
"label",
"tag",
"project_label",
"system_label",
"attribution",
"attribution_group",
"gke",
"gke_label"
]
},
"mode": {
"type": "string",
"description": "Filter mode to apply",
"enum": [
"is",
"starts_with",
"ends_with",
"contains",
"regexp"
]
},
"inverse": {
"type": "boolean",
"description": "Set to `true` to exclude the values."
},
"values": {
"type": "array",
"description": "Values to filter on.",
"items": {
"type": "string"
}
}
},
"example": {
"id": "cloud_provider",
"type": "fixed",
"inverse": false,
"values": [
"google-cloud"
]
}
}
},
"timeInterval": {
"type": "string",
"description": "The time interval to evaluate the condition.",
"default": "year",
"enum": [
"hour",
"day",
"week",
"month",
"quarter",
"year"
]
},
"dataSource": {
"type": "string"
},
"value": {
"type": "number",
"format": "double"
}
}
}
},
"example": {
"id": "7jyrczd6CSh3M8TuQ6Qq",
"name": "fgfgh",
"createTime": 1678628817062,
"updateTime": 1678628938891,
"lastAlerted": null,
"recipients": [
"[email protected]",
"[email protected]"
],
"config": {
"condition": "value",
"currency": "USD",
"metric": {
"type": "basic",
"value": "cost"
},
"operator": "gt",
"evaluateForEach": "",
"attributions": [
"PvqyGcdFcTHh7aLUdGdf"
],
"scopes": [],
"timeInterval": "month",
"dataSource": "billing",
"value": 500
}
}
}
400 (application/json)β
Bad Request - The server cannot process the request, often due to a malformed request.
{
"type": "object",
"description": "Standard error response structure.",
"properties": {
"error": {
"type": "string",
"description": "Detailed error message."
}
}
}
401 (application/json)β
Unauthorized - Invalid API key.
{
"type": "object",
"description": "Standard error response structure.",
"properties": {
"error": {
"type": "string",
"description": "Detailed error message."
}
}
}
403 (application/json)β
Forbidden - The client is not authorized to perform the request.
{
"type": "object",
"description": "Standard error response structure.",
"properties": {
"error": {
"type": "string",
"description": "Detailed error message."
}
}
}
404 (application/json)β
Not Found - The requested resource does not exist.
{
"type": "object",
"description": "Standard error response structure.",
"properties": {
"error": {
"type": "string",
"description": "Detailed error message."
}
}
}
Aliases: update-alert, updatealert