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
- scheduleInfo :: Lens' a ScheduleInfo
- sId :: Lens' a ScheduleId
- sName :: Lens' a Text
- sTimeZone :: Lens' a TimeZone
- sToday :: Lens' a UTCTime
- sEscalationPolicies :: Lens' a [EscalationPolicyId]
- data ScheduleInfo
- data Schedule
- sScheduleLayers :: Lens' Schedule [ScheduleLayer]
- sOverridesSubschedule :: Lens' Schedule ScheduleLayer
- sFinalSchedule :: Lens' Schedule ScheduleLayer
List Schedules
data ListSchedules
Eq ListSchedules | |
Show ListSchedules | |
ToJSON ListSchedules | |
HasDatatypeInfo ListSchedules | |
Generic ListSchedules | |
QueryLike ListSchedules | |
Paginate ListSchedules | |
type Code ListSchedules = (:) [*] ((:) * (Maybe Text) ([] *)) ([] [*]) |
listSchedules :: RequesterId -> Request ListSchedules s [ScheduleInfo]
List existing on-call schedules.
GET /schedules
See: http://developer.pagerduty.com/documentation/rest/schedules/list
lsQuery :: Lens' (Request ListSchedules s b) (Maybe Text)
Filters the result, showing only the schedules whose name matches the query.
Get Schedule
data GetSchedule
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
data GetScheduleUsers
Eq GetScheduleUsers | |
Show GetScheduleUsers | |
ToJSON GetScheduleUsers | |
HasDatatypeInfo GetScheduleUsers | |
Generic GetScheduleUsers | |
QueryLike GetScheduleUsers | |
type Code GetScheduleUsers |
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
data GetScheduleEntries
Eq GetScheduleEntries | |
Show GetScheduleEntries | |
ToJSON GetScheduleEntries | |
HasDatatypeInfo GetScheduleEntries | |
Generic GetScheduleEntries | |
QueryLike GetScheduleEntries | |
type Code GetScheduleEntries |
:: 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
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
data CreateSchedule
Eq CreateSchedule | |
Show CreateSchedule | |
ToJSON CreateSchedule | |
QueryLike CreateSchedule |
:: Text | |
-> TimeZone | |
-> [ScheduleLayer] | |
-> Request CreateSchedule s Schedule |
Create a new on-call schedule.
POST /schedules
See: http://developer.pagerduty.com/documentation/rest/schedules/create
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
data UpdateSchedule
Eq UpdateSchedule | |
Show UpdateSchedule | |
ToJSON UpdateSchedule | |
QueryLike UpdateSchedule |
:: 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
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
data PreviewSchedule
Eq PreviewSchedule | |
Show PreviewSchedule | |
ToJSON PreviewSchedule | |
QueryLike PreviewSchedule |
:: 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)
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
deleteSchedule :: ScheduleId -> Request Empty s Empty
Delete an on-call schedule.
DELETE /schedules/:id
See: http://developer.pagerduty.com/documentation/rest/schedules/delete
Types
data RestrictionType
Eq RestrictionType | |
Show RestrictionType | |
ToJSON RestrictionType | |
FromJSON RestrictionType |
data Restriction
Eq Restriction | |
Show Restriction | |
ToJSON Restriction | |
FromJSON Restriction |
rStartTimeOfDay :: Lens' Restriction UTCTime
rDurationSeconds :: Lens' Restriction Int
rMemberOrder :: Lens' Rotation Int
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.
Eq ScheduleLayer | |
Show ScheduleLayer | |
ToJSON ScheduleLayer | |
FromJSON ScheduleLayer |
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
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.
data ScheduleInfo
Eq ScheduleInfo | |
Show ScheduleInfo | |
ToJSON ScheduleInfo | |
FromJSON ScheduleInfo | |
HasScheduleInfo ScheduleInfo |
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.