NodePing.Accounts (NodePing Elixir v1.7.1) View Source
Manage your NodePing account and subaccounts
Link to this section Summary
Functions
Create a subaccount for your NodePing account
Create a subaccount for your NodePing account
Delete your NodePing subaccount
Delete your NodePing subaccount
Disable notifications on your account or subaccount
Disable notifications on your account or subaccount
Get information about your NodePing account or subaccount
Get information about your NodePing account or subaccount
Update your NodePing account or subaccount details
Update your NodePing account or subaccount details
Link to this section Functions
Create a subaccount for your NodePing account
Parameters
token
- NodePing API token that is provided with accountargs
- A map of arguments for creating the subaccount
The NodePing.Accounts.SubAccount
can be used to create the map necessary
for the args
variable and the variables expected by the API to create a
new subaccount.
Examples
iex> token = System.fetch_env!("TOKEN")
iex> args = %{:contactname => "My Name", :email => "me@example.com", :timezone => "-7", :location => "name"}
iex> {:ok, result} = NodePing.Accounts.create_subaccount(token, args)
iex> is_map(result)
true
Create a subaccount for your NodePing account
Parameters
token
- NodePing API token that is provided with accountargs
- A map of arguments for creating the subaccount
The NodePing.Accounts.SubAccount
can be used to create the map necessary
for the args
variable and the variables expected by the API to create a
new subaccount.
Examples
iex> token = System.fetch_env!("TOKEN")
iex> args = %{:contactname => "My Name", :email => "me@example.com", :timezone => "-7", :location => "name"}
iex> {:ok, result} = NodePing.Accounts.create_subaccount!(token, args)
iex> is_map(result)
true
Delete your NodePing subaccount
Parameters
token
- NodePing API token that is provided with accountcustomerid
- The subaccount ID for the subaccount you want to delete
Examples
iex> token = System.fetch_env!("TOKEN")
iex> subaccount = System.fetch_env!("SUBACCOUNT")
iex> {:ok, result} = NodePing.Accounts.delete_subaccount!(token, subaccount)
iex> is_map(result)
true
Delete your NodePing subaccount
Parameters
token
- NodePing API token that is provided with accountcustomerid
- The subaccount ID for the subaccount you want to delete
Examples
iex> token = System.fetch_env!("TOKEN")
iex> subaccount = System.fetch_env!("SUBACCOUNT")
iex> {:ok, result} = NodePing.Accounts.delete_subaccount!(token, subaccount)
iex> is_map(result)
true
disable_notifications(token, accountsuppressall, customerid \\ nil)
View SourceDisable notifications on your account or subaccount
Parameters
token
- NodePing API token that is provided with accountaccountsupressall
- boolean value. true disables notifications, false enables themcustomerid
- optional customerid if you want to disable notifications on a subaccount
Examples
iex> token = System.fetch_env!("TOKEN")
iex> subaccount = System.fetch_env!("SUBACCOUNT")
iex> {:ok, result} = NodePing.Accounts.disable_notifications(token, true, subaccount)
disable_notifications!(token, accountsuppressall, customerid \\ nil)
View SourceDisable notifications on your account or subaccount
Parameters
token
- NodePing API token that is provided with accountaccountsupressall
- boolean value. true disables notifications, false enables themcustomerid
- optional customerid if you want to disable notifications on a subaccount
Examples
iex> token = System.fetch_env!("TOKEN")
iex> subaccount = System.fetch_env!("SUBACCOUNT")
iex> {:ok, result} = NodePing.Accounts.disable_notifications!(token, true, subaccount)
Get information about your NodePing account or subaccount
Parameters
token
- NodePing API token that is provided with accountcustomerid
- optional ID to access a subaccount
Examples
iex> token = System.fetch_env!("TOKEN")
iex> {:ok, result} = NodePing.Accounts.get_account(token)
iex> is_map(result)
true
Get information about your NodePing account or subaccount
Parameters
token
- NodePing API token that is provided with accountcustomerid
- optional ID to access a subaccount
Examples
iex> token = System.fetch_env!("TOKEN")
iex> result = NodePing.Accounts.get_account!(token)
iex> is_map(result)
true
Update your NodePing account or subaccount details
Parameters
token
- NodePing API token that is provided with accountargs
- A map of arguments for creating the subaccountcustomerid
- An optional subaccount ID that will be updated instead of the main account
The NodePing.Accounts.SubAccount
can be used to create the map necessary
for the args
variable and the variables expected by the API to create a
new subaccount.
Examples
iex> token = System.fetch_env!("TOKEN")
iex> args = %{:name => "Contact Name", :email => "me2@example.com", :timezone => "-2"}
iex> {:ok, result} = NodePing.Accounts.update_account(token, args)
iex> result["timezone"] == "-2.0"
true
Update your NodePing account or subaccount details
Parameters
token
- NodePing API token that is provided with accountargs
- A map of arguments for creating the subaccountcustomerid
- An optional subaccount ID that will be updated instead of the main account
The NodePing.Accounts.SubAccount
can be used to create the map necessary
for the args
variable and the variables expected by the API to create a
new subaccount.
Examples
iex> token = System.fetch_env!("TOKEN")
iex> args = %{:name => "Contact Name", :email => "me2@example.com", :timezone => "-2"}
iex> {:ok, result} = NodePing.Accounts.update_account!(token, args)
iex> result["timezone"] == "-2.0"
true