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

Safe HaskellNone
LanguageHaskell2010

Network.PagerDuty.REST.Services

Contents

Description

This API lets you access and manipulate the services across your account.

A service is an endpoint (like Nagios, email, or an API call) that generates events, which Pagerduty normalizes and dedupes, creating incidents.

When a service is shown inlined in other resources, a deleted service will have its html_url attribute set to Nothing.

See: http://developer.pagerduty.com/documentation/rest/services

Synopsis

List Services

data ListServices

Instances

lsTimeZone :: Lens' (Request ListServices s r) (Maybe TimeZone)

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

Default: account default time zone.

Create Service

csName :: Lens' (Request CreateService s r) Text

The name of the service.

csDescription :: Lens' (Request CreateService s r) (Maybe Text)

A description for your service. 1024 character maximum.

csType :: Lens' (Request CreateService s r) ServiceType

The type of service to create.

csVendorId :: Lens' (Request CreateService s r) (Maybe VendorId)

PagerDuty's internal vendor identifier for this service. For more information about a specific vendor, please contact PagerDuty Support.

csEscalationPolicyId :: Lens' (Request CreateService s r) EscalationPolicyId

The id of the escalation policy to be used by this service.

csAcknowledgementTimeout :: Lens' (Request CreateService s r) (Maybe Int)

The duration in seconds before an incidents acknowledged in this service become triggered again.

Default: 30 minutes.

csAutoResolveTimeout :: Lens' (Request CreateService s r) (Maybe Int)

The duration in seconds before a triggered incident auto-resolves itself.

Default: 4 hours.

csSeverityFilter :: Lens' (Request CreateService s r) (Maybe SeverityFilter)

Specifies what severity levels will create a new open incident.

Get Service

getService :: ServiceId -> Request Empty s Service

Get details about an existing service.

GET services/:id

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

Update Service

usName :: Lens' (Request UpdateService s r) (Maybe Text)

The name of the service.

usEscalationPolicyId :: Lens' (Request UpdateService s r) (Maybe EscalationPolicyId)

The id of the escalation policy to be used by this service.

usDescription :: Lens' (Request UpdateService s r) (Maybe Text)

A description for your service. 1024 character maximum.

usAcknowledgementTimeout :: Lens' (Request UpdateService s r) (Maybe Int)

The duration in seconds before an incidents acknowledged in this service become triggered again.

Default: 30 minutes.

usAutoResolveTimeout :: Lens' (Request UpdateService s r) (Maybe Int)

The duration in seconds before a triggered incident auto-resolves itself.

Default: 4 hours.

usSeverityFilter :: Lens' (Request UpdateService s r) (Maybe SeverityFilter)

Specifies what severity levels will create a new open incident.

Delete Service

deleteService :: ServiceId -> Request Empty s Empty

Delete an existing service. Once the service is deleted, it will not be accessible from the web UI and new incidents won't be able to be created for this service.

DELETE /services/:id

See: http://developer.pagerduty.com/documentation/rest/services/delete

Enable Service

enableService :: RequesterId -> ServiceId -> Request Empty s Empty

Enable a previously disabled service.

PUT services/:id/enable

See: http://developer.pagerduty.com/documentation/rest/services/enable

Disable Service

disableService :: RequesterId -> ServiceId -> Request Empty s Empty

Disable a service. Once a service is disabled, it will not be able to create incidents until it is enabled again.

PUT services/:id/disable

See: http://developer.pagerduty.com/documentation/rest/services/disable

Regenerate Key

regenerateKey :: ServiceId -> Request Empty s Service

Regenerate a new service key for an existing service.

_Warning! The service's previous key will be invalidated, and existing monitoring integrations will need to be modified to use the new key!_

POST services/:id/regenerate_key

See: http://developer.pagerduty.com/documentation/rest/services/regenerate_key

Types

data EmailFilterMode

Constructors

AllEmail

Accept all incoming email

OrRulesEmail

Accept email only if it matches ONE OR MORE rules below

AndRulesEmail

Accept email only if it matches ALL of the rules below

data EmailIncidentCreation

Constructors

OnNewEmail

Open a new incident for each trigger email.

OnNewEmailSubject

Open a new incident for each new trigger email subject.

OnlyIfNoOpenIncidents

Open a new incident only if an open incident does not already exist.

data ServiceStatus

Constructors

Active

The service is enabled and has no open incidents.

Warning

The service is enabled and has one or more acknowledged incidents.

Critical

The service is enabled and has one or more triggered incidents.

Maintenance

The service is under maintenance, no new incidents will be triggered during maintenance mode.

Disabled

The service is disabled and will not have any new triggered incidents.

data SeverityFilter

Constructors

SevCritical

Incidents are created when an alarm enters the Critical state.

SevCriticalOrWarning

Incidents are created when an alarm enters the Critical OR Warning states

SevOnAny

SQL Monitor: Incidents are created for alerts of any severity.

SevOnHigh

SQL Monitor: Incidents are created for alerts with high severity.

SevOnMediumHigh

SQL Monitor: Incidents are created for with high or medium severity

data PolicyInfo

Instances

pinfoName :: Lens' PolicyInfo Text

data Service

Instances

Eq Service 
Show Service 
ToJSON Service 
FromJSON Service 

svcId :: Lens' Service ServiceId

A unique identifier for this service.

svcName :: Lens' Service Text

The name of the service.

svcDescription :: Lens' Service Text

The description of the service

svcServiceUrl :: Lens' Service Text

Relative URL that corresponds to this service.

svcServiceKey :: Lens' Service ServiceKey

For Email services, the serviceKey is the associated email address for the service. For all other service types, this is the unique key used for API calls.

svcAutoResolveTimeout :: Lens' Service (Maybe Int)

Time in seconds that an incident changes to the Triggered State after being Acknowledged. Value is Nothing if the feature is disabled.

svcAcknowledgementTimeout :: Lens' Service (Maybe Int)

Time in seconds that an incident is automatically resolved if left open for that long. Value is Nothing is the feature is disabled.

svcCreatedAt :: Lens' Service UTCTime

The date/time when this service was created.

svcStatus :: Lens' Service ServiceStatus

The current state of the Service.

svcLastIncidentTimestamp :: Lens' Service (Maybe UTCTime)

The date/time when the most recent incident was created for this service.

svcEmailIncidentCreation :: Lens' Service (Maybe EmailIncidentCreation)

If the service is a Generic Email service, this describes what kind of emails create an incident.

svcIncidentCounts :: Lens' Service IncidentCounts

An object with the number of incidents corresponding to these states.

svcEmailFilterMode :: Lens' Service EmailFilterMode

If the service is a Generic Email service, this describes which types of email will generate an incident.

svcType :: Lens' Service ServiceType

The service type.

svcEscalationPolicy :: Lens' Service (Maybe PolicyInfo)

An object containing the ID and name of the escalation policy used by this service.

svcEmailFilters :: Lens' Service (Maybe [EmailFilterInfo])

An object containing inline Email Filters. Note that only genericEmail services have filters.

svcSeverityFilter :: Lens' Service (Maybe SeverityFilter)

Specifies what severity levels will create a new open incident.