pydo.cdn.list_endpoints()

Description

To list all of the CDN endpoints available on your account, send a GET request to /v2/cdn/endpoints.

Parameters

Name Type Required Description Default Value
per_page integer False Number of items returned per page 20
page integer False Which ‘page’ of paginated results to return. 1

Request Sample

import os
from pydo import Client

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

get_resp = client.cdn.list_endpoints()

Responses

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

The result will be a JSON object with an endpoints key. This will be set to an array of endpoint objects, each of which will contain the standard CDN endpoint attributes.

Click to expand an example response.
{
  "endpoints": [
    {
      "id": "19f06b6a-3ace-4315-b086-499a0e521b76",
      "origin": "static-images.nyc3.digitaloceanspaces.com",
      "endpoint": "static-images.nyc3.cdn.digitaloceanspaces.com",
      "created_at": "2018-07-19T15:04:16Z",
      "certificate_id": "892071a0-bb95-49bc-8021-3afd67a210bf",
      "custom_domain": "static.example.com",
      "ttl": 3600
    }
  ],
  "links": {},
  "meta": {
    "total": 1
  }
}

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