pydo.monitoring.update_alert_policy()

Generated on 8 May 2026 from pydo version v0.34.0

Usage

client.monitoring.update_alert_policy(
    alert_uuid="4de7ac8b-495b-4884-9a69-1050c6793cd6",
    body={
        "alerts": {...},
        "compare": "GreaterThan",
        "description": "CPU Alert",
        ...,
    },
)
Returns JSONRaises HttpResponseError

Description

To update en existing policy, send a PUT request to v2/monitoring/alerts/{alert_uuid}.

Parameters

alert_uuid string required

A unique identifier for an alert policy.

alerts object required
Show child properties
email array of strings required

Example: ['[email protected]']

An email to notify on an alert trigger.

slack array of objects required

Slack integration details.

Show child properties
channel string required

Example: Production Alerts

Slack channel to notify of an alert trigger.

url string required

Example: https://hooks.slack.com/services/T1234567/AAAAAAAA/ZZZZZZ

Slack Webhook URL.

compare string required

One of: GreaterThan, LessThan

description string required

Example: CPU Alert

enabled boolean required

Example: True

entities array of strings required

Example: ['192018292']

tags array of strings required

Example: ['droplet_tag']

type string required

One of: v1/insights/droplet/load_1, v1/insights/droplet/load_5, v1/insights/droplet/load_15, v1/insights/droplet/memory_utilization_percent, v1/insights/droplet/disk_utilization_percent, v1/insights/droplet/cpu, v1/insights/droplet/disk_read, v1/insights/droplet/disk_write, v1/insights/droplet/public_outbound_bandwidth, v1/insights/droplet/public_inbound_bandwidth, v1/insights/droplet/private_outbound_bandwidth, v1/insights/droplet/private_inbound_bandwidth, v1/insights/lbaas/avg_cpu_utilization_percent, v1/insights/lbaas/connection_utilization_percent, v1/insights/lbaas/droplet_health, v1/insights/lbaas/tls_connections_per_second_utilization_percent, v1/insights/lbaas/increase_in_http_error_rate_percentage_5xx, v1/insights/lbaas/increase_in_http_error_rate_percentage_4xx, v1/insights/lbaas/increase_in_http_error_rate_count_5xx, v1/insights/lbaas/increase_in_http_error_rate_count_4xx, v1/insights/lbaas/high_http_request_response_time, v1/insights/lbaas/high_http_request_response_time_50p, v1/insights/lbaas/high_http_request_response_time_95p, v1/insights/lbaas/high_http_request_response_time_99p, v1/dbaas/alerts/load_15_alerts, v1/dbaas/alerts/memory_utilization_alerts, v1/dbaas/alerts/disk_utilization_alerts, v1/dbaas/alerts/cpu_alerts, v1/droplet/autoscale_alerts/current_instances, v1/droplet/autoscale_alerts/target_instances, v1/droplet/autoscale_alerts/current_cpu_utilization, v1/droplet/autoscale_alerts/target_cpu_utilization, v1/droplet/autoscale_alerts/current_memory_utilization, v1/droplet/autoscale_alerts/target_memory_utilization, v1/droplet/autoscale_alerts/scale_up, v1/droplet/autoscale_alerts/scale_down

value number required

Example: 80

window string required

One of: 5m, 10m, 30m, 1h

Request Sample

Show Request Sample
import os
from pydo import Client

client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN"))

req = {
  "alerts": {
    "email": [
      "[email protected]"
    ],
    "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"
}

resp = client.monitoring.update_alert_policy(alert_uuid="fda9da", body=req)

Response Example

Show Response Example
{
  "policy": {
    "alerts": {
      "email": [
        "[email protected]"
      ],
      "slack": []
    },
    "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"
  }
}

More Information

See /v2/monitoring/alerts/{alert_uuid} in the API reference for additional detail on responses, headers, parameters, and more.

We can't find any results for your search.

Try using different keywords or simplifying your search terms.