pagerduty-0.0.8: Client library for PagerDuty Integration and REST APIs.

Safe HaskellNone
LanguageHaskell2010

Network.PagerDuty.REST.Schedules

Contents

Description

On call schedules determine the time periods that users are on-call. Only when a user is on-call he is eligible to receive alerts from incidents.

This API allows users to manipulate on-call schedules.

See: http://developer.pagerduty.com/documentation/rest/schedules/overrides

Synopsis

List Schedules

lsQuery :: Lens' (Request ListSchedules s b) (Maybe Text) Source #

Filters the result, showing only the schedules whose name matches the query.

Get Schedule

getSchedule :: Request GetSchedule s Schedule Source #

Show detailed information about a schedule, including entries for each layer and sub-schedule.

GET /schedules/:id

See: http://developer.pagerduty.com/documentation/rest/schedules/show

gsSince :: Lens' (Request GetSchedule s b) (Maybe UTCTime) Source #

The start of the date range over which you want to return on-call schedule entries and on-call schedule layers.

gsUntil :: Lens' (Request GetSchedule s b) (Maybe UTCTime) Source #

The end of the date range over which you want to return schedule entries and on-call schedule layers.

gsTimeZone :: Lens' (Request GetSchedule s b) (Maybe TimeZone) Source #

Time zone in which dates in the result will be rendered.

Default: account time zone.

Get Schedule Users

getScheduleUsers :: UserId -> Request GetScheduleUsers s [User] Source #

List all the users on-call in a given schedule for a given time range.

GET /schedules/:id/users

See: http://developer.pagerduty.com/documentation/rest/schedules/users

gsuSince :: Lens' (Request GetScheduleUsers s b) (Maybe UTCTime) Source #

The start of the date range over which you want to return on-call users.

gsuUntil :: Lens' (Request GetScheduleUsers s b) (Maybe UTCTime) Source #

The end time of the date range over which you want to return on-call users.

Get Schedule Entries

getScheduleEntries Source #

Arguments

:: UserId 
-> Date

gseSince

-> Date

gseUntil

-> Request GetScheduleEntries s b 

List schedule entries that are active for a given time range for a specified on-call schedule.

GET /schedules/:id/entries

See: http://developer.pagerduty.com/documentation/rest/schedules/entries

gseSince :: Lens' (Request GetScheduleEntries s b) UTCTime Source #

The start of the date range over which you want to return on-call schedule entries. The maximum range queryable at once is three months.

gseUntil :: Lens' (Request GetScheduleEntries s b) UTCTime Source #

The end of the date range over which you want to return schedule entries.

gseOverflow :: Lens' (Request GetScheduleEntries s b) Bool Source #

Any on-call schedule entries that pass the date range bounds will be truncated at the bounds, unless the parameter overflow=true is passed.

Default: false.

Example: if your schedule is a rotation that changes daily at midnight UTC, and your date range is from 2011-06-01T10:00:00Z to 2011-06-01T14:00:00Z: If you don't pass the overflow=true parameter, you will get one schedule entry returned with a start of 2011-06-01T10:00:00Z and end of 2011-06-01T14:00:00Z. If you do pass the overflow=true parameter, you will get one schedule entry returned with a start of 2011-06-01T00:00:00Z and end of 2011-06-02T00:00:00Z.

gseTimeZone :: Lens' (Request GetScheduleEntries s b) (Maybe TimeZone) Source #

Time zone in which dates in the result will be rendered.

Default: account time zone.

gseUserId :: Lens' (Request GetScheduleEntries s b) (Maybe UserId) Source #

To filter the returned on-call schedule entries by a specific user, you can optionally add the user_id parameter to the query.

Create Schedule

csName :: Lens' (Request CreateSchedule s b) Text Source #

The name of the schedule.

csOverflow :: Lens' (Request CreateSchedule s b) Bool Source #

Any on-call schedule entries that pass the date range bounds will be truncated at the bounds, unless csOverflow is set to True.

Default: False.

csTimeZone :: Lens' (Request CreateSchedule s b) TimeZone Source #

The time zone of the schedule.

Default: UTC.

csScheduleLayers :: Lens' (Request CreateSchedule s b) [ScheduleLayer] Source #

