NodePing.Maintenance.create-exclamation-mark
You're seeing just the function
create-exclamation-mark
, go back to NodePing.Maintenance module for more information.
Link to this function
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)