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 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)