updown v0.1.1 Updown.Edits

Functions for changing/adding/deleting your updown.io checks

Summary

Functions

Adds a new check with specified options

Removes a check with the given token, if a check was deleted by the call, the returned boolean will give a true value

Updates a check with the specified parameters

Functions

add_new(url, options \\ [])

Specs

add_new(binary, keyword) :: %Updown.Check{alias: term, apdex_t: term, down: term, down_since: term, enabled: term, error: term, favicon_url: term, last_check_at: term, last_status: term, next_check_at: term, period: term, published: term, ssl: term, string_match: term, token: term, uptime: term, url: term}
Adds a new check with specified options


Usable options with their default values are:
    :period (integer) = 60
    :apdex_t (float) = 0.5
    :enabled (boolean) = true
    :published (boolean) = false
    :alias (binary) = ""
    :string_match (binary) = "" 

## Examples

    iex> Updown.Edits.add_new("facebook.com", period: 600)
    %Updown.Check{url: "facebook.com", period: 600, apdex_t: 0.5, enabled: true, published: false, alias: "", string_match:""}
    iex> Updown.Edits.add_new("youtube.com", published: true, alias: "yutuub")
    %Updown.Check{url: "youtube.com", period: 60, apdex_t: 0.5, enabled: true, published: true, alias: "yutuub", string_match:""}
remove(token)

Specs

remove(binary) :: %{optional(atom) => boolean}
Removes a check with the given token, if a check was deleted by the call, the returned boolean will give a true value.

## Examples

    iex> Updown.Edits.remove("qqqq")
    %{:deleted => false} # <-- if the check was not deleted
    iex> Updown.Edits.remove("lqzx")
    %{:deleted => true} # <-- if the check was deleted
update(token, options \\ [])

Specs

update(binary, list) :: %Updown.Check{alias: term, apdex_t: term, down: term, down_since: term, enabled: term, error: term, favicon_url: term, last_check_at: term, last_status: term, next_check_at: term, period: term, published: term, ssl: term, string_match: term, token: term, uptime: term, url: term}
Updates a check with the specified parameters


Usable options are:
    :url (binary)
    :period (integer)
    :apdex_t (float)
    :enabled (boolean)
    :published (boolean)
    :alias (binary)
    :string_match (binary) 

## Examples

    iex> Updown.Edits.update("qqqq", url: "facebook.com", period: 600)
    %Updown.Check{url:"buzzfeed.com", period: 600, ...}
    iex> q = Updown.Edits.add_new("facebook.com")
    iex> Updown.Edits.update("pppp", apdex_t: 1.0, published: true)
    %Updown.Check{q | published: true, apdex_t: 1.0}