NodePing.Checks (NodePing Elixir v1.7.1) View Source
Create, read, update, and delete NodePing checks for your account and subaccounts
Link to this section Summary
Functions
Find whether a check exists or not. Returns true if present or false if nonexistent
Create a new check for your NodePing account or subaccount
Create a new check for your NodePing account or subaccount
Delete a check present on your NodePing account or specified subaccount
Delete a check present on your NodePing account or specified subaccount
Disable a check present on your NodePing account or specified subaccount
Disable a check present on your NodePing account or specified subaccount
Find an already fetched map of NodePing checks for the one with a given ID
Find passing or failing checks in an already fetched map of NodePing checks
Get information about a NodePing check
Get information about a NodePing check
Get all checks present on your NodePing account or specified subaccount
Get all checks present on your NodePing account or specified subaccount
Get all disabled checks present on your NodePing account or subaccount
Get all disabled checks present on your NodePing account or subaccount
Get all failing checks present on your NodePing account or subaccount
Get all failing checks present on your NodePing account or subaccount
Get the last result for a specified check
Get the last result for a specified check
Get many checks at once on your NodePing account or specified subaccount
Get many checks at once on your NodePing account or specified subaccount
Get all passings checks present on your NodePing account or subaccount
Get all passings checks present on your NodePing account or subaccount
Mute all notifications for the specified check
Mute all notifications for the specified check
Update an existing check for your NodePing account or subaccount ## Parameters
Update an existing check for your NodePing account or subaccount ## Parameters
Link to this section Functions
Specs
check_exists?( token :: bitstring(), id :: bitstring(), customerid :: bitstring() | nil ) :: boolean()
Find whether a check exists or not. Returns true if present or false if nonexistent
token
- NodePing API token that is provided with accountid
- Check ID of the check you want to verify is present or notcustomerid
- optional ID to access a subaccount
Specs
create_check( token :: bitstring(), checktype_struct :: struct(), args :: map(), customerid :: bitstring() | nil ) :: tuple()
Create a new check for your NodePing account or subaccount
Create any of the listed NodePing checks at:
https://nodeping.com/docs-api-checks.html
and view the "Fields by check type" section to see which checks
accept what fields.
Parameters
token
- NodePing API token that is provided with accountchecktype_struct
- theNodePing.Checktypes
that defines the check you are trying to createargs
- non-default parameters you want to set for creating your checkcustomerid
- optional customerid for subaccount
Examples
iex> token = System.fetch_env!("TOKEN")
iex> checktype = NodePing.Checktypes.Ping
iex> args = %{label: "my label", target: "example.com", interval: 1, enabled: true}
iex> NodePing.Checks.create_check(token, checktype, args)
Specs
create_check!( token :: bitstring(), checktype_struct :: struct(), args :: map(), customerid :: bitstring() | nil ) :: map()
Create a new check for your NodePing account or subaccount
Create any of the listed NodePing checks at:
https://nodeping.com/docs-api-checks.html
and view the "Fields by check type" section to see which checks
accept what fields.
Parameters
token
- NodePing API token that is provided with accountchecktype_struct
- theNodePing.Checktypes
that defines the check you are trying to createargs
- non-default parameters you want to set for creating your checkcustomerid
- optional customerid for subaccount
Examples
iex> token = System.fetch_env!("TOKEN")
iex> checktype = NodePing.Checktypes.Ping
iex> args = %{label: "my label", target: "example.com", interval: 1, enabled: true}
iex> NodePing.Checks.create_check!(token, checktype, args)
Specs
Delete a check present on your NodePing account or specified subaccount
Parameters
token
- NodePing API token that is provided with accountid
- the check ID that you want to deletecustomerid
- optional ID to access a subaccount
Examples
iex> token = System.fetch_env!("TOKEN")
iex> check_id = "201205050153W2Q4C-0J2HSIRF"
iex> {:ok, result} = NodePing.Checks.delete_check(token, check_id)
Specs
Delete a check present on your NodePing account or specified subaccount
Parameters
token
- NodePing API token that is provided with accountid
- the check ID that you want to deletecustomerid
- optional ID to access a subaccount
Examples
iex> token = System.fetch_env!("TOKEN")
iex> check_id = "201205050153W2Q4C-0J2HSIRF"
iex> result = NodePing.Checks.delete_check!(token, check_id)
Specs
Disable a check present on your NodePing account or specified subaccount
Parameters
token
- NodePing API token that is provided with accountid
- the check ID that you want to deletecustomerid
- optional ID to access a subaccountdisableall
- boolean value. true = disable all, false = re-enable those checksopts
- a keyword list with keys of:type
,:label
,:target
,:customerid
as possible options
Examples
iex> opts = [{:type, "PING"}, {:target, "example.com"}]
iex> disableall = true
iex> {:ok, result} = NodePing.Checks.disable_all_checks(token, disableall, opts)
Specs
Disable a check present on your NodePing account or specified subaccount
Parameters
token
- NodePing API token that is provided with accountid
- the check ID that you want to deletecustomerid
- optional ID to access a subaccountdisableall
- boolean value. true = disable all, false = re-enable those checksopts
- a keyword list with keys of:type
,:label
,:target
,:customerid
as possible options
Examples
iex> opts = [{:type, "PING"}, {:target, "example.com"}]
iex> disableall = true
iex> result = NodePing.Checks.disable_all_checks!(token, disableall, opts)
Specs
Find an already fetched map of NodePing checks for the one with a given ID
Parameters
check_map
- a map of checks already fetched from the NodePing APIid
- Check ID of the check you want to fetch information about
Specs
Find passing or failing checks in an already fetched map of NodePing checks
Parameters
check_map
- a map of checks already fetched from the NodePing APIstatus
- an atom with the values:passing
or:failing
Specs
Get information about a NodePing check
Parameters
token
- NodePing API token that is provided with accountid
- Check ID of the check you want to fetch information aboutopts
- Optional list of tuples to specify results
Opts - list of tuples
customerid
- optional ID to access a subaccountuptime
- boolean - If this parameter is present the check's uptime will be added to the response
Specs
Get information about a NodePing check
## Parameters
token
- NodePing API token that is provided with accountid
- Check ID of the check you want to fetch information aboutopts
- Optional list of tuples to specify results
## Opts - list of tuples
customerid
- optional ID to access a subaccountuptime
- boolean - If this parameter is present the check's uptime will be added to the response
Specs
Get all checks present on your NodePing account or specified subaccount
Parameters
token
- NodePing API token that is provided with accountopts
- Optional list of tuples to specify results.
Opts - list of tuples
customerid
- optional ID to access a subaccountuptime
- boolean - If this parameter is present the check's uptime will be added to the response
Examples
iex> token = System.fetch_env!("TOKEN")
iex> customerid = System.fetch_env!("CUSTOMERID")
iex> {:ok, result} = NodePing.Checks.get_checks(token, [{:customerid, customerid}])
Specs
Get all checks present on your NodePing account or specified subaccount
Parameters
token
- NodePing API token that is provided with accountopts
- Optional list of tuples to specify results.
Opts - list of tuples
customerid
- optional ID to access a subaccountuptime
- boolean - If this parameter is present the check's uptime will be added to the response
Examples
iex> token = System.fetch_env!("TOKEN")
iex> customerid = System.fetch_env!("CUSTOMERID")
iex> result = NodePing.Checks.get_checks!(token, [{:customerid, customerid}])
Specs
Get all disabled checks present on your NodePing account or subaccount
Parameters
token
- NodePing API token that is provided with accountopts
- Optional list of tuples to specify results
Opts - list of tuples
customerid
- optional ID to access a subaccountuptime
- boolean - If this parameter is present the check's uptime will be added to the response
Specs
Get all disabled checks present on your NodePing account or subaccount
Parameters
token
- NodePing API token that is provided with accountopts
- Optional list of tuples to specify results
Opts - list of tuples
customerid
- optional ID to access a subaccountuptime
- boolean - If this parameter is present the check's uptime will be added to the response
Specs
Get all failing checks present on your NodePing account or subaccount
Parameters
token
- NodePing API token that is provided with accountopts
- Optional list of tuples to specify results
Opts - list of tuples
customerid
- optional ID to access a subaccountuptime
- boolean - If this parameter is present the check's uptime will be added to the response
Examples
iex> token = System.fetch_env!("TOKEN")
iex> {:ok, failing_checks} = NodePing.Checks.get_failing_checks(token)
Specs
Get all failing checks present on your NodePing account or subaccount
Parameters
token
- NodePing API token that is provided with accountopts
- Optional list of tuples to specify results
Opts - list of tuples
customerid
- optional ID to access a subaccountuptime
- boolean - If this parameter is present the check's uptime will be added to the response
Examples
iex> token = System.fetch_env!("TOKEN")
iex> failing_checks = NodePing.Checks.get_failing_checks!(token)
Specs
Get the last result for a specified check
Parameters
token
- NodePing API token that is provided with accountid
- Check ID of the check you want to fetch the last result foropts
- Optional list of tuples to specify results
Opts - list of tuples
customerid
- optional ID to access a subaccountuptime
- boolean - If this parameter is present the check's uptime will be added to the response
Specs
Get the last result for a specified check
Parameters
token
- NodePing API token that is provided with accountid
- Check ID of the check you want to fetch the last result foropts
- Optional list of tuples to specify results
Opts - list of tuples
customerid
- optional ID to access a subaccountuptime
- boolean - If this parameter is present the check's uptime will be added to the response
Specs
Get many checks at once on your NodePing account or specified subaccount
Parameters
token
- NodePing API token that is provided with accountcheckids
- list of checkids that will be queriedopts
- Optional list of tuples to specify results
Opts - list of tuples
customerid
- optional ID to access a subaccountuptime
- boolean - If this parameter is present, the checks uptimes wilwl be added to the response
Examples
iex> token = System.fetch_env!("TOKEN")
iex> checkids = ["201205050153W2Q4C-0J2HSIRF", "201205050153W2Q4C-4RZT8MLN"]
iex> {:ok, result} = NodePing.Checks.get_many(token, checkids, [{:uptime, true}])
Specs
Get many checks at once on your NodePing account or specified subaccount
Parameters
token
- NodePing API token that is provided with accountcheckids
- list of checkids that will be queriedopts
- Optional list of tuples to specify results
Opts - list of tuples
customerid
- optional ID to access a subaccountuptime
- boolean - If this parameter is present, the checks uptimes wilwl be added to the response
Examples
iex> token = System.fetch_env!("TOKEN")
iex> checkids = ["201205050153W2Q4C-0J2HSIRF", "201205050153W2Q4C-4RZT8MLN"]
iex> result = NodePing.Checks.get_many!(token, checkids, [{:uptime, true}])
Specs
Get all passings checks present on your NodePing account or subaccount
## Parameters
token
- NodePing API token that is provided with accountopts
- Optional list of tuples to specify results
## Opts - list of tuples
customerid
- optional ID to access a subaccountuptime
- boolean - If this parameter is present the check's uptime will be added to the response
Examples
iex> token = System.fetch_env!("TOKEN")
iex> passing_checks = NodePing.Checks.get_passing_checks(token, [{:uptime, true}])
Specs
Get all passings checks present on your NodePing account or subaccount
## Parameters
token
- NodePing API token that is provided with accountopts
- Optional list of tuples to specify results
## Opts - list of tuples
customerid
- optional ID to access a subaccountuptime
- boolean - If this parameter is present the check's uptime will be added to the response
Examples
iex> token = System.fetch_env!("TOKEN")
iex> passing_checks = NodePing.Checks.get_passing_checks!(token, [{:uptime, true}])
mute_check(token, id, checktype_struct, duration, customerid \\ nil)
View SourceSpecs
mute_check( token :: bitstring(), id :: bitstring(), checktype_struct :: struct(), duration :: non_neg_integer() | boolean(), customerid :: bitstring() | nil ) :: tuple()
Mute all notifications for the specified check
Parameters
token
- NodePing API token that is provided with accountid
- the checkid that will be mutedchecktype_struct
- theNodePing.Checktypes
that defines the check you are trying to muteduration
- duration in seconds that the check will be mutedcustomerid
- optional customerid for subaccount
mute_check!(token, id, checktype_struct, duration, customerid \\ nil)
View SourceSpecs
mute_check!( token :: bitstring(), id :: bitstring(), checktype_struct :: struct(), duration :: non_neg_integer() | boolean(), customerid :: bitstring() | nil ) :: map()
Mute all notifications for the specified check
Parameters
token
- NodePing API token that is provided with accountid
- the checkid that will be mutedchecktype_struct
- theNodePing.Checktypes
that defines the check you are trying to muteduration
- duration in seconds that the check will be mutedcustomerid
- optional customerid for subaccount
update_check(token, id, checktype_struct, args, customerid \\ nil)
View SourceSpecs
update_check( token :: bitstring(), id :: bitstring(), checktype_struct :: struct(), args :: map(), customerid :: bitstring() | nil ) :: tuple()
Update an existing check for your NodePing account or subaccount ## Parameters
token
- NodePing API token that is provided with accountchecktype_struct
- theNodePing.Checktypes
that defines the check you are trying to createargs
- non-default parameters you want to set for creating your checkcustomerid
- optional customerid for subaccount
Examples
iex> token = System.fetch_env!("TOKEN")
iex> check_id = "201205050153W2Q4C-0J2HSIRF"
iex> checktype = NodePing.Checktypes.Ping
iex> args = %{label: "my label", target: "example.com", interval: 1, enabled: true}
iex> NodePing.Checks.update_check(token, check_id, checktype, args)
update_check!(token, id, checktype_struct, args, customerid \\ nil)
View SourceSpecs
update_check!( token :: bitstring(), id :: bitstring(), checktype_struct :: struct(), args :: map(), customerid :: bitstring() | nil ) :: map()
Update an existing check for your NodePing account or subaccount ## Parameters
token
- NodePing API token that is provided with accountchecktype_struct
- theNodePing.Checktypes
that defines the check you are trying to createargs
- non-default parameters you want to set for creating your checkcustomerid
- optional customerid for subaccount
Examples
iex> token = System.fetch_env!("TOKEN")
iex> check_id = "201205050153W2Q4C-0J2HSIRF"
iex> checktype = NodePing.Checktypes.Ping
iex> args = %{label: "my label", target: "example.com", interval: 1, enabled: true}
iex> NodePing.Checks.update_check!(token, check_id, checktype, args)