Skip to content

Instantly share code, notes, and snippets.

@c33s
Forked from krisleech/00-README.md
Created July 10, 2024 11:54
Show Gist options
  • Save c33s/1b1fe7a57843f94bb3a217cb41c585ff to your computer and use it in GitHub Desktop.
Save c33s/1b1fe7a57843f94bb3a217cb41c585ff to your computer and use it in GitHub Desktop.
UptimeRobot Ansible and v2 API notes

When an interger is sent for monitor>type an internal error occurs. If a string is sent as in the main.yml example it is okay.

When an internal error occurs a 200 response not 500 is sent.

When an error occurs (e.g. monitor already exists) a 200 response is sent.

---
- name: Add Uptimerobot Monitoring
uri:
url: "https://api.uptimerobot.com/v2/newMonitor"
method: POST
return_content: yes
HEADER_Content-Type: "application/json"
body_format: json
body:
api_key: "{{ uptimerobot.api_key }}"
friendly_name: "{{ project }}"
url: "{{ domain }}"
type: "1"
follow_redirects: all
alert_contacts: "{{ uptimerobot.alert_contacts }}"
#allow_failure: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment