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

Safe HaskellNone
LanguageHaskell2010

Network.PagerDuty.REST.EscalationPolicies.EscalationRules

Contents

Description

This API lets you access and manipulate escalation rules of an existing escalation policy.

See: http://developer.pagerduty.com/documentation/rest/escalation_policies/escalation_rules

Synopsis

List Rules

listRules :: EscalationPolicyId -> Request Empty s [Rule]

List all the escalation rules for an existing escalation policy.

GET /escalation_policies/:escalation_policy_id/escalation_rules

See: http://developer.pagerduty.com/documentation/rest/escalation_policies/escalation_rules/list

Create Rule

data CreateRule

Instances

Eq CreateRule 
Show CreateRule 
ToJSON CreateRule 
FromJSON CreateRule 
QueryLike CreateRule 

createRule

Creates a new escalation rule for an escalation policy and appends it to the end of the existing escalation rules.

POST /escalation_policies/:escalation_policy_id/escalation_rules

See: http://developer.pagerduty.com/documentation/rest/escalation_policies/escalation_rules/create

crEscalationDelayInMinutes :: Lens' CreateRule Int

The escalation timeout in minutes. Must be at least 5 if the rule has multiple targets, and at least 1 if not. If an incident is not acknowledged within this timeout then it will escalate onto the next escalation rule.

crTargets :: Lens' CreateRule [TargetId]

The list of the targets an incident should be assigned to upon reaching this rule.

Get Rule

getRule :: EscalationPolicyId -> EscalationRuleId -> Request Empty s Rule

Show the escalation rule for an existing escalation policy.

GET /escalation_policies/:escalation_policy_id/escalation_rules/:id

See: http://developer.pagerduty.com/documentation/rest/escalation_policies/escalation_rules/show

Update Rules

data UpdateRules

Instances

updateRules

Arguments

:: EscalationPolicyId 
-> [TargetId]

urEscalationRules

-> Request UpdateRules s [Rule] 

Updates the entire collection of escalation rules for an existing escalation policy. The ordering is determined by the positions of each rule in the list. To create a new rule, add it to the list without an id. To remove a rule, do not include it in the list.

PUT /escalation_policies/:escalation_policy_id/escalation_rules

See: http://developer.pagerduty.com/documentation/rest/escalation_policies/escalation_rules/multi_update

urEscalationRules :: Iso' UpdateRules [TargetId]

An ordered array of escalation rules.

Update Rule

data UpdateRule

Instances

Eq UpdateRule 
Show UpdateRule 
ToJSON UpdateRule 
FromJSON UpdateRule 
QueryLike UpdateRule 

updateRule :: EscalationPolicyId -> EscalationRuleId -> Request UpdateRule s Rule

Updates an escalation rule.

PUT /escalation_policies/:escalation_policy_id/escalation_rules/:id

See: http://developer.pagerduty.com/documentation/rest/escalation_policies/escalation_rules/update

urEscalationDelayInMinutes :: Lens' UpdateRule (Maybe Int)

The escalation timeout in minutes. Must be at least 5 if the rule has multiple targets, and at least 1 if not. If an incident is not acknowledged within this timeout then it will escalate onto the next escalation rule.

urTargets :: Lens' UpdateRule [TargetId]

The list of the targets an incident should be assigned to upon reaching this rule.

Delete Rule

deleteRule :: EscalationPolicyId -> EscalationRuleId -> Request Empty s Empty

Deletes an existing escalation rule that belongs to an escalation policy. There must be a matching rule.

DELETE /escalation_policies/:escalation_policy_id/escalation_rules/:id

See: http://developer.pagerduty.com/documentation/rest/escalation_policies/escalation_rules/delete

Types

class HasUserInfo a where

Minimal complete definition

userInfo

Methods

userInfo :: Lens' a UserInfo

uId :: Lens' a UserId

The id of the user.

uName :: Lens' a Text

The name of the user.

uEmail :: Lens' a Address

The user's email address.

uColor :: Lens' a Text

The color used to represent the user in schedules.

uTimeZone :: Lens' a TimeZone

The user's personal time zone.

Instances

data Target

Instances

Eq Target 
Show Target 
ToJSON Target 
FromJSON Target 

stId :: Lens' ScheduleTarget ScheduleId

The id of the target.

stName :: Lens' ScheduleTarget Text

The name of the target.

data Rule

Instances

Eq Rule 
Show Rule 
ToJSON Rule 
FromJSON Rule 

rId :: Lens' Rule EscalationRuleId

The ID of the escalation rule.

rEscalationDelayInMinutes :: Lens' Rule Int

The amount of time before an incident escalates away from this rule.

rTargets :: Lens' Rule [Target]

A list of targets which an incident will be assigned to upon reaching this rule.