List Firewalls
List all Firewalls Applied to a Droplet
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.
Path Parameters
droplet_idnumber
minimum1
Query Parameters
pagenumber
optional
Which 'page' of paginated results to return.
minimum1
per_pagenumber
optional
Number of items returned per page
minimum1
maximum200
Returns
metatotalnumberMetaProperties
Information about the response itself.
firewallsarray of idstringcreated_atstringdroplet_idsarray of numberinbound_rulesarray of objectnamestringoutbound_rulesarray of objectpending_changesarray of objectstatusenumtagsarray of stringFirewall
optional
curl https://api.digitalocean.com//v2/droplets/$DROPLET_ID/firewalls \
-H "Authorization: Bearer $GRADIENTAI_API_KEY"
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"
}
}
}