Skip to main content

rules

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

Overview

Namerules
TypeResource
Iddigitalocean.firewalls.rules

Fields

SELECT not supported for this resource, use SHOW METHODS to view available operations for the resource.

Methods

NameAccessible byRequired ParamsDescription
firewalls_add_rulesINSERTfirewall_idTo add additional access rules to a firewall, send a POST request to /v2/firewalls/$FIREWALL_ID/rules. The body of the request may include an inbound_rules and/or outbound_rules attribute containing an array of rules to be added. No response body will be sent back, but the response code will indicate success. Specifically, the response code will be a 204, which means that the action was successful with no returned body data.
firewalls_delete_rulesDELETEfirewall_idTo remove access rules from a firewall, send a DELETE request to /v2/firewalls/$FIREWALL_ID/rules. The body of the request may include an inbound_rules and/or outbound_rules attribute containing an array of rules to be removed. No response body will be sent back, but the response code will indicate success. Specifically, the response code will be a 204, which means that the action was successful with no returned body data.

INSERT example

Use the following StackQL query and manifest file to create a new rules resource.

/*+ create */
INSERT INTO digitalocean.firewalls.rules (
data__inbound_rules,
data__outbound_rules,
firewall_id
)
SELECT
'{{ inbound_rules }}',
'{{ outbound_rules }}',
'{{ firewall_id }}'
;

DELETE example

Deletes the specified rules resource.

/*+ delete */
DELETE FROM digitalocean.firewalls.rules
WHERE firewall_id = '{{ firewall_id }}';