pagerduty-0.0.1.1: 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

data ListSchedules

Instances

Eq ListSchedules 
Show ListSchedules 
ToJSON ListSchedules 
HasDatatypeInfo ListSchedules 
Generic ListSchedules 
QueryLike ListSchedules 
Paginate ListSchedules 
type Code ListSchedules = (:) [*] ((:) * (Maybe Text) ([] *)) ([] [*]) 

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

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

Get Schedule

data GetSchedule

Instances

Eq GetSchedule 
Show GetSchedule 
ToJSON GetSchedule 
HasDatatypeInfo GetSchedule 
Generic GetSchedule 
QueryLike GetSchedule 
type Code GetSchedule 

getSchedule :: Request GetSchedule s Schedule

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)

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)

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)

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

Default: account time zone.

Get Schedule Users

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

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)

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

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

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

Get Schedule Entries

getScheduleEntries

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

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

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

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

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)

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

Default: account time zone.

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

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

The name of the schedule.

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

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

The time zone of the schedule.

Default: UTC.

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

A list of schedule layers.

Update Schedule

updateSchedule

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

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

The time zone of the schedule.

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

A list of schedule layers.

Preview Schedule

previewSchedule

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)

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)

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

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

The name of the schedule.

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

The time zone of the schedule.

Default: UTC.

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

A list of schedule layers.

Delete Schedule

Types

rStartTimeOfDay :: Lens' Restriction UTCTime

data Rotation

Instances

Eq Rotation 
Show Rotation 
ToJSON Rotation 
FromJSON Rotation 

data ScheduleLayer

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.

slName :: Lens' ScheduleLayer Text

slRenderedScheduleEntries :: Lens' ScheduleLayer [ScheduleId]

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

slRestrictionType :: Lens' ScheduleLayer RestrictionType

This specifies the type of restrictions present on this layer.

slRestrictions :: Lens' ScheduleLayer [Restriction]

A list of time restrictions for this layer.

slPriority :: Lens' ScheduleLayer Int

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

slStart :: Lens' ScheduleLayer Date

The effective start date of the layer

slEnd :: Lens' ScheduleLayer Date

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

slRenderedCoveragePercentage :: Lens' ScheduleLayer Double

The percentage of the time range covered by this layer.

slRotationTurnLengthSeconds :: Lens' ScheduleLayer Int

The duration of each on-call shift in seconds.

slRotationVirtualStart :: Lens' ScheduleLayer Date

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

slUsers :: Lens' ScheduleLayer [Rotation]

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

class HasScheduleInfo a where

Minimal complete definition

scheduleInfo

Methods

scheduleInfo :: Lens' a ScheduleInfo

sId :: Lens' a ScheduleId

The unique identifier of the schedule.

sName :: Lens' a Text

The name of the schedule.

sTimeZone :: Lens' a TimeZone

The time zone of the schedule.

sToday :: Lens' a UTCTime

The current day in the schedule's time zone.

sEscalationPolicies :: Lens' a [EscalationPolicyId]

An list of all the escalation policies that uses this schedule.

sScheduleLayers :: Lens' Schedule [ScheduleLayer]

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

sOverridesSubschedule :: Lens' Schedule ScheduleLayer

The schedule layer object where all the overrides are stored.

sFinalSchedule :: Lens' Schedule ScheduleLayer

The final schedule layer object.