Documentation
¶
Index ¶
- Constants
- type Alert
- type DefaultPagerDutyClientImpl
- func (c *DefaultPagerDutyClientImpl) Connect(authToken string, options ...pdApi.ClientOptions) error
- func (c *DefaultPagerDutyClientImpl) GetServiceWithContext(ctx context.Context, serviceID string, opts *pdApi.GetServiceOptions) (*pdApi.Service, error)
- func (c *DefaultPagerDutyClientImpl) ListIncidentAlerts(incidentID string) (*pdApi.ListAlertsResponse, error)
- func (c *DefaultPagerDutyClientImpl) ListIncidents(opts pdApi.ListIncidentsOptions) (*pdApi.ListIncidentsResponse, error)
- type PagerDuty
- type PagerDutyClient
Constants ¶
const ( // PagerDuty Incident Statuses StatusTriggered = "triggered" StatusAcknowledged = "acknowledged" StatusHigh = "high" StatusLow = "low" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Alert ¶
type Alert struct {
ID string
Name string
IncidentID string
Severity string
Status string
CreatedAt time.Time
WebURL string
ClusterID string
ClusterName string
}
Alert struct represents the data contained in an alert.
type DefaultPagerDutyClientImpl ¶ added in v0.1.32
type DefaultPagerDutyClientImpl struct {
// contains filtered or unexported fields
}
func NewClient ¶ added in v0.1.32
func NewClient() *DefaultPagerDutyClientImpl
NewClient creates an instance of PDClient that is then used to connect to the actual pagerduty client.
func (*DefaultPagerDutyClientImpl) Connect ¶ added in v0.1.32
func (c *DefaultPagerDutyClientImpl) Connect(authToken string, options ...pdApi.ClientOptions) error
Connect uses the information stored in new client to create a new PagerDuty connection. It returns the PDClient object with pagerduty API connection initialized.
func (*DefaultPagerDutyClientImpl) GetServiceWithContext ¶ added in v0.1.32
func (c *DefaultPagerDutyClientImpl) GetServiceWithContext(ctx context.Context, serviceID string, opts *pdApi.GetServiceOptions) (*pdApi.Service, error)
func (*DefaultPagerDutyClientImpl) ListIncidentAlerts ¶ added in v0.1.32
func (c *DefaultPagerDutyClientImpl) ListIncidentAlerts(incidentID string) (*pdApi.ListAlertsResponse, error)
func (*DefaultPagerDutyClientImpl) ListIncidents ¶ added in v0.1.32
func (c *DefaultPagerDutyClientImpl) ListIncidents(opts pdApi.ListIncidentsOptions) (*pdApi.ListIncidentsResponse, error)
type PagerDuty ¶ added in v0.1.32
type PagerDuty struct {
// contains filtered or unexported fields
}
func NewPagerDuty ¶ added in v0.1.32
func NewPagerDuty(client PagerDutyClient) *PagerDuty
func NewWithToken ¶
func NewWithToken(authToken string, options ...pdApi.ClientOptions) (*PagerDuty, error)
NewWithToken initializes a new PDClient. The token can be created using the docs https://support.pagerduty.com/docs/api-access-keys#section-generate-a-user-token-rest-api-key.
func (*PagerDuty) GetClusterIDFromIncident ¶ added in v0.1.32
GetClusterIDFromIncident retrieves the cluster ID associated with the given incident ID.
func (*PagerDuty) GetClusterName ¶ added in v0.1.32
GetClusterName interacts with the PD service endpoint and returns the cluster name string.
type PagerDutyClient ¶
type PagerDutyClient interface {
Connect(authToken string, options ...pdApi.ClientOptions) error
ListIncidents(pdApi.ListIncidentsOptions) (*pdApi.ListIncidentsResponse, error)
ListIncidentAlerts(incidentID string) (*pdApi.ListAlertsResponse, error)
GetServiceWithContext(ctx context.Context, serviceID string, opts *pdApi.GetServiceOptions) (*pdApi.Service, error)
}
PagerDutyClient is an interface for the actual PD API