Skip to main content

firewalls

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

Overview​

Namefirewalls
TypeResource
Idovh.ip.firewalls

Fields​

The following fields are returned by SELECT queries:

successful operation

NameDatatypeDescription
enabledboolean
ip_on_firewallstring (ipv4)IPv4 address (e.g., 192.0.2.0) (example: 192.0.2.0) (wire: ipOnFirewall)
statestringCurrent state of your ip on firewall (disableFirewallPending, enableFirewallPending, ok)

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectip, ip_on_firewallGet a firewalled IP. Returns whether the firewall is enabled on this address, and its state: ok, enableFirewallPending or disableFirewallPending.
listselectipenabled, state, x_pagination_modeList firewalled IPs. Returns the addresses of the block added to the firewall, filterable by state or by whether the firewall is enabled.
createinsertip, ip_on_firewallCreate a firewalled IP. Adds one address of the block to the firewall. Turn it on with Update a firewalled IP.
updateupdateip, ip_on_firewallUpdate a firewalled IP. Turns the firewall on or off for this address. Its state is enableFirewallPending or disableFirewallPending until the change is applied.
deletedeleteip, ip_on_firewallDelete 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.

NameDatatypeDescription
api_hoststringThe 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"}})
ipstring (ip-block)
ip_on_firewallstring (ipv4) (wire: ipOnFirewall)
enabledbooleanFilter the value of enabled property (=)
statestringFilter the value of state property (=)
x_pagination_modestringSent as CachedObjectList-Pages by default so the list returns the full objects rather than their identifiers. (wire: X-Pagination-Mode)

SELECT examples​

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
;

INSERT examples​

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
;

UPDATE examples​

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