List Firewalls
List all Firewalls Applied to a Droplet
gpu_droplets.list_firewalls(intdroplet_id, GPUDropletListFirewallsParams**kwargs) -> metaMetaPropertiesfirewallslistlinksPageLinksGPUDropletListFirewallsResponse
get/v2/droplets/{droplet_id}/firewalls
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
droplet_idint
minimum1
pageint
optional
Which 'page' of paginated results to return.
minimum1
per_pageint
optional
Number of items returned per page
minimum1
maximum200
Returns
GPUDropletListFirewallsResponseclass
from do_gradientai import GradientAI
client = GradientAI()
response = client.gpu_droplets.list_firewalls(
droplet_id=3164444,
)
print(response.meta)
200 Example
{
"meta": {
"total": 1
},
"firewalls": [
{
"droplet_ids": [
8043964
],
"inbound_rules": [
{
"ports": "8000",
"protocol": "tcp",
"sources": {
"addresses": [
"1.2.3.4",
"18.0.0.0/8"
],
"droplet_ids": [
8043964
],
"kubernetes_ids": [
"41b74c5d-9bd0-5555-5555-a57c495b81a3"
],
"load_balancer_uids": [
"4de7ac8b-495b-4884-9a69-1050c6793cd6"
],
"tags": [
"base-image",
"prod"
]
}
}
],
"name": "firewall",
"outbound_rules": [
{
"destinations": {
"addresses": [
"1.2.3.4",
"18.0.0.0/8"
],
"droplet_ids": [
8043964
],
"kubernetes_ids": [
"41b74c5d-9bd0-5555-5555-a57c495b81a3"
],
"load_balancer_uids": [
"4de7ac8b-495b-4884-9a69-1050c6793cd6"
],
"tags": [
"base-image",
"prod"
]
},
"ports": "8000",
"protocol": "tcp"
}
],
"tags": [
"base-image",
"prod"
]
}
],
"links": {
"pages": {
"last": "https://api.digitalocean.com/v2/images?page=2",
"next": "https://api.digitalocean.com/v2/images?page=2"
}
}
}