linuxfabrik.lfops.uptimerobot_alert_contact_info¶
List UptimeRobot alert contacts
Synopsis¶
- Calls
getAlertContactson the UptimeRobot v2 API and returns every alert contact on the account. - Enum-coded fields are translated to human-readable labels -
statusbecomesnot activated/paused/active,typebecomessms/email/slack/etc. - Read-only; the module always reports
changed=falseand is safe to run in check mode.
Available since LFOps 6.0.2.
Optional Parameters¶
api_key
- UptimeRobot API key. See
uptimerobot_monitorfor the resolution order. - Type: String.
api_key_file
- Path to a file whose first line is the UptimeRobot API key. Tilde-expanded.
- Type: String.
- Default:
~/.uptimerobot
friendly_name
- Filter the returned list to the contact whose
friendly_nameis an exact match for this value. The result is still a list (length 0 or 1) for shape stability. - Type: String.
Examples¶
# 1) List every alert contact on the account.
- name: 'Capture all alert contacts'
linuxfabrik.lfops.uptimerobot_alert_contact_info:
register: 'ur_alert_contacts'
- ansible.builtin.debug:
msg: '{{ ur_alert_contacts.alert_contacts | length }} alert contacts on the account'
# 2) Look up a single contact by friendly_name.
- linuxfabrik.lfops.uptimerobot_alert_contact_info:
friendly_name: 'monitoring@example.com'
register: 'ur_contact'
- ansible.builtin.debug:
msg: 'Contact id={{ ur_contact.alert_contacts[0].id }} status={{ ur_contact.alert_contacts[0].status }}'
# 3) Audit: list all contacts that never accepted the opt-in invitation
# (`status == "not activated"`) — typically safe to delete.
- linuxfabrik.lfops.uptimerobot_alert_contact_info:
register: 'ur_all'
- ansible.builtin.debug:
msg: >-
Stale contacts: {{
ur_all.alert_contacts
| selectattr("status", "equalto", "not activated")
| map(attribute="friendly_name")
| list
}}
Return Values¶
alert_contacts
- List of alert contact dicts. Empty list when nothing matched.
- Type: List.
- Returned: always.
debug
- Diagnostic information about the API call. Stable enough to assert against, not stable enough to be load-bearing.
- Type: Dictionary.
- Returned: always.
-
Sample:
yaml count: 3 operation: list
Authors¶
- Linuxfabrik GmbH, Zurich, Switzerland (info (at) linuxfabrik (dot) ch)