pydo.monitoring.get_droplet_memory_available_metrics()

Description

To retrieve available memory metrics for a given droplet, send a GET request to /v2/monitoring/metrics/droplet/memory_available.

Parameters

Name Type Required Description Default Value
host_id string True The droplet ID.
start string True UNIX timestamp to start metric window.
end string True UNIX timestamp to end metric window.

Request Sample

import os
from pydo import Client

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

resp = client.monitoring.get_droplet_memory_available_metrics(host_id="17209102", start="1620683817", end="1620705417")

Responses

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

The response will be a JSON object with a key called data and status.

Click to expand an example response.
{
  "data": {
    "result": [
      {
        "metric": {
          "host_id": "19201920"
        },
        "values": [
          [
            1435781430,
            "1"
          ],
          [
            1435781445,
            "1"
          ]
        ]
      },
      {
        "metric": {
          "host_id": "19201920"
        },
        "values": [
          [
            1435781430,
            "1"
          ],
          [
            1435781445,
            "1"
          ]
        ]
      }
    ],
    "resultType": "matrix"
  },
  "status": "success"
}

Unauthorized

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

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"
}