ex_uptimerobot v0.2.2 ExUptimerobot.Monitor

Interact with Monitor-related API methods.

Summary

Functions

Delete an existing monitor by the monitor ID

Get data for all monitors, or a set of monitors as specified by params. Full documentation for all possible parameters can be found from https://uptimerobot.com/api

Check if a given URL is being monitored

Returns {:ok, values} where values is a list of each values for given key per project

Add a new monitor with given parameters

Reset (delete all stats and response time data) a monitor by the monitor ID

Functions

delete_monitor(id)
delete_monitor(integer) :: tuple
delete_monitor(String.t) :: tuple

Delete an existing monitor by the monitor ID.

get_monitors(params \\ [])
get_monitors([tuple]) :: tuple

Get data for all monitors, or a set of monitors as specified by params. Full documentation for all possible parameters can be found from https://uptimerobot.com/api.

Example

iex> ExUptimerobot.Monitor.get_monitors() {:ok, %{“monitors” => [%{“create_datetime” => 0, “friendly_name” => “Elixir Lang”}]}

is_monitored?(url)
is_monitored?(String.t) :: boolean

Check if a given URL is being monitored.

list_values(key)
list_values(String.t) :: tuple

Returns {:ok, values} where values is a list of each values for given key per project.

Example

iex> ExUptimerobot.Monitor.list_values(“url”)

new_monitor(params \\ [])
new_monitor([tuple]) :: tuple

Add a new monitor with given parameters.

Three parameters are required: friendly_name, url and type.

Example

iex> ExUptimerobot.Monitor.new_monitor([friendly_name: “Elixir Lang”, url: “http://elixir-lang.org/“, type: 1])

reset_monitor(id)
reset_monitor(integer) :: tuple
reset_monitor(String.t) :: tuple

Reset (delete all stats and response time data) a monitor by the monitor ID.