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

Safe HaskellNone
LanguageHaskell2010

Network.PagerDuty.Integration

Contents

Description

The PagerDuty event integration API is how you would add PagerDuty's advanced alerting functionality to any system that can make an HTTP API call. You can now add phone, SMS and email alerting to your monitoring tools, ticketing systems and custom software.

The API was designed to allow you to easily integrate a monitoring system with a Service in PagerDuty. Monitoring systems generally send out events when problems are detected and when these problems have been resolved (fixed). Some more advanced systems also understand the concept of acknowledgements: problems can be acknowledged by an engineer to signal he or she is working on fixing the issue.

Since monitoring systems emit events, the API is based around accepting events. Incoming events (sent via the API) are routed to a PagerDuty service and processed. They may result in a new incident being created, or an existing incident being acknowledged or resolved.

The same event-based API can also be used to integrate a PagerDuty service with ticketing systems and various other software tools.

See: http://developer.pagerduty.com/documentation/integration/events

Synopsis

Sending events

submit :: MonadIO m => Manager -> Event -> m (Either Error Response) Source

Send an event to the integration API.

submitWith :: MonadIO m => Manager -> Logger -> Event -> m (Either Error Response) Source

See: submit

Trigger

data Trigger Source

Instances

trigger Source

Arguments

:: ServiceKey

serviceKey

-> IncidentKey

incidentKey

-> Text

description

-> Event 

Your monitoring tools should send PagerDuty a trigger event to report a new or ongoing problem. When PagerDuty receives a trigger event, it will either open a new incident, or add a new trigger log entry to an existing incident, depending on the provided incident_key.

client :: Lens' Trigger (Maybe Text) Source

The name of the monitoring client that is triggering this event.

clientUrl :: Lens' Trigger (Maybe Text) Source

The URL of the monitoring client that is triggering this event.

Acknowledge

type Acknowledge = Generic Source

acknowledge Source

Arguments

:: ServiceKey

serviceKey

-> IncidentKey

incidentKey

-> Event 

Acknowledge events cause the referenced incident to enter the acknowledged state.

While an incident is acknowledged, it won't generate any additional notifications, even if it receives new trigger events. Your monitoring tools should send PagerDuty an acknowledge event when they know someone is presently working on the problem.

Resolve

type Resolve = Generic Source

resolve Source

Arguments

:: ServiceKey

serviceKey

-> IncidentKey

incidentKey

-> Event 

Resolve events cause the referenced incident to enter the resolved state.

Once an incident is resolved, it won't generate any additional notifications. New trigger events with the same incident_key as a resolved incident won't re-open the incident. Instead, a new incident will be created. Your monitoring tools should send PagerDuty a resolve event when the problem that caused the initial trigger event has been fixed.

Event fields

class HasServiceKey s a | s -> a where Source

Methods

serviceKey :: Lens' s a Source

The GUID of one of your "Generic API" services. This is the "service key" listed on a Generic API's service detail page.

class HasIncidentKey s a | s -> a where Source

Methods

incidentKey :: Lens' s a Source

Identifies the incident to which this trigger event should be applied. If there's no open (i.e. unresolved) incident with this key, a new one will be created. If there's already an open incident with a matching key, this event will be appended to that incident's log. The event key provides an easy way to "de-dup" problem reports. If this field isn't provided, PagerDuty will automatically open a new incident with a unique key.

class HasDescription s a | s -> a where Source

Methods

description :: Lens' s a Source

A short description of the problem that led to this trigger. This field (or a truncated version) will be used when generating phone calls, SMS messages and alert emails. It will also appear on the incidents tables in the PagerDuty UI. The maximum length is 1024 characters.

Instances

class HasDetails s a | s -> a where Source

Methods

details :: Lens' s a Source

An arbitrary JSON object containing any data you'd like included in the incident log.

Instances

Types

data Event Source

Constructors

Trigger Trigger

See: trigger

Acknowledge Generic

See: acknowledge

Resolve Generic

See: resolve

Instances

Eq Event 
Show Event 
ToJSON Event 
HasDetails Event (Maybe Object) 

_Acknowledge :: Prism' Event Generic Source

_Resolve :: Prism' Event Generic Source

data Response Source

Instances

Eq Response 
Show Response 
ToJSON Response 
FromJSON Response 

rsStatus :: Lens' Response Text Source

success.

rsMessage :: Lens' Response Text Source

Event processed.

rsIncidentKey :: Lens' Response IncidentKey Source

The key of the incident that will be affected by the request.