mitigations
Creates, updates, deletes, gets or lists a mitigations resource.
Overview​
| Name | mitigations |
| Type | Resource |
| Id | ovh.ip.mitigations |
Fields​
The following fields are returned by SELECT queries:
- get
- list
successful operation
| Name | Datatype | Description |
|---|---|---|
auto | boolean | Set on true if your ip is on auto-mitigation |
ip_on_mitigation | string (ipv4) | IPv4 address (e.g., 192.0.2.0) (example: 192.0.2.0) (wire: ipOnMitigation) |
permanent | boolean | DEPRECATED: this field is kept for backward compatibility of the API, changing its value has no operational impact |
state | string | Current state of your ip on mitigation (creationPending, ok, removalPending) |
Your IP on mitigation
| Name | Datatype | Description |
|---|---|---|
auto | boolean | Set on true if your ip is on auto-mitigation |
ip_on_mitigation | string (ipv4) | IPv4 address (e.g., 192.0.2.0) (example: 192.0.2.0) (wire: ipOnMitigation) |
permanent | boolean | DEPRECATED: this field is kept for backward compatibility of the API, changing its value has no operational impact |
state | string | Current state of your ip on mitigation (creationPending, ok, removalPending) |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | ip, ip_on_mitigation | 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. | |
list | select | ip | auto, state, x_pagination_mode | List mitigation entries. Returns the IP addresses of the block that have a VAC DDoS mitigation entry. Filterable by state or auto-mitigation. |
create | insert | ip, ip_on_mitigation | 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. | |
update | update | ip, ip_on_mitigation | 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) | |
delete | delete | ip, ip_on_mitigation | Delete 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.
| 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_mitigation | string (ipv4) | (wire: ipOnMitigation) |
auto | boolean | Filter the value of auto 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 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
;
List mitigation entries. Returns the IP addresses of the block that have a VAC DDoS mitigation entry. Filterable by state or auto-mitigation.
SELECT
auto,
ip_on_mitigation,
permanent,
state
FROM ovh.ip.mitigations
WHERE ip = '{{ ip }}' -- required
AND auto = '{{ auto }}'
AND state = '{{ state }}'
AND x_pagination_mode = '{{ x_pagination_mode }}'
;
INSERT examples​
- create
- Manifest
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
;
# Description fields are for documentation purposes
- name: mitigations
props:
- name: ip
value: "{{ ip }}"
description: Required parameter for the mitigations resource.
- name: ip_on_mitigation
value: "{{ ip_on_mitigation }}"
description: |
IPv4 address (e.g., 192.0.2.0)
UPDATE examples​
- update
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
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
;