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

Maintenance schedules are used for automating the disabling and re-enabling of checks on a schedule or for one-time use (ad-hoc). In the web site they are under Account Settings -> Maintenance.

Link to this section Summary

Functions

Create a scheduled or ad-hoc maintenance.

Create a scheduled or ad-hoc maintenance.

Remove an ad-hoc or scheduled maintenance.

Remove an ad-hoc or scheduled maintenance.

Get maintenance information for all maintenance entries.

Get maintenance information for all maintenance entries.

Get maintenance information for a specific maintenance entry.

Get maintenance information for a specific maintenance entry.

Update a scheduled or ad-hoc maintenance.

Update a scheduled or ad-hoc maintenance.

Link to this section Functions

Link to this function

create(token, duration, name, checklist, opts, customerid \\ nil)

View Source

Create a scheduled or ad-hoc maintenance.

Parameters

  • token - NodePing API token that is provided with account
  • duration - The duration that the maintenance will run
  • name - the name for the maintenance
  • checklist - a list of check IDs that are a part of the maintenance
  • opts - Map of optional arguments for creating the maintenance
  • customerid - optional ID to access a subaccount

Opts

  • id - Set this to "ad-hoc" if you want an ad-hoc maintenance
  • enabled - for scheduled maintenance. Whether it should be enabled or disabled on creation
  • cron - cron string for when scheduled maintenance should start

Examples

Creates an ad-hoc maintenance

iex> token = System.fetch_env!("TOKEN")
iex> checklist = ["201911191441YC6SJ-4S9OJ78G","201911191441YC6SJ-XB5HUTG6"]
iex> duration = 30
iex> name = "ad-hoc maintenance"
iex> opts = %{:id => "ad-hoc"}
iex> {:ok, result} = NodePing.Maintenance.create(token, duration, name, checklist, opts)

Creates a scheduled maintenance

iex> name = "scheduled maintenance"
iex> opts = %{:cron => "15 14 1 * *", :enabled => false}
iex> {:ok, result} = NodePing.Maintenance.create(token, duration, name, checklist, opts)
Link to this function

create!(token, duration, name, checklist, opts, customerid \\ nil)

View Source

Create a scheduled or ad-hoc maintenance.

Parameters

  • token - NodePing API token that is provided with account
  • duration - The duration that the maintenance will run
  • name - the name for the maintenance
  • checklist - a list of check IDs that are a part of the maintenance
  • opts - Map of optional arguments for creating the maintenance
  • customerid - optional ID to access a subaccount

Opts

  • id - Set this to "ad-hoc" if you want an ad-hoc maintenance
  • enabled - for scheduled maintenance. Whether it should be enabled or disabled on creation
  • cron - cron string for when scheduled maintenance should start

Examples

Creates an ad-hoc maintenance

iex> token = System.fetch_env!("TOKEN")
iex> checklist = ["201911191441YC6SJ-4S9OJ78G","201911191441YC6SJ-XB5HUTG6"]
iex> duration = 30
iex> name = "ad-hoc maintenance"
iex> opts = %{:id => "ad-hoc"}
iex> result = NodePing.Maintenance.create!(token, duration, name, checklist, opts)

Creates a scheduled maintenance

iex> name = "scheduled maintenance"
iex> opts = %{:cron => "15 14 1 * *", :enabled => false}
iex> result = NodePing.Maintenance.create(token, duration, name, checklist, opts)
Link to this function

delete(token, id, customerid \\ nil)

View Source

Remove an ad-hoc or scheduled maintenance.

## Parameters

  • token - NodePing API token that is provided with account
  • id - maintenance id
  • customerid - optional ID to access a subaccount

## Examples

iex> token = System.fetch_env!("TOKEN")
iex> id = "NZT101"
iex> {:ok, result} = NodePing.Maintenance.delete(token, id)
Link to this function

delete!(token, id, customerid \\ nil)

View Source

Remove an ad-hoc or scheduled maintenance.

## Parameters

  • token - NodePing API token that is provided with account
  • id - maintenance id
  • customerid - optional ID to access a subaccount

## Examples

iex> token = System.fetch_env!("TOKEN")
iex> id = "NZT101"
iex> result = NodePing.Maintenance.delete!(token)
Link to this function

get(token, customerid \\ nil)

View Source

Get maintenance information for all maintenance entries.

## 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.Maintenance.get(token)
Link to this function

get!(token, customerid \\ nil)

View Source

Get maintenance information for all maintenance entries.

## 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.Maintenance.get!(token)
Link to this function

get_by_id(token, id, customerid \\ nil)

View Source

Get maintenance information for a specific maintenance entry.

Parameters

  • token - NodePing API token that is provided with account
  • id - maintenance id
  • customerid - optional ID to access a subaccount

Examples

iex> token = System.fetch_env!("TOKEN")
iex> id = "NZT101"
iex> {:ok, result} = NodePing.Maintenance.get_by_id(token, id)
Link to this function

get_by_id!(token, id, customerid \\ nil)

View Source

Get maintenance information for a specific maintenance entry.

Parameters

  • token - NodePing API token that is provided with account
  • id - maintenance id
  • customerid - optional ID to access a subaccount

Examples

iex> token = System.fetch_env!("TOKEN")
iex> id = "NZT101"
iex> result = NodePing.Maintenance.get_by_id!(token, id)
Link to this function

update(token, id, duration, checklist, opts, customerid \\ nil)

View Source

Update a scheduled or ad-hoc maintenance.

Parameters

  • token - NodePing API token that is provided with account
  • id - ID for maintenance schedule that will be updated
  • duration - The duration that the maintenance will run
  • checklist - a list of check IDs that are a part of the maintenance
  • opts - Map of optional arguments for creating the maintenance
  • customerid - optional ID to access a subaccount

Opts

  • enabled - for scheduled maintenance. Whether it should be enabled or disabled on creation
  • name - the name for the maintenance
  • cron - cron string for when scheduled maintenance should start

Examples

iex> token = System.fetch_env!("TOKEN")
iex> checklist = ["201911191441YC6SJ-4S9OJ78G","201911191441YC6SJ-XB5HUTG6"]
iex> duration = 30
iex> id = "NZT101"
iex> opts = %{:name => "new maintenance name"}
iex> {:ok, result} = NodePing.Maintenance.update(token, id, duration, checklist, opts)
Link to this function

update!(token, id, duration, checklist, opts, customerid \\ nil)

View Source

Update a scheduled or ad-hoc maintenance.

Parameters

  • token - NodePing API token that is provided with account
  • id - ID for maintenance schedule that will be updated
  • duration - The duration that the maintenance will run
  • checklist - a list of check IDs that are a part of the maintenance
  • opts - Map of optional arguments for creating the maintenance
  • customerid - optional ID to access a subaccount

Opts

  • enabled - for scheduled maintenance. Whether it should be enabled or disabled on creation
  • name - the name for the maintenance
  • cron - cron string for when scheduled maintenance should start

Examples

iex> token = System.fetch_env!("TOKEN")
iex> checklist = ["201911191441YC6SJ-4S9OJ78G","201911191441YC6SJ-XB5HUTG6"]
iex> duration = 30
iex> id = "NZT101"
iex> opts = %{:name => "new maintenance name"}
iex> result = NodePing.Maintenance.update!(token, id, duration, checklist, opts)