Skip to content

Instantly share code, notes, and snippets.

@krisleech
Created August 3, 2017 11:43
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save krisleech/e1bb43479c81500dd58ac3929c3440e1 to your computer and use it in GitHub Desktop.
Save krisleech/e1bb43479c81500dd58ac3929c3440e1 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