rules
Creates, updates, deletes, gets or lists a rules
resource.
Overview
Name | rules |
Type | Resource |
Id | digitalocean.firewalls.rules |
Fields
SELECT
not supported for this resource, use SHOW METHODS
to view available operations for the resource.
Methods
Name | Accessible by | Required Params | Description |
---|---|---|---|
firewalls_add_rules | INSERT | firewall_id | To 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_rules | DELETE | firewall_id | To 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.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO digitalocean.firewalls.rules (
data__inbound_rules,
data__outbound_rules,
firewall_id
)
SELECT
'{{ inbound_rules }}',
'{{ outbound_rules }}',
'{{ firewall_id }}'
;
/*+ create */
INSERT INTO digitalocean.firewalls.rules (
firewall_id
)
SELECT
'{{ firewall_id }}'
;
- name: rules
props:
- name: firewall_id
value: string
- name: inbound_rules
value: array
props:
- name: protocol
value: string
- name: ports
value: string
- name: sources
props:
- name: addresses
value: array
- name: droplet_ids
value: array
- name: load_balancer_uids
value: array
- name: kubernetes_ids
value: array
- name: tags
value: array
- name: outbound_rules
value: array
props:
- name: protocol
value: string
- name: ports
value: string
- name: destinations
props:
- name: addresses
value: array
- name: droplet_ids
value: array
- name: load_balancer_uids
value: array
- name: kubernetes_ids
value: array
- name: tags
value: array
DELETE
example
Deletes the specified rules
resource.
/*+ delete */
DELETE FROM digitalocean.firewalls.rules
WHERE firewall_id = '{{ firewall_id }}';