Safe Haskell | None |
---|---|
Language | Haskell2010 |
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
- data ListSchedules
- listSchedules :: RequesterId -> Request ListSchedules s [ScheduleInfo]
- lsQuery :: Lens' (Request ListSchedules s b) (Maybe Text)
- data GetSchedule
- getSchedule :: Request GetSchedule s Schedule
- gsSince :: Lens' (Request GetSchedule s b) (Maybe UTCTime)
- gsUntil :: Lens' (Request GetSchedule s b) (Maybe UTCTime)
- gsTimeZone :: Lens' (Request GetSchedule s b) (Maybe TimeZone)
- data GetScheduleUsers
- getScheduleUsers :: UserId -> Request GetScheduleUsers s [User]
- gsuSince :: Lens' (Request GetScheduleUsers s b) (Maybe UTCTime)
- gsuUntil :: Lens' (Request GetScheduleUsers s b) (Maybe UTCTime)
- data GetScheduleEntries
- getScheduleEntries :: UserId -> Date -> Date -> Request GetScheduleEntries s b
- gseSince :: Lens' (Request GetScheduleEntries s b) UTCTime
- gseUntil :: Lens' (Request GetScheduleEntries s b) UTCTime
- gseOverflow :: Lens' (Request GetScheduleEntries s b) Bool
- gseTimeZone :: Lens' (Request GetScheduleEntries s b) (Maybe TimeZone)
- gseUserId :: Lens' (Request GetScheduleEntries s b) (Maybe UserId)
- data CreateSchedule
- createSchedule :: Text -> TimeZone -> [ScheduleLayer] -> Request CreateSchedule s Schedule
- csName :: Lens' (Request CreateSchedule s b) Text
- csOverflow :: Lens' (Request CreateSchedule s b) Bool
- csTimeZone :: Lens' (Request CreateSchedule s b) TimeZone
- csScheduleLayers :: Lens' (Request CreateSchedule s b) [ScheduleLayer]
- data UpdateSchedule
- updateSchedule :: ScheduleId -> TimeZone -> [ScheduleLayer] -> Request UpdateSchedule s Schedule
- usOverflow :: Lens' (Request UpdateSchedule s b) Bool
- usTimeZone :: Lens' (Request UpdateSchedule s b) TimeZone
- usScheduleLayers :: Lens' (Request UpdateSchedule s b) [ScheduleLayer]
- data PreviewSchedule
- previewSchedule :: Text -> TimeZone -> [ScheduleLayer] -> Request PreviewSchedule s Schedule
- psSince :: Lens' (Request PreviewSchedule s b) (Maybe UTCTime)
- psUntil :: Lens' (Request PreviewSchedule s b) (Maybe UTCTime)
- psOverflow :: Lens' (Request PreviewSchedule s b) Bool
- psName :: Lens' (Request PreviewSchedule s b) Text
- psTimeZone :: Lens' (Request PreviewSchedule s b) TimeZone
- psScheduleLayers :: Lens' (Request PreviewSchedule s b) [ScheduleLayer]
- deleteSchedule :: ScheduleId -> Request Empty s Empty
- data RestrictionType
- data Restriction
- rStartTimeOfDay :: Lens' Restriction UTCTime
- rDurationSeconds :: Lens' Restriction Int
- data Rotation
- rMemberOrder :: Lens' Rotation Int
- rUser :: Lens' Rotation User
- data ScheduleLayer
- slName :: Lens' ScheduleLayer Text
- slRenderedScheduleEntries :: Lens' ScheduleLayer [ScheduleId]
- slRestrictionType :: Lens' ScheduleLayer RestrictionType
- slRestrictions :: Lens' ScheduleLayer [Restriction]
- slPriority :: Lens' ScheduleLayer Int
- slStart :: Lens' ScheduleLayer Date
- slEnd :: Lens' ScheduleLayer Date
- slRenderedCoveragePercentage :: Lens' ScheduleLayer Double
- slRotationTurnLengthSeconds :: Lens' ScheduleLayer Int
- slRotationVirtualStart :: Lens' ScheduleLayer Date
- slUsers :: Lens' ScheduleLayer [Rotation]
- class HasScheduleInfo a where
- data ScheduleInfo
- data Schedule
- sScheduleLayers :: Lens' Schedule [ScheduleLayer]
- sOverridesSubschedule :: Lens' Schedule ScheduleLayer
- sFinalSchedule :: Lens' Schedule ScheduleLayer
List Schedules
data ListSchedules Source #
listSchedules :: RequesterId -> Request ListSchedules s [ScheduleInfo] Source #
List existing on-call schedules.
GET /schedules
See: http://developer.pagerduty.com/documentation/rest/schedules/list
lsQuery :: Lens' (Request ListSchedules s b) (Maybe Text) Source #
Filters the result, showing only the schedules whose name matches the query.
Get Schedule
data GetSchedule Source #
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
data GetScheduleUsers Source #
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
data GetScheduleEntries Source #
:: UserId | |
-> Date | |
-> Date | |
-> 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
data CreateSchedule Source #
:: Text | |
-> TimeZone | |
-> [ScheduleLayer] | |
-> Request CreateSchedule s Schedule |
Create a new on-call schedule.
POST /schedules
See: http://developer.pagerduty.com/documentation/rest/schedules/create
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
data UpdateSchedule Source #
:: ScheduleId | |
-> TimeZone | |
-> [ScheduleLayer] | |
-> Request UpdateSchedule s Schedule |
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
data PreviewSchedule Source #
:: Text | |
-> TimeZone | |
-> [ScheduleLayer] | |
-> Request PreviewSchedule s Schedule |
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
.
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
deleteSchedule :: ScheduleId -> Request Empty s Empty Source #
Delete an on-call schedule.
DELETE /schedules/:id
See: http://developer.pagerduty.com/documentation/rest/schedules/delete
Types
data RestrictionType Source #
data Restriction Source #
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.
class HasScheduleInfo a where Source #
scheduleInfo :: Lens' a ScheduleInfo Source #
sId :: Lens' a ScheduleId Source #
The unique identifier of the schedule.
sName :: Lens' a Text Source #
The name of the schedule.
sTimeZone :: Lens' a TimeZone Source #
The time zone of the schedule.
sToday :: Lens' a UTCTime Source #
The current day in the schedule's time zone.
sEscalationPolicies :: Lens' a [EscalationPolicyId] Source #
An list of all the escalation policies that uses this schedule.
data ScheduleInfo Source #
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.