pydo.droplets.list_firewalls()

Description

To retrieve a list of all firewalls available to a Droplet, send a GET request to /v2/droplets/$DROPLET_ID/firewalls

The response will be a JSON object that has a key called firewalls. This will be set to an array of firewall objects, each of which contain the standard firewall attributes.

Parameters

Name Type Required Description Default Value
droplet_id integer True A unique identifier for a Droplet instance.
per_page integer False Number of items returned per page 20
page integer False Which ‘page’ of paginated results to return. 1

Responses

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

A JSON object that has a key called firewalls.

Click to expand an example response.
{
  "firewalls": [
    {
      "id": "bb4b2611-3d72-467b-8602-280330ecd65c",
      "status": "succeeded",
      "created_at": "2020-05-23T21:24:00Z",
      "pending_changes": [
        {
          "droplet_id": 8043964,
          "removing": true,
          "status": "waiting"
        }
      ],
      "name": "firewall",
      "droplet_ids": [
        89989,
        33322
      ],
      "tags": [
        "base-image",
        "prod"
      ],
      "inbound_rules": [
        {
          "protocol": "udp",
          "ports": "8000-9000",
          "sources": {
            "addresses": [
              "1.2.3.4",
              "18.0.0.0/8"
            ],
            "droplet_ids": [
              8282823,
              3930392
            ],
            "load_balancer_uids": [
              "4de7ac8b-495b-4884-9a69-1050c6793cd6"
            ],
            "tags": [
              "base-image",
              "dev"
            ]
          }
        }
      ],
      "outbound_rules": [
        {
          "protocol": "tcp",
          "ports": "7000-9000",
          "destinations": {
            "addresses": [
              "1.2.3.4",
              "18.0.0.0/8"
            ],
            "droplet_ids": [
              3827493,
              213213
            ],
            "load_balancer_uids": [
              "4de7ac8b-495b-4884-9a69-1050c6793cd6"
            ],
            "tags": [
              "base-image",
              "prod"
            ]
          }
        }
      ]
    }
  ],
  "links": {
    "pages": {}
  },
  "meta": {
    "total": 1
  }
}

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