monitoring_notifications
Creates, updates, deletes, gets or lists a monitoring_notifications resource.
Overview​
| Name | monitoring_notifications |
| Type | Resource |
| Id | ovh.xdsl.monitoring_notifications |
Fields​
The following fields are returned by SELECT queries:
- get
- list
successful operation
| Name | Datatype | Description |
|---|---|---|
id | integer | |
allow_incident | boolean | Whether or not to allow notifications for generic incidents (wire: allowIncident) |
down_threshold | integer | The number of seconds the access has to be down to trigger an alert (wire: downThreshold) |
email | string | The e-mail address, if type is mail |
enabled | boolean | Whether to enable or not |
frequency | string | Frequency between notifications. (1h, 5m, 6h, once) |
phone | string | The phone number, if type is sms |
sms_account | string | The SMS account which will be debited for each sent SMS, if the type is sms (wire: smsAccount) |
type | string | Type of notification. (mail, sms) |
Defines where and how the notifications will be sent
| Name | Datatype | Description |
|---|---|---|
id | integer | |
allow_incident | boolean | Whether or not to allow notifications for generic incidents (wire: allowIncident) |
down_threshold | integer | The number of seconds the access has to be down to trigger an alert (wire: downThreshold) |
email | string | The e-mail address, if type is mail |
enabled | boolean | Whether to enable or not |
frequency | string | Frequency between notifications. (1h, 5m, 6h, once) |
phone | string | The phone number, if type is sms |
sms_account | string | The SMS account which will be debited for each sent SMS, if the type is sms (wire: smsAccount) |
type | string | Type of notification. (mail, sms) |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | id, service_name | Returns the type, recipient, down threshold, frequency and status of an alert, and whether it includes generic incidents. | |
list | select | service_name | x_pagination_mode | Returns the IDs of the email and SMS alerts set on the access. |
create | insert | service_name, frequency, type | 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. | |
update | update | id, service_name | Enables or disables an alert, or changes its down threshold, frequency, email, phone number or generic incident setting. | |
delete | delete | id, service_name | Deletes 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.
| 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"}}) |
id | integer | Id |
service_name | string | Service name (wire: serviceName) |
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
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
;
Returns the IDs of the email and SMS alerts set on the access.
SELECT
id,
allow_incident,
down_threshold,
email,
enabled,
frequency,
phone,
sms_account,
type
FROM ovh.xdsl.monitoring_notifications
WHERE service_name = '{{ service_name }}' -- required
AND x_pagination_mode = '{{ x_pagination_mode }}'
;
INSERT examples​
- create
- Manifest
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
;
# Description fields are for documentation purposes
- name: monitoring_notifications
props:
- name: service_name
value: "{{ service_name }}"
description: Required parameter for the monitoring_notifications resource.
- name: allow_incident
value: {{ allow_incident }}
description: |
Whether or not to allow notifications concerning generic incidents
- name: down_threshold
value: {{ down_threshold }}
description: |
The number of seconds the access has to be down to trigger the alert
- name: email
value: "{{ email }}"
description: |
The e-mail address, if type is mail
- name: frequency
value: "{{ frequency }}"
description: |
Frequency between notifications.
valid_values: ['1h', '5m', '6h', 'once']
- name: phone
value: "{{ phone }}"
description: |
The phone number, if type is sms
- name: sms_account
value: "{{ sms_account }}"
description: |
The SMS account which will be debited for each sent SMS, if the type is sms
- name: type
value: "{{ type }}"
description: |
Type of notification.
valid_values: ['mail', 'sms']
UPDATE examples​
- update
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​
- delete
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
;