firewalls
Creates, updates, deletes, gets or lists a firewalls resource.
Overview​
| Name | firewalls |
| Type | Resource |
| Id | ovh.ip.firewalls |
Fields​
The following fields are returned by SELECT queries:
- get
- list
successful operation
| Name | Datatype | Description |
|---|---|---|
enabled | boolean | |
ip_on_firewall | string (ipv4) | IPv4 address (e.g., 192.0.2.0) (example: 192.0.2.0) (wire: ipOnFirewall) |
state | string | Current state of your ip on firewall (disableFirewallPending, enableFirewallPending, ok) |
Your IP on firewall
| Name | Datatype | Description |
|---|---|---|
enabled | boolean | |
ip_on_firewall | string (ipv4) | IPv4 address (e.g., 192.0.2.0) (example: 192.0.2.0) (wire: ipOnFirewall) |
state | string | Current state of your ip on firewall (disableFirewallPending, enableFirewallPending, ok) |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | ip, ip_on_firewall | Get a firewalled IP. Returns whether the firewall is enabled on this address, and its state: ok, enableFirewallPending or disableFirewallPending. | |
list | select | ip | enabled, state, x_pagination_mode | List firewalled IPs. Returns the addresses of the block added to the firewall, filterable by state or by whether the firewall is enabled. |
create | insert | ip, ip_on_firewall | Create a firewalled IP. Adds one address of the block to the firewall. Turn it on with Update a firewalled IP. | |
update | update | ip, ip_on_firewall | Update a firewalled IP. Turns the firewall on or off for this address. Its state is enableFirewallPending or disableFirewallPending until the change is applied. | |
delete | delete | ip, ip_on_firewall | Delete a firewalled IP. Removes the address of the block from the firewall, together with all the rules set on it. |
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 |
|---|---|---|
api_host | string | The OVHcloud API host. Selected by OVH_ENDPOINT (ovh-eu, ovh-ca or ovh-us; default ovh-eu). (default: api.eu.ovhcloud.com, x-stackQL-envVarSelector: {"envVar":"OVH_ENDPOINT","default":"ovh-eu","values":{"ovh-eu":"api.eu.ovhcloud.com","ovh-ca":"api.ca.ovhcloud.com","ovh-us":"api.us.ovhcloud.com"}}) |
ip | string (ip-block) | |
ip_on_firewall | string (ipv4) | (wire: ipOnFirewall) |
enabled | boolean | Filter the value of enabled property (=) |
state | string | Filter the value of state property (=) |
x_pagination_mode | string | Sent as CachedObjectList-Pages by default so the list returns the full objects rather than their identifiers. (wire: X-Pagination-Mode) |
SELECT examples​
- get
- list
Get a firewalled IP. Returns whether the firewall is enabled on this address, and its state: ok, enableFirewallPending or disableFirewallPending.
SELECT
enabled,
ip_on_firewall,
state
FROM ovh.ip.firewalls
WHERE ip = '{{ ip }}' -- required
AND ip_on_firewall = '{{ ip_on_firewall }}' -- required
;
List firewalled IPs. Returns the addresses of the block added to the firewall, filterable by state or by whether the firewall is enabled.
SELECT
enabled,
ip_on_firewall,
state
FROM ovh.ip.firewalls
WHERE ip = '{{ ip }}' -- required
AND enabled = '{{ enabled }}'
AND state = '{{ state }}'
AND x_pagination_mode = '{{ x_pagination_mode }}'
;
INSERT examples​
- create
- Manifest
Create a firewalled IP. Adds one address of the block to the firewall. Turn it on with Update a firewalled IP.
INSERT INTO ovh.ip.firewalls (
ip_on_firewall,
ip
)
SELECT
'{{ ip_on_firewall }}' /* required */,
'{{ ip }}'
RETURNING
enabled,
ip_on_firewall,
state
;
# Description fields are for documentation purposes
- name: firewalls
props:
- name: ip
value: "{{ ip }}"
description: Required parameter for the firewalls resource.
- name: ip_on_firewall
value: "{{ ip_on_firewall }}"
description: |
IPv4 address (e.g., 192.0.2.0)
UPDATE examples​
- update
Update a firewalled IP. Turns the firewall on or off for this address. Its state is enableFirewallPending or disableFirewallPending until the change is applied.
UPDATE ovh.ip.firewalls
SET
enabled = {{ enabled }}
WHERE
ip = '{{ ip }}' --required
AND ip_on_firewall = '{{ ip_on_firewall }}' --required;
DELETE examples​
- delete
Delete a firewalled IP. Removes the address of the block from the firewall, together with all the rules set on it.
DELETE FROM ovh.ip.firewalls
WHERE ip = '{{ ip }}' --required
AND ip_on_firewall = '{{ ip_on_firewall }}' --required
;