spams
Creates, updates, deletes, gets or lists a spams resource.
Overview​
| Name | spams |
| Type | Resource |
| Id | ovh.ip.spams |
Fields​
The following fields are returned by SELECT queries:
- get
- list
successful operation
| Name | Datatype | Description |
|---|---|---|
date | string (date-time) | Last date the ip was blocked |
ip_spamming | string (ipv4) | IP address which is sending spam (example: 192.0.2.0) (wire: ipSpamming) |
state | string | Current state of the ip (blockedForSpam, unblocked, unblocking) |
time | integer | Time (in seconds) while the IP will be blocked |
Your IP spam stats
| Name | Datatype | Description |
|---|---|---|
date | string (date-time) | Last date the ip was blocked |
ip_spamming | string (ipv4) | IP address which is sending spam (example: 192.0.2.0) (wire: ipSpamming) |
state | string | Current state of the ip (blockedForSpam, unblocked, unblocking) |
time | integer | Time (in seconds) while the IP will be blocked |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | ip, ip_spamming | Get a spam block. Returns the last block date, the state, and how long, in seconds, the address stays blocked. | |
list | select | ip | state, x_pagination_mode | List spam blocks. Returns the addresses of the block blocked for sending spam, filterable by state: blockedForSpam, unblocked or unblocking. |
unblock | exec | ip, ipSpamming | Lift a spam block. Releases the address from the anti-spam system, and returns the spam block of the address. |
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) | |
ipSpamming | string (ipv4) | IP address which is sending spam |
ip_spamming | string (ipv4) | IP address which is sending spam (wire: ipSpamming) |
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 spam block. Returns the last block date, the state, and how long, in seconds, the address stays blocked.
SELECT
date,
ip_spamming,
state,
time
FROM ovh.ip.spams
WHERE ip = '{{ ip }}' -- required
AND ip_spamming = '{{ ip_spamming }}' -- required
;
List spam blocks. Returns the addresses of the block blocked for sending spam, filterable by state: blockedForSpam, unblocked or unblocking.
SELECT
date,
ip_spamming,
state,
time
FROM ovh.ip.spams
WHERE ip = '{{ ip }}' -- required
AND state = '{{ state }}'
AND x_pagination_mode = '{{ x_pagination_mode }}'
;
Lifecycle Methods​
EXEC variables use wire (API) names.
- unblock
Lift a spam block. Releases the address from the anti-spam system, and returns the spam block of the address.
EXEC ovh.ip.spams.unblock
@ip='{{ ip }}' --required,
@ipSpamming='{{ ipSpamming }}' --required
;