View Source IncidentIo.SchedulesV2 (IncidentIo v0.1.0)
List configured schedules.
Summary
Functions
Create a new schedule.
Archives a single schedule.
Get a list of schedules.
Get a single schedule.
Update a schedule.
Functions
@spec create(IncidentIo.Client.t(), request_body()) :: IncidentIo.response()
Create a new schedule.
Schedule body example:
%{
schedule: %{
annotations: %{
"incident.io/terraform/version": "version-of-terraform"
},
config: %{
rotations: [
%{
effective_from: "2021-08-17T13:28:57.801578Z",
handover_start_at: "2021-08-17T13:28:57.801578Z",
handovers: [
%{
interval: 1,
interval_type: "daily"
}
],
id: "01G0J1EXE7AXZ2C93K61WBPYEH",
layers: [
%{
id: "01G0J1EXE7AXZ2C93K61WBPYEH",
name: "Layer 1"
}
],
name: "My Rotation",
users: [
%{
email: "bob@example.com",
id: "01G0J1EXE7AXZ2C93K61WBPYEH",
slack_user_id: "USER123"
}
],
working_interval: [
%{
end_time: "17:00",
start_time: "09:00",
weekday: "tuesday"
}
]
}
]
},
name: "My Schedule",
timezone: "America/Los_Angeles"
}
}
Example
IncidentIo.SchedulesV2.create(client, body)
More information at: https://api-docs.incident.io/tag/Schedules-V2#operation/Schedules%20V2_Create
@spec destroy(IncidentIo.Client.t(), binary()) :: IncidentIo.response()
Archives a single schedule.
Example
IncidentIo.SchedulesV2.destroy(client, "some-schedule-id")
More information at: https://api-docs.incident.io/tag/Schedules-V2#operation/Schedules%20V2_Destroy
@spec list(IncidentIo.Client.t(), request_options()) :: IncidentIo.response()
Get a list of schedules.
Example
IncidentIo.SchedulesV2.list(client)
More information at: https://api-docs.incident.io/tag/Schedules-V2#operation/Schedules%20V2_List
@spec show(IncidentIo.Client.t(), binary()) :: IncidentIo.response()
Get a single schedule.
Example
IncidentIo.SchedulesV2.show(client, "some-schedule-id")
More information at: https://api-docs.incident.io/tag/Schedules-V2#operation/Schedules%20V2_Show
@spec update(IncidentIo.Client.t(), binary(), request_body()) :: IncidentIo.response()
Update a schedule.
Schedule body example:
%{
schedule: %{
annotations: %{
"incident.io/terraform/version": "version-of-terraform"
},
config: %{
rotations: [
%{
effective_from: "2021-08-17T13:28:57.801578Z",
handover_start_at: "2021-08-17T13:28:57.801578Z",
handovers: [
%{
interval: 1,
interval_type: "daily"
}
],
id: "01G0J1EXE7AXZ2C93K61WBPYEH",
layers: [
%{
id: "01G0J1EXE7AXZ2C93K61WBPYEH",
name: "Layer 1"
}
],
name: "My Rotation",
users: [
%{
email: "bob@example.com",
id: "01G0J1EXE7AXZ2C93K61WBPYEH",
slack_user_id: "USER123"
}
],
working_interval: [
%{
end_time: "17:00",
start_time: "09:00",
weekday: "tuesday"
}
]
}
]
},
name: "My Schedule",
timezone: "America/Los_Angeles"
}
}
Example
IncidentIo.SchedulesV2.update(client, body)
More information at: https://api-docs.incident.io/tag/Schedules-V2#operation/Schedules%20V2_Update