pagerduty-0.0.7: 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.

Trigger

trigger Source

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

acknowledge Source

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

resolve Source

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.

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.

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.

Types

rsMessage :: Lens' Response Text Source

Event processed.

rsIncidentKey :: Lens' Response IncidentKey Source

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

Configuration

Environment

data Env s Source

The environment containing the parameters required to make PagerDuty requests.

Instances

Monad m => MonadReader (Env s) (PagerDutyT s m) 

envAuth :: forall s s'. Lens (Env s) (Env s') (Auth s) (Auth s') Source

envManager :: forall s. Lens' (Env s) Manager Source

envLogger :: forall s. Lens' (Env s) Logger Source

Logging

data Logger Source

The log level and associated logger function.

Constructors

None 
Debug (Text -> IO ()) 

debug :: MonadIO m => Logger -> Text -> m () Source

Log a message using the debug logger, or if none is specified noop.

Types

Requests

Errors

Messages

class HasMessage s a | s -> a where Source

Methods

message :: Lens' s a Source

A short human-readable message describing the error.

Fields

class HasErrors s a | s -> a where Source

Methods

errors :: Lens' s a Source

A list of human-readable reasons for the error. These values, and even their format, are subject to change.

Integration

REST

code :: Lens' RESTError Code Source

In the case of an error, the PagerDuty error code can give further details on the nature of the error.

See: description

Authentication

data Security Source

Constructors

Basic 
Token 

data Auth a where Source

Instances

Keys

Aliases

type ServiceKey = Key "service" Source

type IncidentKey = Key "incident" Source

Identifiers

mkId :: Text -> Id a Source

Aliases

type AlertId = Id "alert" Source

type ContactId = Id "contact" Source

type EmailFilterId = Id "email-filter" Source

type EscalationPolicyId = Id "escalation-policy" Source

type EscalationRuleId = Id "escalation-rule" Source

type IncidentId = Id "incident" Source

type LogEntryId = Id "log-entry" Source

type NoteId = Id "note" Source

type NotificationRuleId = Id "notification-rule" Source

type OverrideId = Id "schedule-override" Source

type RequesterId = Id "requester" Source

type ScheduleId = Id "schedule" Source

type ServiceId = Id "service" Source

type UserId = Id "user" Source

type VendorId = Id "vendor" Source

type WebhookId = Id "webhook" Source

type WindowId = Id "maintenance-window" Source

SubDomain

Address

Miscellaneous