Skip to main content

mitigations

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

Overview​

Namemitigations
TypeResource
Idovh.ip.mitigations

Fields​

The following fields are returned by SELECT queries:

successful operation

NameDatatypeDescription
autobooleanSet on true if your ip is on auto-mitigation
ip_on_mitigationstring (ipv4)IPv4 address (e.g., 192.0.2.0) (example: 192.0.2.0) (wire: ipOnMitigation)
permanentbooleanDEPRECATED: this field is kept for backward compatibility of the API, changing its value has no operational impact
statestringCurrent state of your ip on mitigation (creationPending, ok, removalPending)

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectip, ip_on_mitigationGet a mitigation entry. Returns whether a given IP address of the block is under VAC auto-mitigation, and its state: creationPending, ok or removalPending.
listselectipauto, state, x_pagination_modeList mitigation entries. Returns the IP addresses of the block that have a VAC DDoS mitigation entry. Filterable by state or auto-mitigation.
createinsertip, ip_on_mitigationCreate a mitigation entry. Creates a VAC DDoS mitigation entry for an IP address of the block. No longer needed: entries are created automatically during an attack.
updateupdateip, ip_on_mitigationUpdate a mitigation entry. Changes the permanent flag of the entry, kept only for backward compatibility: the change has no operational impact. (Deprecated, will be removed)
deletedeleteip, ip_on_mitigationDelete a mitigation entry. Removes a given IP address of the block from VAC mitigation, and returns its mitigation entry with its state.

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_mitigationstring (ipv4) (wire: ipOnMitigation)
autobooleanFilter the value of auto 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 mitigation entry. Returns whether a given IP address of the block is under VAC auto-mitigation, and its state: creationPending, ok or removalPending.

SELECT
auto,
ip_on_mitigation,
permanent,
state
FROM ovh.ip.mitigations
WHERE ip = '{{ ip }}' -- required
AND ip_on_mitigation = '{{ ip_on_mitigation }}' -- required
;

INSERT examples​

Create a mitigation entry. Creates a VAC DDoS mitigation entry for an IP address of the block. No longer needed: entries are created automatically during an attack.

INSERT INTO ovh.ip.mitigations (
ip_on_mitigation,
ip
)
SELECT
'{{ ip_on_mitigation }}' /* required */,
'{{ ip }}'
RETURNING
auto,
ip_on_mitigation,
permanent,
state
;

UPDATE examples​

Update a mitigation entry. Changes the permanent flag of the entry, kept only for backward compatibility: the change has no operational impact. (Deprecated, will be removed)

UPDATE ovh.ip.mitigations
SET
permanent = {{ permanent }}
WHERE
ip = '{{ ip }}' --required
AND ip_on_mitigation = '{{ ip_on_mitigation }}' --required;

DELETE examples​

Delete a mitigation entry. Removes a given IP address of the block from VAC mitigation, and returns its mitigation entry with its state.

DELETE FROM ovh.ip.mitigations
WHERE ip = '{{ ip }}' --required
AND ip_on_mitigation = '{{ ip_on_mitigation }}' --required
;