alertings
Creates, updates, deletes, gets or lists an alertings resource.
Overview​
| Name | alertings |
| Type | Resource |
| Id | ovh.cloud.alertings |
Fields​
The following fields are returned by SELECT queries:
- get
- list
successful operation
| Name | Datatype | Description |
|---|---|---|
id | string (uuid) | ID of the alert |
name | string | Name of the alert |
creation_date | string (date-time) | Creation date (wire: creationDate) |
delay | integer | Delay of the alert in seconds |
email | string | Email. DEPRECATED: use emails |
emails | array | Receiver of the alert |
formatted_monthly_threshold | object | formatted monthly threshold (wire: formattedMonthlyThreshold) |
monthly_threshold | integer | Monthly threshold (wire: monthlyThreshold) |
service | string | Service of the alert (ai_endpoint, all, block_storage, data_platform, instances, instances_gpu, instances_without_gpu, objet_storage, rancher, snapshot) |
status | string | Status of the alert (deleted, disabled, ok) |
Billing Alert Configuration
| Name | Datatype | Description |
|---|---|---|
id | string (uuid) | ID of the alert |
name | string | Name of the alert |
creation_date | string (date-time) | Creation date (wire: creationDate) |
delay | integer | Delay of the alert in seconds |
email | string | Email. DEPRECATED: use emails |
emails | array | Receiver of the alert |
formatted_monthly_threshold | object | formatted monthly threshold (wire: formattedMonthlyThreshold) |
monthly_threshold | integer | Monthly threshold (wire: monthlyThreshold) |
service | string | Service of the alert (ai_endpoint, all, block_storage, data_platform, instances, instances_gpu, instances_without_gpu, objet_storage, rancher, snapshot) |
status | string | Status of the alert (deleted, disabled, ok) |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | id, service_name | Returns the configuration of the billing alert: threshold, service, receivers and status. | |
list | select | service_name | x_pagination_mode | Returns the IDs of the billing alerts configured on the project. |
create | insert | service_name, delay, monthly_threshold | Creates a billing alert with a monthly threshold, for one service or for all services. Sends an email to the receivers when the monthly spend on the service exceeds the threshold. Use emails, as email is deprecated. | |
update | update | id, service_name | Updates the threshold, service, receivers, delay or status of the billing alert. Use emails, as email is deprecated. | |
delete | delete | id, service_name | Deletes the billing alert configuration. |
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 | string (uuid) | Id |
service_name | string | The Public Cloud project ID. Resolved from OVH_CLOUD_PROJECT_SERVICE when set. |
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 configuration of the billing alert: threshold, service, receivers and status.
SELECT
id,
name,
creation_date,
delay,
email,
emails,
formatted_monthly_threshold,
monthly_threshold,
service,
status
FROM ovh.cloud.alertings
WHERE id = '{{ id }}' -- required
AND service_name = '{{ service_name }}' -- required unless OVH_CLOUD_PROJECT_SERVICE is set
;
Returns the IDs of the billing alerts configured on the project.
SELECT
id,
name,
creation_date,
delay,
email,
emails,
formatted_monthly_threshold,
monthly_threshold,
service,
status
FROM ovh.cloud.alertings
WHERE service_name = '{{ service_name }}' -- required unless OVH_CLOUD_PROJECT_SERVICE is set
AND x_pagination_mode = '{{ x_pagination_mode }}'
;
INSERT examples​
- create
- Manifest
Creates a billing alert with a monthly threshold, for one service or for all services. Sends an email to the receivers when the monthly spend on the service exceeds the threshold. Use emails, as email is deprecated.
INSERT INTO ovh.cloud.alertings (
delay,
email,
emails,
monthly_threshold,
name,
service,
service_name
)
SELECT
{{ delay }} /* required */,
'{{ email }}',
'{{ emails }}',
{{ monthly_threshold }} /* required */,
'{{ name }}',
'{{ service }}',
'{{ service_name }}'
RETURNING
id,
name,
creation_date,
delay,
email,
emails,
formatted_monthly_threshold,
monthly_threshold,
service,
status
;
# Description fields are for documentation purposes
- name: alertings
props:
- name: service_name
value: "{{ service_name }}"
description: Required parameter for the alertings resource.
- name: delay
value: {{ delay }}
description: |
Delay of the alert in seconds
- name: email
value: "{{ email }}"
description: |
Email. DEPRECATED: use emails
- name: emails
value:
- "{{ emails }}"
description: |
Receiver of the alert
- name: monthly_threshold
value: {{ monthly_threshold }}
description: |
Monthly threshold
- name: name
value: "{{ name }}"
description: |
Name of the alert
- name: service
value: "{{ service }}"
description: |
Service of the alert
valid_values: ['ai_endpoint', 'all', 'block_storage', 'data_platform', 'instances', 'instances_gpu', 'instances_without_gpu', 'objet_storage', 'rancher', 'snapshot']
UPDATE examples​
- update
Updates the threshold, service, receivers, delay or status of the billing alert. Use emails, as email is deprecated.
UPDATE ovh.cloud.alertings
SET
delay = {{ delay }},
email = '{{ email }}',
emails = '{{ emails }}',
monthly_threshold = {{ monthly_threshold }},
name = '{{ name }}',
service = '{{ service }}',
status = '{{ status }}'
WHERE
id = '{{ id }}' --required
AND service_name = '{{ service_name }}' --required unless OVH_CLOUD_PROJECT_SERVICE is set;
DELETE examples​
- delete
Deletes the billing alert configuration.
DELETE FROM ovh.cloud.alertings
WHERE id = '{{ id }}' --required
AND service_name = '{{ service_name }}' --required unless OVH_CLOUD_PROJECT_SERVICE is set
;