pydo.databases.list_firewall_rules()

Description

To list all of a database cluster’s firewall rules (known as “trusted sources” in the control panel), send a GET request to /v2/databases/$DATABASE_ID/firewall. The result will be a JSON object with a rules key.

Parameters

Name Type Required Description Default Value
database_cluster_uuid string True A unique identifier for a database cluster.

Request Sample

import os
from pydo import Client

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

get_resp = client.databases.list_firewall_rules(database_cluster_uuid="a7aab9a")

Responses

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

A JSON object with a key of rules.

Click to expand an example response.
{
  "rules": [
    {
      "uuid": "79f26d28-ea8a-41f2-8ad8-8cfcdd020095",
      "cluster_uuid": "9cc10173-e9ea-4176-9dbc-a4cee4c4ff30",
      "type": "k8s",
      "value": "ff2a6c52-5a44-4b63-b99c-0e98e7a63d61",
      "created_at": "2019-11-14T20:30:28Z"
    },
    {
      "uuid": "adfe81a8-0fa1-4e2d-973f-06aa5af19b44",
      "cluster_uuid": "9cc10173-e9ea-4176-9dbc-a4cee4c4ff30",
      "type": "ip_addr",
      "value": "192.168.1.1",
      "created_at": "2019-11-14T20:30:28Z"
    },
    {
      "uuid": "b9b42276-8295-4313-b40f-74173a7f46e6",
      "cluster_uuid": "9cc10173-e9ea-4176-9dbc-a4cee4c4ff30",
      "type": "droplet",
      "value": "163973392",
      "created_at": "2019-11-14T20:30:28Z"
    },
    {
      "uuid": "718d23e0-13d7-4129-8a00-47fb72ee0deb",
      "cluster_uuid": "9cc10173-e9ea-4176-9dbc-a4cee4c4ff30",
      "type": "tag",
      "value": "backend",
      "created_at": "2019-11-14T20:30:28Z"
    }
  ]
}

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