community.digitalocean.digital_ocean_monitoring_alerts_info module – Programmatically retrieve metrics as well as configure alert policies based on these metrics
Note
This module is part of the community.digitalocean collection (version 1.27.0).
You might already have this collection installed if you are using the ansible
package.
It is not included in ansible-core
.
To check whether it is installed, run ansible-galaxy collection list
.
To install it, use: ansible-galaxy collection install community.digitalocean
.
To use it in a playbook, specify: community.digitalocean.digital_ocean_monitoring_alerts_info
.
New in community.digitalocean 1.10.0
Synopsis
The DigitalOcean Monitoring API makes it possible to programmatically retrieve metrics as well as configure alert policies based on these metrics.
The Monitoring API can help you gain insight into how your apps are performing and consuming resources.
Parameters
Parameter |
Comments |
---|---|
DigitalOcean OAuth token; can be specified in |
|
Choices:
|
|
Alert uuid (if specified only returns the specific alert policy) |
Examples
- name: Get Droplet Monitoring alerts polices
community.digitalocean.digital_ocean_monitoring_alerts_info:
oauth_token: "{{ lookup('ansible.builtin.env', 'DO_API_TOKEN') }}"
register: monitoring_alerts
- name: Get specific Droplet Monitoring alerts policy
community.digitalocean.digital_ocean_monitoring_alerts_info:
oauth_token: "{{ lookup('ansible.builtin.env', 'DO_API_TOKEN') }}"
uuid: ec48b0e7-23bb-4a7f-95f2-d83da62fcd60
register: monitoring_alert
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
DigitalOcean Monitoring alerts policies Returned: changed Sample: |