pydo.certificates.list()

Description

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

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
name string False Name of expected certificate

Request Sample

import os
from pydo import Client

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

get_resp = client.certificates.list()

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 a certificates key. This will be set to an array of certificate objects, each of which will contain the standard certificate attributes.

Click to expand an example response for AllCertificates.
{
  "value": {
    "certificates": [
      {
        "id": "892071a0-bb95-49bc-8021-3afd67a210bf",
        "name": "web-cert-01",
        "not_after": "2017-02-22T00:23:00Z",
        "sha1_fingerprint": "dfcc9f57d86bf58e321c2c6c31c7a971be244ac7",
        "created_at": "2017-02-08T16:02:37Z",
        "dns_names": [
          ""
        ],
        "state": "verified",
        "type": "custom"
      },
      {
        "id": "ba9b9c18-6c59-46c2-99df-70da170a42ba",
        "name": "web-cert-02",
        "not_after": "2018-06-07T17:44:12Z",
        "sha1_fingerprint": "479c82b5c63cb6d3e6fac4624d58a33b267e166c",
        "created_at": "2018-03-09T18:44:11Z",
        "dns_names": [
          "www.example.com",
          "example.com"
        ],
        "state": "verified",
        "type": "lets_encrypt"
      }
    ],
    "links": {},
    "meta": {
      "total": 2
    }
  }
}

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