pydo.firewalls.list()

Description

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

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

resp = client.firewalls.list()

Responses

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

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

Click to expand an example response.
{
  "firewalls": [
    {
      "id": "fb6045f1-cf1d-4ca3-bfac-18832663025b",
      "name": "firewall",
      "status": "succeeded",
      "inbound_rules": [
        {
          "protocol": "tcp",
          "ports": "80",
          "sources": {
            "load_balancer_uids": [
              "4de7ac8b-495b-4884-9a69-1050c6793cd6"
            ]
          }
        },
        {
          "protocol": "tcp",
          "ports": "22",
          "sources": {
            "tags": [
              "gateway"
            ],
            "addresses": [
              "18.0.0.0/8"
            ]
          }
        }
      ],
      "outbound_rules": [
        {
          "protocol": "tcp",
          "ports": "80",
          "destinations": {
            "addresses": [
              "0.0.0.0/0",
              "::/0"
            ]
          }
        }
      ],
      "created_at": "2017-05-23T21:23:59Z",
      "droplet_ids": [
        8043964
      ],
      "tags": [],
      "pending_changes": []
    }
  ],
  "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"
}