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
Create a scheduled or ad-hoc maintenance.
Parameters
token
- NodePing API token that is provided with accountduration
- The duration that the maintenance will runname
- the name for the maintenancechecklist
- a list of check IDs that are a part of the maintenanceopts
-Map
of optional arguments for creating the maintenancecustomerid
- optional ID to access a subaccount
Opts
id
- Set this to "ad-hoc" if you want an ad-hoc maintenanceenabled
- for scheduled maintenance. Whether it should be enabled or disabled on creationcron
- 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)
create!(token, duration, name, checklist, opts, customerid \\ nil)
View SourceCreate a scheduled or ad-hoc maintenance.
Parameters
token
- NodePing API token that is provided with accountduration
- The duration that the maintenance will runname
- the name for the maintenancechecklist
- a list of check IDs that are a part of the maintenanceopts
-Map
of optional arguments for creating the maintenancecustomerid
- optional ID to access a subaccount
Opts
id
- Set this to "ad-hoc" if you want an ad-hoc maintenanceenabled
- for scheduled maintenance. Whether it should be enabled or disabled on creationcron
- 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)
Remove an ad-hoc or scheduled maintenance.
## Parameters
token
- NodePing API token that is provided with accountid
- maintenance idcustomerid
- optional ID to access a subaccount
## Examples
iex> token = System.fetch_env!("TOKEN")
iex> id = "NZT101"
iex> {:ok, result} = NodePing.Maintenance.delete(token, id)
Remove an ad-hoc or scheduled maintenance.
## Parameters
token
- NodePing API token that is provided with accountid
- maintenance idcustomerid
- optional ID to access a subaccount
## Examples
iex> token = System.fetch_env!("TOKEN")
iex> id = "NZT101"
iex> result = NodePing.Maintenance.delete!(token)
Get maintenance information for all maintenance entries.
## 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.Maintenance.get(token)
Get maintenance information for all maintenance entries.
## 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.Maintenance.get!(token)
Get maintenance information for a specific maintenance entry.
Parameters
token
- NodePing API token that is provided with accountid
- maintenance idcustomerid
- 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)
Get maintenance information for a specific maintenance entry.
Parameters
token
- NodePing API token that is provided with accountid
- maintenance idcustomerid
- 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)
Update a scheduled or ad-hoc maintenance.
Parameters
token
- NodePing API token that is provided with accountid
- ID for maintenance schedule that will be updatedduration
- The duration that the maintenance will runchecklist
- a list of check IDs that are a part of the maintenanceopts
-Map
of optional arguments for creating the maintenancecustomerid
- optional ID to access a subaccount
Opts
enabled
- for scheduled maintenance. Whether it should be enabled or disabled on creationname
- the name for the maintenancecron
- 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)
Update a scheduled or ad-hoc maintenance.
Parameters
token
- NodePing API token that is provided with accountid
- ID for maintenance schedule that will be updatedduration
- The duration that the maintenance will runchecklist
- a list of check IDs that are a part of the maintenanceopts
-Map
of optional arguments for creating the maintenancecustomerid
- optional ID to access a subaccount
Opts
enabled
- for scheduled maintenance. Whether it should be enabled or disabled on creationname
- the name for the maintenancecron
- 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)