pydo.apps.list_alerts()

Description

List alerts associated to the app and any components. This includes configuration information about the alerts including emails, slack webhooks, and triggering events or conditions.

Parameters

Name Type Required Description Default Value
app_id string True The app ID

Request Sample

import os
from pydo import Client

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

get_resp = client.apps.list_alerts(app_id="4f6c71e2")

Responses

See the API spec for this endpoint to view additional detail on responses, headers, parameters, and more.

A JSON object with a alerts key. This is list of object alerts.

Click to expand an example response for apps.
{
  "value": {
    "alerts": [
      {
        "id": "e552e1f9-c1b0-4e6d-8777-ad6f27767306",
        "spec": {
          "rule": "DEPLOYMENT_FAILED"
        },
        "emails": [
          "[email protected]"
        ],
        "phase": "ACTIVE",
        "progress": {
          "steps": [
            {
              "name": "alert-configure-insight-alert",
              "status": "SUCCESS",
              "started_at": "2020-07-28T18:00:00Z",
              "ended_at": "2020-07-28T18:00:00Z"
            }
          ]
        }
      },
      {
        "id": "b58cc9d4-0702-4ffd-ab45-4c2a8d979527",
        "spec": {
          "rule": "CPU_UTILIZATION",
          "operator": "GREATER_THAN",
          "value": 85,
          "window": "FIVE_MINUTES"
        },
        "emails": [
          "[email protected]"
        ],
        "phase": "ACTIVE",
        "progress": {
          "steps": [
            {
              "name": "alert-configure-insight-alert",
              "status": "SUCCESS",
              "started_at": "2020-07-28T18:00:00Z",
              "ended_at": "2020-07-28T18:00:00Z"
            }
          ]
        }
      }
    ]
  }
}

Unauthorized

Click to expand an example response.
{
  "id": "unauthorized",
  "message": "Unable to authenticate you."
}

The resource was not found.

Click to expand an example response.
{
  "id": "not_found",
  "message": "The resource you requested could not be found."
}

API Rate limit exceeded

Click to expand an example response.
{
  "id": "too_many_requests",
  "message": "API Rate limit exceeded."
}

Server error.

Click to expand an example response.
{
  "id": "server_error",
  "message": "Unexpected server-side error"
}

Unexpected error

Click to expand an example response.
{
  "id": "example_error",
  "message": "some error message"
}