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

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

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 Source #

The name of the service.

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

A description for your service. 1024 character maximum.

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

The type of service to create.

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

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 Source #

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

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

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) Source #

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

Default: 4 hours.

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

Specifies what severity levels will create a new open incident.

Get Service

getService :: ServiceId -> Request Empty s Service Source #

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) Source #

The name of the service.

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

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

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

A description for your service. 1024 character maximum.

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

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) Source #

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

Default: 4 hours.

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

Specifies what severity levels will create a new open incident.

Delete Service

deleteService :: ServiceId -> Request Empty s Empty Source #

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 Source #

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 Source #

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 Source #

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 ServiceStatus Source #

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 Source #

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

svcId :: Lens' Service ServiceId Source #

A unique identifier for this service.

svcName :: Lens' Service Text Source #

The name of the service.

svcDescription :: Lens' Service Text Source #

The description of the service

svcServiceUrl :: Lens' Service Text Source #

Relative URL that corresponds to this service.

svcServiceKey :: Lens' Service ServiceKey Source #

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) Source #

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) Source #

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 Source #

The date/time when this service was created.

svcStatus :: Lens' Service ServiceStatus Source #

The current state of the Service.

svcLastIncidentTimestamp :: Lens' Service (Maybe UTCTime) Source #

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

svcEmailIncidentCreation :: Lens' Service (Maybe EmailIncidentCreation) Source #

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

svcIncidentCounts :: Lens' Service IncidentCounts Source #

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

svcEmailFilterMode :: Lens' Service EmailFilterMode Source #

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

svcType :: Lens' Service ServiceType Source #

The service type.

svcEscalationPolicy :: Lens' Service (Maybe PolicyInfo) Source #

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

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

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

svcSeverityFilter :: Lens' Service (Maybe SeverityFilter) Source #

Specifies what severity levels will create a new open incident.