Documentation ¶
Overview ¶
Package pager provides PagerDuty incident triggers.
Global usage:
pager.ServiceKey = "3961B1F4AD08424C9DA704DEBCBBF8F3" incidentKey, err := pager.Trigger("Everything is on fire.")
Individual services:
opsPager := pager.New("09D0A4B9B3F54047BCD7B65704A58333") incidentKey, err = opsPager.Trigger("Server out of memory.")
Including extra details:
pager.TriggerWithDetails("Oh no", map[string]interface{}{ "cause": "it's a mystery", "responsible": "not me!", })
Index ¶
- Variables
- func ResolveIncidentKey(incidentKey string) error
- func Trigger(description string) (incidentKey string, err error)
- func TriggerIncidentKey(description string, key string) (incidentKey string, err error)
- func TriggerIncidentKeyWithDetails(description string, key string, details map[string]interface{}) (incidentKey string, err error)
- func TriggerWithDetails(description string, details map[string]interface{}) (incidentKey string, err error)
- type Pager
- func (p *Pager) ResolveIncidentKey(incidentKey string) error
- func (p *Pager) Trigger(description string) (incidentKey string, err error)
- func (p *Pager) TriggerIncidentKey(description string, key string) (incidentKey string, err error)
- func (p *Pager) TriggerIncidentKeyWithDetails(description string, key string, details map[string]interface{}) (incidentKey string, err error)
- func (p *Pager) TriggerWithDetails(description string, details map[string]interface{}) (incidentKey string, err error)
Constants ¶
This section is empty.
Variables ¶
var ServiceKey = ""
ServiceKey is the integration key used for the global pager client. This comes from the "integration key" that is generated when you create a generic API integration in PagerDuty.
Functions ¶
func ResolveIncidentKey ¶
ResolveIncidentKey resolves a triggered PagerDuty incident using the default client.
func Trigger ¶
Trigger creates a new PagerDuty incident using the default client with the given description. The returned incident key can be used to resolve the incident. It can also be used by the "TriggerIncidentKey*" functions to trigger an incident only if that specific incident has been resolved.
func TriggerIncidentKey ¶
TriggerIncidentKey triggers an incident using the default client with a given incident key only if that incident has been resolved or if that incident doesn't exist yet.
func TriggerIncidentKeyWithDetails ¶
func TriggerIncidentKeyWithDetails(description string, key string, details map[string]interface{}) (incidentKey string, err error)
TriggerIncidentKeyWithDetails triggers an incident using the default client with a given incident key only if that incident has been resolved or if that incident doesn't exist yet.
Types ¶
type Pager ¶
type Pager struct {
ServiceKey string
}
Pager is a PagerDuty client configured to trigger and resolve pager alerts for a service.
func (*Pager) ResolveIncidentKey ¶
ResolveIncidentKey resolves a triggered PagerDuty incident.
func (*Pager) Trigger ¶
Trigger creates a new PagerDuty incident with the given description. The returned incident key can be used to resolve the incident. It can also be used by the "TriggerIncidentKey*" functions to trigger an incident only if that specific incident has been resolved.
func (*Pager) TriggerIncidentKey ¶
TriggerIncidentKey triggers an incident with a given incident key only if that incident has been resolved or if that incident doesn't exist yet.
func (*Pager) TriggerIncidentKeyWithDetails ¶
func (p *Pager) TriggerIncidentKeyWithDetails(description string, key string, details map[string]interface{}) (incidentKey string, err error)
TriggerIncidentKeyWithDetails triggers an incident with a given incident key only if that incident has been resolved or if that incident doesn't exist yet.