pydo.functions.list_namespaces()

Description

Returns a list of namespaces associated with the current user. To get all namespaces, send a GET request to /v2/functions/namespaces.

Request Sample

import os
from pydo import Client

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

resp = client.functions.list_namespaces()

Responses

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

An array of JSON objects with a key called namespaces. Each object represents a namespace and contains the properties associated with it.

Click to expand an example response.
{
  "namespaces": [
    {
      "api_host": "https://api_host.io",
      "namespace": "fn-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
      "created_at": "2022-09-14T04:16:45Z",
      "updated_at": "2022-09-14T04:16:45Z",
      "label": "my namespace",
      "region": "nyc1",
      "uuid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
      "key": "d1zcd455h01mqjfs4s2eaewyejehi5f2uj4etqq3h7cera8iwkub6xg5of1wdde2"
    },
    {
      "api_host": "https://api_host.io",
      "namespace": "fn-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
      "created_at": "2022-09-14T04:16:45Z",
      "updated_at": "2022-09-14T04:16:45Z",
      "label": "my namespace",
      "region": "nyc1",
      "uuid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
      "key": "d1zcd455h01mqjfs4s2eaewyejehi5f2uj4etqq3h7cera8iwkub6xg5of1wdde2"
    }
  ]
}

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