droplets_firewalls
Creates, updates, deletes, gets or lists a droplets_firewalls
resource.
Overview
Name | droplets_firewalls |
Type | Resource |
Id | digitalocean.compute.droplets_firewalls |
Fields
The following fields are returned by SELECT
queries:
- droplets_list_firewalls
A JSON object that has a key called firewalls
.
Name | Datatype | Description |
---|---|---|
id | string | A unique ID that can be used to identify and reference a firewall. (example: bb4b2611-3d72-467b-8602-280330ecd65c) |
name | string | A human-readable name for a firewall. The name must begin with an alphanumeric character. Subsequent characters must either be alphanumeric characters, a period (.), or a dash (-). (pattern: ^[a-zA-Z0-9][a-zA-Z0-9.-]+$, example: firewall) |
created_at | string (date-time) | A time value given in ISO8601 combined date and time format that represents when the firewall was created. (example: 2020-05-23T21:24:00Z) |
droplet_ids | array | An array containing the IDs of the Droplets assigned to the firewall. Requires droplet:read scope. |
inbound_rules | array | |
outbound_rules | array | |
pending_changes | array | An array of objects each containing the fields "droplet_id", "removing", and "status". It is provided to detail exactly which Droplets are having their security policies updated. When empty, all changes have been successfully applied. |
status | string | A status string indicating the current state of the firewall. This can be "waiting", "succeeded", or "failed". (example: waiting) |
tags | array | A flat array of tag names as strings to be applied to the resource. Tag names must exist in order to be referenced in a request. Requires tag:create and tag:read scopes. |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
droplets_list_firewalls | select | droplet_id | per_page , page | 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 willbe set to an array of firewall objects, each of which contain the standardfirewall attributes. |
Parameters
Parameters can be passed in the WHERE
clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
Name | Datatype | Description |
---|---|---|
droplet_id | integer | A unique identifier for a Droplet instance. (example: 3164444) |
page | integer | Which 'page' of paginated results to return. (example: 1) |
per_page | integer | Number of items returned per page (example: 2) |
SELECT
examples
- droplets_list_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 standardfirewall
attributes.
SELECT
id,
name,
created_at,
droplet_ids,
inbound_rules,
outbound_rules,
pending_changes,
status,
tags
FROM digitalocean.compute.droplets_firewalls
WHERE droplet_id = '{{ droplet_id }}' -- required
AND per_page = '{{ per_page }}'
AND page = '{{ page }}';