NodePing.Results (NodePing Elixir v1.7.1) View Source

Get check results and uptime information

Link to this section Summary

Functions

Retrieves information about current "events" for checks. Events include down events and disabled checks. If you need a list of all checks with their passing/failing state, please use the 'checks' list rather than this 'current' call.

Retrieves information about current "events" for checks. Events include down events and disabled checks. If you need a list of all checks with their passing/failing state, please use the 'checks' list rather than this 'current' call.

Retrieves information about "events" for checks. Events include down events and disabled checks.

Retrieves information about "events" for checks. Events include down events and disabled checks.

Get results for specified check

Get results for specified check

Get uptime information for a check

Get uptime information for a check

Link to this section Functions

Link to this function

current_events(token, customerid \\ nil)

View Source

Retrieves information about current "events" for checks. Events include down events and disabled checks. If you need a list of all checks with their passing/failing state, please use the 'checks' list rather than this 'current' call.

## Parameters

  • token - NodePing API token that was provided with account
  • customerid - optional ID to access a subaccount
Link to this function

current_events!(token, customerid \\ nil)

View Source

Retrieves information about current "events" for checks. Events include down events and disabled checks. If you need a list of all checks with their passing/failing state, please use the 'checks' list rather than this 'current' call.

Parameters

  • token - NodePing API token that was provided with account
  • customerid - optional ID to access a subaccount
Link to this function

get_events(token, checkid, opts \\ [])

View Source

Retrieves information about "events" for checks. Events include down events and disabled checks.

https://nodeping.com/docs-api-results.html#events

Parameters

  • token - NodePing API token that was provided with account
  • id - Check id of the check you want to get events for
  • opts - Optional list of tuples to specify returned results

Opts

  • start - Start date to retrieve events from a specific range of time.
  • end - End date to retrieve events from a specific range of time.
  • limit - limit for the number of records to retrieve.

Examples

iex> token = System.fetch_env!("TOKEN")
iex> checkid = "201205050153W2Q4C-0J2HSIRF"
iex> start = "2020-06"
iex> end = "2020-07"
iex> limit = 10
iex> opts = [{:start, start}, {:end, end}, {:limit, limit}]
iex> {:ok, results} = NodePing.Results.get_events(token, checkid, opts)
Link to this function

get_events!(token, checkid, opts \\ [])

View Source

Retrieves information about "events" for checks. Events include down events and disabled checks.

https://nodeping.com/docs-api-results.html#events

Parameters

  • token - NodePing API token that was provided with account
  • id - Check id of the check you want to get events for
  • opts - Optional list of tuples to specify returned results

Opts

  • start - Start date to retrieve events from a specific range of time.
  • end - End date to retrieve events from a specific range of time.
  • limit - limit for the number of records to retrieve.

Examples

iex> token = System.fetch_env!("TOKEN")
iex> checkid = "201205050153W2Q4C-0J2HSIRF"
iex> start = "2020-06"
iex> end = "2020-07"
iex> limit = 10
iex> opts = [{:start, start}, {:end, end}, {:limit, limit}]
iex> results = NodePing.Results.get_events!(token, checkid, opts)
Link to this function

get_results(token, id, opts, customerid \\ nil)

View Source

Get results for specified check

Parameters

  • token - NodePing API token that was provided with account
  • id - Check id of the check you want to get
  • opts - Optional arguments to filter results. Empty list if no opts.
  • customerid - optional ID to access a subaccount

The list of values for opts can be found in NodePing's documents here: https://nodeping.com/docs-api-results.html#get

Opts

  • span - number of hours of results to retrieve. If used in combination with limit the narrower range will be used.
  • limit - optional integer - number of records to retrieve. Defaults to 300 if span is not set.
  • start - date/time for the start of the results. Timestamps should be milliseconds, or an RFC2822 or ISO 8601 date
  • end - date/time for the end of the results.
  • offset - integer offset to have the system perform uptime calculations for a different time zone.
  • clean - boolean sets whether to use the older format for the result record that includes a doc object. true strongly recommended

Examples

iex> opts = [{:span, 48}, {:limit, 10}]
iex> token = System.fetch_env!("TOKEN")
iex> checkid = "201205050153W2Q4C-0J2HSIRF"
iex> {:ok, results} = NodePing.Results.get_results(token, checkid, opts)
Link to this function

get_results!(token, id, opts, customerid \\ nil)

View Source

Get results for specified check

Parameters

  • token - NodePing API token that was provided with account
  • id - Check id of the check you want to get
  • opts - Optional arguments to filter results. Empty list if no opts.
  • customerid - optional ID to access a subaccount

The list of values for opts can be found in NodePing's documents here: https://nodeping.com/docs-api-results.html#get

Opts

  • span - number of hours of results to retrieve. If used in combination with limit the narrower range will be used.
  • limit - optional integer - number of records to retrieve. Defaults to 300 if span is not set.
  • start - date/time for the start of the results. Timestamps should be milliseconds, or an RFC2822 or ISO 8601 date
  • end - date/time for the end of the results.
  • offset - integer offset to have the system perform uptime calculations for a different time zone.
  • clean - boolean sets whether to use the older format for the result record that includes a doc object. true strongly recommended

Examples

iex> opts = [{:span, 48}, {:limit, 10}]
iex> token = System.fetch_env!("TOKEN")
iex> checkid = "201205050153W2Q4C-0J2HSIRF"
iex> results = NodePing.Results.get_results!(token, checkid, opts)
Link to this function

uptime(token, id, opts, customerid \\ nil)

View Source

Get uptime information for a check

Parameters

  • token - NodePing API token that was provided with account
  • id - Check id of the check you want to get uptime information about
  • opts - optional list of args for specifying the range of information to gather. Empty list for no opts
  • customerid - optional ID to access a subaccount

Opts

  • interval - "days" or "months". "months" is the default
  • start - date/time for the start of the results. Timestamps should be milliseconds, or an RFC2822 or ISO 8601 date
  • end - date/time for the end of the results.

Examples

iex> opts = [{:interval, "days"}, {:start, "2020-02"}, {:end, "2020-05"}]
iex> token = System.fetch_env!("TOKEN")
iex> checkid = "201205050153W2Q4C-0J2HSIRF"
iex> {:ok, results} = NodePing.Results.get_results(token, checkid, opts)
Link to this function

uptime!(token, id, opts, customerid \\ nil)

View Source

Get uptime information for a check

Parameters

  • token - NodePing API token that was provided with account
  • id - Check id of the check you want to get uptime information about
  • opts - optional list of args for specifying the range of information to gather. Empty list for no opts
  • customerid - optional ID to access a subaccount

Opts

  • interval - "days" or "months". "months" is the default
  • start - date/time for the start of the results. Timestamps should be milliseconds, or an RFC2822 or ISO 8601 date
  • end - date/time for the end of the results.

Examples

iex> opts = [{:interval, "days"}, {:start, "2020-02"}, {:end, "2020-05"}]
iex> token = System.fetch_env!("TOKEN")
iex> checkid = "201205050153W2Q4C-0J2HSIRF"
iex> results = NodePing.Results.get_results(token, checkid, opts)