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

Link to this function

create_subaccount(token, args)

View Source

Create a subaccount for your NodePing account

Parameters

  • token - NodePing API token that is provided with account
  • args - 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
Link to this function

create_subaccount!(token, args)

View Source

Create a subaccount for your NodePing account

Parameters

  • token - NodePing API token that is provided with account
  • args - 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
Link to this function

delete_subaccount(token, customerid)

View Source

Delete your NodePing subaccount

Parameters

  • token - NodePing API token that is provided with account
  • customerid - 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
Link to this function

delete_subaccount!(token, customerid)

View Source

Delete your NodePing subaccount

Parameters

  • token - NodePing API token that is provided with account
  • customerid - 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
Link to this function

disable_notifications(token, accountsuppressall, customerid \\ nil)

View Source

Disable notifications on your account or subaccount

Parameters

  • token - NodePing API token that is provided with account
  • accountsupressall - boolean value. true disables notifications, false enables them
  • customerid - 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)
Link to this function

disable_notifications!(token, accountsuppressall, customerid \\ nil)

View Source

Disable notifications on your account or subaccount

Parameters

  • token - NodePing API token that is provided with account
  • accountsupressall - boolean value. true disables notifications, false enables them
  • customerid - 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)
Link to this function

get_account(token, customerid \\ nil)

View Source

Get information about your NodePing account or subaccount

Parameters

  • token - NodePing API token that is provided with account
  • customerid - 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
Link to this function

get_account!(token, customerid \\ nil)

View Source

Get information about your NodePing account or subaccount

Parameters

  • token - NodePing API token that is provided with account
  • customerid - 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
Link to this function

update_account(token, args, customerid \\ nil)

View Source

Update your NodePing account or subaccount details

Parameters

  • token - NodePing API token that is provided with account
  • args - A map of arguments for creating the subaccount
  • customerid - 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
Link to this function

update_account!(token, args, customerid \\ nil)

View Source

Update your NodePing account or subaccount details

Parameters

  • token - NodePing API token that is provided with account
  • args - A map of arguments for creating the subaccount
  • customerid - 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