NodePing.Schedules.update-exclamation-mark
You're seeing just the function
update-exclamation-mark
, go back to NodePing.Schedules module for more information.
Create a schedule for your account or subaccount
Parameters
token
- NodePing API token that is provided with accountid
- The name or ID you want to give your scheduledata
-Map
containing schedule informationtime1
- start of time spantime2
- end of time spanexclude
- inverts the time span so it is all day except for the time between time1 and time2disabled
- disables notifications for this dayallday
- enables notifications for the entire day
customerid
- optional ID to access a subaccount
Examples
iex> token = System.fetch_env!("TOKEN")
iex> id = "My Work Schedule"
iex> data = %{
"data" => %{
"friday" => %{"exclude" => 1, "time1" => "6:00", "time2" => "18:00"},
"monday" => %{"disabled" => true},
"saturday" => %{"allday" => true},
"sunday" => %{"exclude" => 0, "time1" => "6:00", "time2" => "18:00"},
"thursday" => %{"exclude" => 0, "time1" => "6:00", "time2" => "18:00"},
"tuesday" => %{"exclude" => 0, "time1" => "12:00", "time2" => "18:00"},
"wednesday" => %{"exclude" => 0, "time1" => "6:00", "time2" => "18:00"}
}
}
iex> result = NodePing.Schedules.update!(token, id, data)