DigitalOcean-public.v2-new_Monitoring
Create Alert Policy
To create a new alert, send a POST request to /v2/monitoring/alerts.
post/v2/monitoring/alerts
Request body
Example request
{
"alerts": {
"email": [
"bob@exmaple.com"
],
"slack": [
{
"channel": "Production Alerts",
"url": "https://hooks.slack.com/services/T1234567/AAAAAAAA/ZZZZZZ"
}
]
},
"compare": "GreaterThan",
"description": "CPU Alert",
"enabled": true,
"entities": [
"192018292"
],
"tags": [
"droplet_tag"
],
"type": "v1/insights/droplet/cpu",
"value": 80,
"window": "5m"
}Response
An alert policy.
Example response
{
"policy": {
"alerts": {
"email": [
"bob@exmaple.com"
],
"slack": [
{
"channel": "Production Alerts",
"url": "https://hooks.slack.com/services/T1234567/AAAAAAAA/ZZZZZZ"
}
]
},
"compare": "GreaterThan",
"description": "CPU Alert",
"enabled": true,
"entities": [
"192018292"
],
"tags": [
"droplet_tag"
],
"type": "v1/insights/droplet/cpu",
"uuid": "78b3da62-27e5-49ba-ac70-5db0b5935c64",
"value": 80,
"window": "5m"
}
}