Skip to main content

spams

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

Overview​

Namespams
TypeResource
Idovh.ip.spams

Fields​

The following fields are returned by SELECT queries:

successful operation

NameDatatypeDescription
datestring (date-time)Last date the ip was blocked
ip_spammingstring (ipv4)IP address which is sending spam (example: 192.0.2.0) (wire: ipSpamming)
statestringCurrent state of the ip (blockedForSpam, unblocked, unblocking)
timeintegerTime (in seconds) while the IP will be blocked

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectip, ip_spammingGet a spam block. Returns the last block date, the state, and how long, in seconds, the address stays blocked.
listselectipstate, x_pagination_modeList spam blocks. Returns the addresses of the block blocked for sending spam, filterable by state: blockedForSpam, unblocked or unblocking.
unblockexecip, ipSpammingLift 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.

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)
ipSpammingstring (ipv4)IP address which is sending spam
ip_spammingstring (ipv4)IP address which is sending spam (wire: ipSpamming)
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 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
;

Lifecycle Methods​

EXEC variables use wire (API) names.

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
;