A list of schedule layers.

Update Schedule

updateSchedule Source #

Update an existing on-call schedule.

Note: You cannot delete schedule layers. You must include all layers in your update request. To delete a layer, set the end parameter to schedule its termination.

PUT /schedules/:id

See: http://developer.pagerduty.com/documentation/rest/schedules/update

usOverflow :: Lens' (Request UpdateSchedule s b) Bool Source #

Any on-call schedule entries that pass the date range bounds will be truncated at the bounds, unless usOverflow is set to True.

Default: False.

usTimeZone :: Lens' (Request UpdateSchedule s b) TimeZone Source #

The time zone of the schedule.

usScheduleLayers :: Lens' (Request UpdateSchedule s b) [ScheduleLayer] Source #

A list of schedule layers.

Preview Schedule

previewSchedule Source #

Preview what a schedule would look like without saving it. This work the same as the update or create actions, except that the result is not persisted. Preview optionally takes two additional arguments, since and until, deliminating the span of the preview.

POST /schedules/preview

See: http://developer.pagerduty.com/documentation/rest/schedules/preview

psSince :: Lens' (Request PreviewSchedule s b) (Maybe UTCTime) Source #

The start of the date range over which you want to return on-call schedule entries and on-call schedule layers.

psUntil :: Lens' (Request PreviewSchedule s b) (Maybe UTCTime) Source #

The end of the date range over which you want to return schedule entries and on-call schedule layers.

psOverflow :: Lens' (Request PreviewSchedule s b) Bool Source #

Any on-call schedule entries that pass the date range bounds will be truncated at the bounds, unless psOverflow is set to True.

Default: False.

psName :: Lens' (Request PreviewSchedule s b) Text Source #

The name of the schedule.

psTimeZone :: Lens' (Request PreviewSchedule s b) TimeZone Source #

The time zone of the schedule.

Default: UTC.

psScheduleLayers :: Lens' (Request PreviewSchedule s b) [ScheduleLayer] Source #

A list of schedule layers.

Delete Schedule

Types

data ScheduleLayer Source #

A schedule is composed of multiple schedule layers.

A layer is composed of a group of people who will rotate through the same shift. In a basic weekly schedule, you create a single layer where each member is on-call for one week, with a set day and time for transferring on-call duty.

When a schedule has multiple layers, the layer can be ordered using the priority field. The layer with the highest priority has precedence over the layers with lower priority. You can use restrictions to control how layers overlap.

The override layer is a special layer where all the override entries are stored.

The final layer is a special layer that contains the result of all the previous layers put together. This layer cannot be edited.

slRenderedScheduleEntries :: Lens' ScheduleLayer [ScheduleId] Source #

This is a list of entries to be rendered for the current time range.

slRestrictionType :: Lens' ScheduleLayer RestrictionType Source #

This specifies the type of restrictions present on this layer.

slRestrictions :: Lens' ScheduleLayer [Restriction] Source #

A list of time restrictions for this layer.

slPriority :: Lens' ScheduleLayer Int Source #

The priority of the layer. Layers with higher priority will override layers with a lower priority.

slStart :: Lens' ScheduleLayer Date Source #

The effective start date of the layer

slEnd :: Lens' ScheduleLayer Date Source #

The effective end date of the layer. If Nothing, the layer has no end date.

slRenderedCoveragePercentage :: Lens' ScheduleLayer Double Source #

The percentage of the time range covered by this layer.

slRotationTurnLengthSeconds :: Lens' ScheduleLayer Int Source #

The duration of each on-call shift in seconds.

slRotationVirtualStart :: Lens' ScheduleLayer Date Source #

The effective start time of the layer. This can be before the start time of the schedule.

slUsers :: Lens' ScheduleLayer [Rotation] Source #

An ordered list of users in this layer. The member_order field controls the order in which the users apear in the rotation.

sScheduleLayers :: Lens' Schedule [ScheduleLayer] Source #

A list of schedule layers. See the schedule layers parameters for details.

sOverridesSubschedule :: Lens' Schedule ScheduleLayer Source #

The schedule layer object where all the overrides are stored.

sFinalSchedule :: Lens' Schedule ScheduleLayer Source #

The final schedule layer object.