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.

Functions

Link to this function

create(client \\ %Client{}, body)

View Source
@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

Link to this function

destroy(client \\ %Client{}, id)

View Source

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

Link to this function

list(client \\ %Client{}, opts \\ [])

View Source
@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

Link to this function

show(client \\ %Client{}, id)

View Source

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

Link to this function

update(client \\ %Client{}, id, body)

View Source
@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