Skip to main content

update-alert

restish dci update-alert id

Updates the alert specified by the Id.

Request

Content-Type: application/json

Schema

{
"required": [
"config"
],
"type": "object",
"properties": {
"config": {
"type": "object",
"required": [
"metric",
"timeInterval",
"value"
],
"properties": {
"condition": {
"type": "string"
},
"currency": {
"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",
"required": [
"type",
"value"
],
"properties": {
"type": {
"type": "string"
},
"value": {
"type": "string"
}
}
},
"operator": {
"type": "string"
},
"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",
"description": "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 filter or exclude certain values by type.\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": {
"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 that will be notified when the alert is triggered",
"items": {
"type": "string"
}
}
}
}

Responses

200 (application/json)

OK - Alert updated.

{
"required": [
"name"
],
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "Alert ID."
},
"name": {
"type": "string",
"description": "Alert Name.",
"default": ""
},
"createTime": {
"type": "integer",
"description": "The time when the alter 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",
"required": [
"metric",
"timeInterval",
"value"
],
"properties": {
"condition": {
"type": "string"
},
"currency": {
"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",
"required": [
"type",
"value"
],
"properties": {
"type": {
"type": "string"
},
"value": {
"type": "string"
}
}
},
"operator": {
"type": "string"
},
"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",
"description": "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 filter or exclude certain values by type.\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": {
"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",
"properties": {
"error": {
"type": "string",
"description": "Detailed error message."
}
}
}

401 (application/json)

Unauthorized - Invalid API key.

{
"type": "object",
"properties": {
"error": {
"type": "string",
"description": "Detailed error message."
}
}
}

403 (application/json)

Forbidden - The client is not authorized to perform the request.

{
"type": "object",
"properties": {
"error": {
"type": "string",
"description": "Detailed error message."
}
}
}

404 (application/json)

Not Found - The requested resource does not exist.

{
"type": "object",
"properties": {
"error": {
"type": "string",
"description": "Detailed error message."
}
}
}

Aliases: update-alert, updatealert