Skip to main content

droplets_firewalls

Creates, updates, deletes, gets or lists a droplets_firewalls resource.

Overview

Namedroplets_firewalls
TypeResource
Iddigitalocean.compute.droplets_firewalls

Fields

The following fields are returned by SELECT queries:

A JSON object that has a key called firewalls.

NameDatatypeDescription
idstringA unique ID that can be used to identify and reference a firewall. (example: bb4b2611-3d72-467b-8602-280330ecd65c)
namestringA 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_atstring (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_idsarrayAn array containing the IDs of the Droplets assigned to the firewall.

Requires droplet:read scope.
inbound_rulesarray
outbound_rulesarray
pending_changesarrayAn 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.
statusstringA status string indicating the current state of the firewall. This can be "waiting", "succeeded", or "failed". (example: waiting)
tagsarrayA 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:

NameAccessible byRequired ParamsOptional ParamsDescription
droplets_list_firewallsselectdroplet_idper_page, pageTo 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

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.

NameDatatypeDescription
droplet_idintegerA unique identifier for a Droplet instance. (example: 3164444)
pageintegerWhich 'page' of paginated results to return. (example: 1)
per_pageintegerNumber of items returned per page (example: 2)

SELECT examples

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.

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 }}';