Safe Haskell | None |
---|---|
Language | Haskell2010 |
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
- data ListServices
- listServices :: Request ListServices s [Service]
- lsTimeZone :: Lens' (Request ListServices s r) (Maybe TimeZone)
- data CreateService
- createService :: Text -> EscalationPolicyId -> ServiceType -> Request CreateService s Service
- csName :: Lens' (Request CreateService s r) Text
- csDescription :: Lens' (Request CreateService s r) (Maybe Text)
- csType :: Lens' (Request CreateService s r) ServiceType
- csVendorId :: Lens' (Request CreateService s r) (Maybe VendorId)
- csEscalationPolicyId :: Lens' (Request CreateService s r) EscalationPolicyId
- csAcknowledgementTimeout :: Lens' (Request CreateService s r) (Maybe Int)
- csAutoResolveTimeout :: Lens' (Request CreateService s r) (Maybe Int)
- csSeverityFilter :: Lens' (Request CreateService s r) (Maybe SeverityFilter)
- getService :: ServiceId -> Request Empty s Service
- data UpdateService
- updateService :: ServiceId -> Request UpdateService s Service
- usName :: Lens' (Request UpdateService s r) (Maybe Text)
- usEscalationPolicyId :: Lens' (Request UpdateService s r) (Maybe EscalationPolicyId)
- usDescription :: Lens' (Request UpdateService s r) (Maybe Text)
- usAcknowledgementTimeout :: Lens' (Request UpdateService s r) (Maybe Int)
- usAutoResolveTimeout :: Lens' (Request UpdateService s r) (Maybe Int)
- usSeverityFilter :: Lens' (Request UpdateService s r) (Maybe SeverityFilter)
- deleteService :: ServiceId -> Request Empty s Empty
- enableService :: RequesterId -> ServiceId -> Request Empty s Empty
- disableService :: RequesterId -> ServiceId -> Request Empty s Empty
- regenerateKey :: ServiceId -> Request Empty s Service
- data EmailFilterMode
- data EmailIncidentCreation
- data ServiceStatus
- = Active
- | Warning
- | Critical
- | Maintenance
- | Disabled
- data ServiceType
- data SeverityFilter
- data IncidentCounts
- cntTriggered :: Lens' IncidentCounts Int
- cntAcknowledged :: Lens' IncidentCounts Int
- cntResolved :: Lens' IncidentCounts Int
- cntTotal :: Lens' IncidentCounts Int
- data PolicyInfo
- pinfoId :: Lens' PolicyInfo EscalationPolicyId
- pinfoName :: Lens' PolicyInfo Text
- data Service
- svcId :: Lens' Service ServiceId
- svcName :: Lens' Service Text
- svcDescription :: Lens' Service Text
- svcServiceUrl :: Lens' Service Text
- svcServiceKey :: Lens' Service ServiceKey
- svcAutoResolveTimeout :: Lens' Service (Maybe Int)
- svcAcknowledgementTimeout :: Lens' Service (Maybe Int)
- svcCreatedAt :: Lens' Service UTCTime
- svcStatus :: Lens' Service ServiceStatus
- svcLastIncidentTimestamp :: Lens' Service (Maybe UTCTime)
- svcEmailIncidentCreation :: Lens' Service (Maybe EmailIncidentCreation)
- svcIncidentCounts :: Lens' Service IncidentCounts
- svcEmailFilterMode :: Lens' Service EmailFilterMode
- svcType :: Lens' Service ServiceType
- svcEscalationPolicy :: Lens' Service (Maybe PolicyInfo)
- svcEmailFilters :: Lens' Service (Maybe [EmailFilterInfo])
- svcSeverityFilter :: Lens' Service (Maybe SeverityFilter)
List Services
data ListServices
Eq ListServices | |
Show ListServices | |
ToJSON ListServices | |
HasDatatypeInfo ListServices | |
Generic ListServices | |
QueryLike ListServices | |
Paginate ListServices | |
type Code ListServices |
listServices :: Request ListServices s [Service]
List existing services.
GET /services
See: http://developer.pagerduty.com/documentation/rest/services/list
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
data CreateService
Eq CreateService | |
Show CreateService | |
ToJSON CreateService | |
FromJSON CreateService | |
QueryLike CreateService |
createService :: Text -> EscalationPolicyId -> ServiceType -> Request CreateService s Service
Creates a new service.
POST /services
See: http://developer.pagerduty.com/documentation/rest/services/create
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
data UpdateService
Eq UpdateService | |
Show UpdateService | |
ToJSON UpdateService | |
FromJSON UpdateService | |
QueryLike UpdateService |
updateService :: ServiceId -> Request UpdateService s Service
Update an existing service.
PUT services/:id
See: http://developer.pagerduty.com/documentation/rest/services/update
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
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 |
Eq EmailFilterMode | |
Show EmailFilterMode | |
ToJSON EmailFilterMode | |
FromJSON EmailFilterMode |
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
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. |
Eq ServiceStatus | |
Show ServiceStatus | |
ToJSON ServiceStatus | |
FromJSON ServiceStatus |
data ServiceType
Eq ServiceType | |
Show ServiceType | |
ToJSON ServiceType | |
FromJSON ServiceType |
data SeverityFilter
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 |
Eq SeverityFilter | |
Show SeverityFilter | |
ToJSON SeverityFilter | |
FromJSON SeverityFilter |
data IncidentCounts
Eq IncidentCounts | |
Show IncidentCounts | |
ToJSON IncidentCounts | |
FromJSON IncidentCounts |
cntTriggered :: Lens' IncidentCounts Int
cntAcknowledged :: Lens' IncidentCounts Int
cntResolved :: Lens' IncidentCounts Int
cntTotal :: Lens' IncidentCounts Int
data PolicyInfo
Eq PolicyInfo | |
Show PolicyInfo | |
ToJSON PolicyInfo | |
FromJSON PolicyInfo |
pinfoId :: Lens' PolicyInfo EscalationPolicyId
pinfoName :: Lens' PolicyInfo Text
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.