Skip to main content

monitoring_notifications

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

Overview​

Namemonitoring_notifications
TypeResource
Idovh.xdsl.monitoring_notifications

Fields​

The following fields are returned by SELECT queries:

successful operation

NameDatatypeDescription
idinteger
allow_incidentbooleanWhether or not to allow notifications for generic incidents (wire: allowIncident)
down_thresholdintegerThe number of seconds the access has to be down to trigger an alert (wire: downThreshold)
emailstringThe e-mail address, if type is mail
enabledbooleanWhether to enable or not
frequencystringFrequency between notifications. (1h, 5m, 6h, once)
phonestringThe phone number, if type is sms
sms_accountstringThe SMS account which will be debited for each sent SMS, if the type is sms (wire: smsAccount)
typestringType of notification. (mail, sms)

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectid, service_nameReturns the type, recipient, down threshold, frequency and status of an alert, and whether it includes generic incidents.
listselectservice_namex_pagination_modeReturns the IDs of the email and SMS alerts set on the access.
createinsertservice_name, frequency, typeAdds an email or SMS alert sent when the access is down longer than the threshold, at a frequency of once, 5 minutes, 1 hour or 6 hours. An SMS alert is debited from the given SMS account.
updateupdateid, service_nameEnables or disables an alert, or changes its down threshold, frequency, email, phone number or generic incident setting.
deletedeleteid, service_nameDeletes the alert. No notification is sent for it anymore.

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"}})
idintegerId
service_namestringService name (wire: serviceName)
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​

Returns the type, recipient, down threshold, frequency and status of an alert, and whether it includes generic incidents.

SELECT
id,
allow_incident,
down_threshold,
email,
enabled,
frequency,
phone,
sms_account,
type
FROM ovh.xdsl.monitoring_notifications
WHERE id = '{{ id }}' -- required
AND service_name = '{{ service_name }}' -- required
;

INSERT examples​

Adds an email or SMS alert sent when the access is down longer than the threshold, at a frequency of once, 5 minutes, 1 hour or 6 hours. An SMS alert is debited from the given SMS account.

INSERT INTO ovh.xdsl.monitoring_notifications (
allow_incident,
down_threshold,
email,
frequency,
phone,
sms_account,
type,
service_name
)
SELECT
{{ allow_incident }},
{{ down_threshold }},
'{{ email }}',
'{{ frequency }}' /* required */,
'{{ phone }}',
'{{ sms_account }}',
'{{ type }}' /* required */,
'{{ service_name }}'
RETURNING
id,
allow_incident,
down_threshold,
email,
enabled,
frequency,
phone,
sms_account,
type
;

UPDATE examples​

Enables or disables an alert, or changes its down threshold, frequency, email, phone number or generic incident setting.

UPDATE ovh.xdsl.monitoring_notifications
SET
allow_incident = {{ allow_incident }},
down_threshold = {{ down_threshold }},
email = '{{ email }}',
enabled = {{ enabled }},
frequency = '{{ frequency }}',
phone = '{{ phone }}'
WHERE
id = '{{ id }}' --required
AND service_name = '{{ service_name }}' --required;

DELETE examples​

Deletes the alert. No notification is sent for it anymore.

DELETE FROM ovh.xdsl.monitoring_notifications
WHERE id = '{{ id }}' --required
AND service_name = '{{ service_name }}' --required
;