Documentation ¶
Overview ¶
Package pagerduty is a generated GoMock package.
Index ¶
- Constants
- func WithCustomHTTPClient(controllerName string) pdApi.ClientOptions
- type Client
- type Data
- type DelayFunc
- type MockClient
- func (m *MockClient) ApplyServiceOrchestrationRule(data *Data) error
- func (m *MockClient) CreateService(data *Data) (string, error)
- func (m *MockClient) DeleteService(data *Data) error
- func (m *MockClient) DisableService(data *Data) error
- func (m *MockClient) EXPECT() *MockClientMockRecorder
- func (m *MockClient) EnableService(data *Data) error
- func (m *MockClient) GetIntegrationKey(data *Data) (string, error)
- func (m *MockClient) GetService(data *Data) (*go_pagerduty.Service, error)
- func (m *MockClient) ToggleServiceOrchestration(data *Data, active bool) error
- func (m *MockClient) UpdateAlertGrouping(data *Data) error
- func (m *MockClient) UpdateEscalationPolicy(data *Data) error
- type MockClientMockRecorder
- func (mr *MockClientMockRecorder) ApplyServiceOrchestrationRule(data interface{}) *gomock.Call
- func (mr *MockClientMockRecorder) CreateService(data interface{}) *gomock.Call
- func (mr *MockClientMockRecorder) DeleteService(data interface{}) *gomock.Call
- func (mr *MockClientMockRecorder) DisableService(data interface{}) *gomock.Call
- func (mr *MockClientMockRecorder) EnableService(data interface{}) *gomock.Call
- func (mr *MockClientMockRecorder) GetIntegrationKey(data interface{}) *gomock.Call
- func (mr *MockClientMockRecorder) GetService(data interface{}) *gomock.Call
- func (mr *MockClientMockRecorder) ToggleServiceOrchestration(data, active interface{}) *gomock.Call
- func (mr *MockClientMockRecorder) UpdateAlertGrouping(data interface{}) *gomock.Call
- func (mr *MockClientMockRecorder) UpdateEscalationPolicy(data interface{}) *gomock.Call
- type MockPdClient
- func (m *MockPdClient) CreateIntegration(serviceID string, integration go_pagerduty.Integration) (*go_pagerduty.Integration, error)
- func (m *MockPdClient) CreateService(service go_pagerduty.Service) (*go_pagerduty.Service, error)
- func (m *MockPdClient) DeleteService(id string) error
- func (m *MockPdClient) EXPECT() *MockPdClientMockRecorder
- func (m *MockPdClient) GetEscalationPolicy(arg0 string, arg1 *go_pagerduty.GetEscalationPolicyOptions) (*go_pagerduty.EscalationPolicy, error)
- func (m *MockPdClient) GetIntegration(arg0, arg1 string, arg2 go_pagerduty.GetIntegrationOptions) (*go_pagerduty.Integration, error)
- func (m *MockPdClient) GetService(arg0 string, arg1 *go_pagerduty.GetServiceOptions) (*go_pagerduty.Service, error)
- func (m *MockPdClient) ListIncidentAlertsWithOpts(incidentId string, o go_pagerduty.ListIncidentAlertsOptions) (*go_pagerduty.ListAlertsResponse, error)
- func (m *MockPdClient) ListIncidents(arg0 go_pagerduty.ListIncidentsOptions) (*go_pagerduty.ListIncidentsResponse, error)
- func (m *MockPdClient) ListServices(arg0 go_pagerduty.ListServiceOptions) (*go_pagerduty.ListServiceResponse, error)
- func (m *MockPdClient) ManageEvent(e *go_pagerduty.V2Event) (*go_pagerduty.V2EventResponse, error)
- func (m *MockPdClient) UpdateService(service go_pagerduty.Service) (*go_pagerduty.Service, error)
- type MockPdClientMockRecorder
- func (mr *MockPdClientMockRecorder) CreateIntegration(serviceID, integration interface{}) *gomock.Call
- func (mr *MockPdClientMockRecorder) CreateService(service interface{}) *gomock.Call
- func (mr *MockPdClientMockRecorder) DeleteService(id interface{}) *gomock.Call
- func (mr *MockPdClientMockRecorder) GetEscalationPolicy(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockPdClientMockRecorder) GetIntegration(arg0, arg1, arg2 interface{}) *gomock.Call
- func (mr *MockPdClientMockRecorder) GetService(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockPdClientMockRecorder) ListIncidentAlertsWithOpts(incidentId, o interface{}) *gomock.Call
- func (mr *MockPdClientMockRecorder) ListIncidents(arg0 interface{}) *gomock.Call
- func (mr *MockPdClientMockRecorder) ListServices(arg0 interface{}) *gomock.Call
- func (mr *MockPdClientMockRecorder) ManageEvent(e interface{}) *gomock.Call
- func (mr *MockPdClientMockRecorder) UpdateService(service interface{}) *gomock.Call
- type PdClient
- type SvcClient
- func (c *SvcClient) ApplyServiceOrchestrationRule(data *Data) error
- func (c *SvcClient) CreateService(data *Data) (string, error)
- func (c *SvcClient) DeleteService(data *Data) error
- func (c *SvcClient) DisableService(data *Data) error
- func (c *SvcClient) EnableService(data *Data) error
- func (c *SvcClient) GetIntegrationKey(data *Data) (string, error)
- func (c *SvcClient) GetService(data *Data) (*pdApi.Service, error)
- func (c *SvcClient) ToggleServiceOrchestration(data *Data, active bool) error
- func (c *SvcClient) UpdateAlertGrouping(data *Data) error
- func (c *SvcClient) UpdateEscalationPolicy(data *Data) error
Constants ¶
const ( AlertResolvedSummaryDeleted string = "Cluster does not exist anymore" AlertResolvedSummaryLimitedSupport string = "The cluster has been placed in limited support" )
Variables ¶
This section is empty.
Functions ¶
func WithCustomHTTPClient ¶
func WithCustomHTTPClient(controllerName string) pdApi.ClientOptions
WithCustomHTTPClient allows to wrapper to monitor API response time
Types ¶
type Client ¶
type Client interface { GetService(data *Data) (*pdApi.Service, error) GetIntegrationKey(data *Data) (string, error) CreateService(data *Data) (string, error) DeleteService(data *Data) error EnableService(data *Data) error DisableService(data *Data) error UpdateEscalationPolicy(data *Data) error UpdateAlertGrouping(data *Data) error ToggleServiceOrchestration(data *Data, active bool) error ApplyServiceOrchestrationRule(data *Data) error }
Client is a wrapper interface for the SvcClient to allow for easier testing
type Data ¶
type Data struct { // These fields are parsed from the PagerDutyIntegration CR EscalationPolicyID string ResolveTimeout uint AcknowledgeTimeOut uint ServicePrefix string // ClusterID and BaseDomain are required during service creation for naming ClusterID string BaseDomain string // These fields are stored when the PagerDuty service is created and stored // in a Configmap in the ClusterDeployment's namespace // There is also an EscalationPolicyID field which is parsed fron the PDI CR ServiceID string IntegrationID string Hibernating bool LimitedSupport bool // ServiceOrchestration related parameters ServiceOrchestrationEnabled bool ServiceOrchestrationRuleApplied string // Alert grouping related parameters AlertGroupingType string `json:"alert_grouping_type,omitempty"` AlertGroupingTimeout uint `'json:"alert_grouping_timeout,omitempty"` }
Data describes the data that is needed for PagerDuty api calls
func NewData ¶
func NewData(pdi *pagerdutyv1alpha1.PagerDutyIntegration, clusterId string, baseDomain string) (*Data, error)
NewData initializes a Data struct from a v1alpha1 PagerDutyIntegration spec pdi.Spec.EscalationPolicy is required
func (*Data) ParseClusterConfig ¶
ParseClusterConfig parses the cluster specific config map and stores the IDs in the data struct SERVICE_ID and INTEGRATION_ID are required ConfigMap data fields HIBERNATING and LIMITED_SUPPORT are optional.
type MockClient ¶
type MockClient struct {
// contains filtered or unexported fields
}
MockClient is a mock of Client interface.
func NewMockClient ¶
func NewMockClient(ctrl *gomock.Controller) *MockClient
NewMockClient creates a new mock instance.
func (*MockClient) ApplyServiceOrchestrationRule ¶
func (m *MockClient) ApplyServiceOrchestrationRule(data *Data) error
ApplyServiceOrchestrationRule mocks base method.
func (*MockClient) CreateService ¶
func (m *MockClient) CreateService(data *Data) (string, error)
CreateService mocks base method.
func (*MockClient) DeleteService ¶
func (m *MockClient) DeleteService(data *Data) error
DeleteService mocks base method.
func (*MockClient) DisableService ¶
func (m *MockClient) DisableService(data *Data) error
DisableService mocks base method.
func (*MockClient) EXPECT ¶
func (m *MockClient) EXPECT() *MockClientMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockClient) EnableService ¶
func (m *MockClient) EnableService(data *Data) error
EnableService mocks base method.
func (*MockClient) GetIntegrationKey ¶
func (m *MockClient) GetIntegrationKey(data *Data) (string, error)
GetIntegrationKey mocks base method.
func (*MockClient) GetService ¶
func (m *MockClient) GetService(data *Data) (*go_pagerduty.Service, error)
GetService mocks base method.
func (*MockClient) ToggleServiceOrchestration ¶
func (m *MockClient) ToggleServiceOrchestration(data *Data, active bool) error
ToggleServiceOrchestration mocks base method.
func (*MockClient) UpdateAlertGrouping ¶
func (m *MockClient) UpdateAlertGrouping(data *Data) error
UpdateAlertGrouping mocks base method.
func (*MockClient) UpdateEscalationPolicy ¶
func (m *MockClient) UpdateEscalationPolicy(data *Data) error
UpdateEscalationPolicy mocks base method.
type MockClientMockRecorder ¶
type MockClientMockRecorder struct {
// contains filtered or unexported fields
}
MockClientMockRecorder is the mock recorder for MockClient.
func (*MockClientMockRecorder) ApplyServiceOrchestrationRule ¶
func (mr *MockClientMockRecorder) ApplyServiceOrchestrationRule(data interface{}) *gomock.Call
ApplyServiceOrchestrationRule indicates an expected call of ApplyServiceOrchestrationRule.
func (*MockClientMockRecorder) CreateService ¶
func (mr *MockClientMockRecorder) CreateService(data interface{}) *gomock.Call
CreateService indicates an expected call of CreateService.
func (*MockClientMockRecorder) DeleteService ¶
func (mr *MockClientMockRecorder) DeleteService(data interface{}) *gomock.Call
DeleteService indicates an expected call of DeleteService.
func (*MockClientMockRecorder) DisableService ¶
func (mr *MockClientMockRecorder) DisableService(data interface{}) *gomock.Call
DisableService indicates an expected call of DisableService.
func (*MockClientMockRecorder) EnableService ¶
func (mr *MockClientMockRecorder) EnableService(data interface{}) *gomock.Call
EnableService indicates an expected call of EnableService.
func (*MockClientMockRecorder) GetIntegrationKey ¶
func (mr *MockClientMockRecorder) GetIntegrationKey(data interface{}) *gomock.Call
GetIntegrationKey indicates an expected call of GetIntegrationKey.
func (*MockClientMockRecorder) GetService ¶
func (mr *MockClientMockRecorder) GetService(data interface{}) *gomock.Call
GetService indicates an expected call of GetService.
func (*MockClientMockRecorder) ToggleServiceOrchestration ¶
func (mr *MockClientMockRecorder) ToggleServiceOrchestration(data, active interface{}) *gomock.Call
ToggleServiceOrchestration indicates an expected call of ToggleServiceOrchestration.
func (*MockClientMockRecorder) UpdateAlertGrouping ¶
func (mr *MockClientMockRecorder) UpdateAlertGrouping(data interface{}) *gomock.Call
UpdateAlertGrouping indicates an expected call of UpdateAlertGrouping.
func (*MockClientMockRecorder) UpdateEscalationPolicy ¶
func (mr *MockClientMockRecorder) UpdateEscalationPolicy(data interface{}) *gomock.Call
UpdateEscalationPolicy indicates an expected call of UpdateEscalationPolicy.
type MockPdClient ¶
type MockPdClient struct {
// contains filtered or unexported fields
}
MockPdClient is a mock of PdClient interface.
func NewMockPdClient ¶
func NewMockPdClient(ctrl *gomock.Controller) *MockPdClient
NewMockPdClient creates a new mock instance.
func (*MockPdClient) CreateIntegration ¶
func (m *MockPdClient) CreateIntegration(serviceID string, integration go_pagerduty.Integration) (*go_pagerduty.Integration, error)
CreateIntegration mocks base method.
func (*MockPdClient) CreateService ¶
func (m *MockPdClient) CreateService(service go_pagerduty.Service) (*go_pagerduty.Service, error)
CreateService mocks base method.
func (*MockPdClient) DeleteService ¶
func (m *MockPdClient) DeleteService(id string) error
DeleteService mocks base method.
func (*MockPdClient) EXPECT ¶
func (m *MockPdClient) EXPECT() *MockPdClientMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockPdClient) GetEscalationPolicy ¶
func (m *MockPdClient) GetEscalationPolicy(arg0 string, arg1 *go_pagerduty.GetEscalationPolicyOptions) (*go_pagerduty.EscalationPolicy, error)
GetEscalationPolicy mocks base method.
func (*MockPdClient) GetIntegration ¶
func (m *MockPdClient) GetIntegration(arg0, arg1 string, arg2 go_pagerduty.GetIntegrationOptions) (*go_pagerduty.Integration, error)
GetIntegration mocks base method.
func (*MockPdClient) GetService ¶
func (m *MockPdClient) GetService(arg0 string, arg1 *go_pagerduty.GetServiceOptions) (*go_pagerduty.Service, error)
GetService mocks base method.
func (*MockPdClient) ListIncidentAlertsWithOpts ¶
func (m *MockPdClient) ListIncidentAlertsWithOpts(incidentId string, o go_pagerduty.ListIncidentAlertsOptions) (*go_pagerduty.ListAlertsResponse, error)
ListIncidentAlertsWithOpts mocks base method.
func (*MockPdClient) ListIncidents ¶
func (m *MockPdClient) ListIncidents(arg0 go_pagerduty.ListIncidentsOptions) (*go_pagerduty.ListIncidentsResponse, error)
ListIncidents mocks base method.
func (*MockPdClient) ListServices ¶
func (m *MockPdClient) ListServices(arg0 go_pagerduty.ListServiceOptions) (*go_pagerduty.ListServiceResponse, error)
ListServices mocks base method.
func (*MockPdClient) ManageEvent ¶
func (m *MockPdClient) ManageEvent(e *go_pagerduty.V2Event) (*go_pagerduty.V2EventResponse, error)
ManageEvent mocks base method.
func (*MockPdClient) UpdateService ¶
func (m *MockPdClient) UpdateService(service go_pagerduty.Service) (*go_pagerduty.Service, error)
UpdateService mocks base method.
type MockPdClientMockRecorder ¶
type MockPdClientMockRecorder struct {
// contains filtered or unexported fields
}
MockPdClientMockRecorder is the mock recorder for MockPdClient.
func (*MockPdClientMockRecorder) CreateIntegration ¶
func (mr *MockPdClientMockRecorder) CreateIntegration(serviceID, integration interface{}) *gomock.Call
CreateIntegration indicates an expected call of CreateIntegration.
func (*MockPdClientMockRecorder) CreateService ¶
func (mr *MockPdClientMockRecorder) CreateService(service interface{}) *gomock.Call
CreateService indicates an expected call of CreateService.
func (*MockPdClientMockRecorder) DeleteService ¶
func (mr *MockPdClientMockRecorder) DeleteService(id interface{}) *gomock.Call
DeleteService indicates an expected call of DeleteService.
func (*MockPdClientMockRecorder) GetEscalationPolicy ¶
func (mr *MockPdClientMockRecorder) GetEscalationPolicy(arg0, arg1 interface{}) *gomock.Call
GetEscalationPolicy indicates an expected call of GetEscalationPolicy.
func (*MockPdClientMockRecorder) GetIntegration ¶
func (mr *MockPdClientMockRecorder) GetIntegration(arg0, arg1, arg2 interface{}) *gomock.Call
GetIntegration indicates an expected call of GetIntegration.
func (*MockPdClientMockRecorder) GetService ¶
func (mr *MockPdClientMockRecorder) GetService(arg0, arg1 interface{}) *gomock.Call
GetService indicates an expected call of GetService.
func (*MockPdClientMockRecorder) ListIncidentAlertsWithOpts ¶
func (mr *MockPdClientMockRecorder) ListIncidentAlertsWithOpts(incidentId, o interface{}) *gomock.Call
ListIncidentAlertsWithOpts indicates an expected call of ListIncidentAlertsWithOpts.
func (*MockPdClientMockRecorder) ListIncidents ¶
func (mr *MockPdClientMockRecorder) ListIncidents(arg0 interface{}) *gomock.Call
ListIncidents indicates an expected call of ListIncidents.
func (*MockPdClientMockRecorder) ListServices ¶
func (mr *MockPdClientMockRecorder) ListServices(arg0 interface{}) *gomock.Call
ListServices indicates an expected call of ListServices.
func (*MockPdClientMockRecorder) ManageEvent ¶
func (mr *MockPdClientMockRecorder) ManageEvent(e interface{}) *gomock.Call
ManageEvent indicates an expected call of ManageEvent.
func (*MockPdClientMockRecorder) UpdateService ¶
func (mr *MockPdClientMockRecorder) UpdateService(service interface{}) *gomock.Call
UpdateService indicates an expected call of UpdateService.
type PdClient ¶
type PdClient interface { GetService(string, *pdApi.GetServiceOptions) (*pdApi.Service, error) GetEscalationPolicy(string, *pdApi.GetEscalationPolicyOptions) (*pdApi.EscalationPolicy, error) GetIntegration(string, string, pdApi.GetIntegrationOptions) (*pdApi.Integration, error) CreateService(service pdApi.Service) (*pdApi.Service, error) DeleteService(id string) error CreateIntegration(serviceID string, integration pdApi.Integration) (*pdApi.Integration, error) ListServices(pdApi.ListServiceOptions) (*pdApi.ListServiceResponse, error) ListIncidents(pdApi.ListIncidentsOptions) (*pdApi.ListIncidentsResponse, error) ListIncidentAlertsWithOpts(incidentId string, o pdApi.ListIncidentAlertsOptions) (*pdApi.ListAlertsResponse, error) ManageEvent(e *pdApi.V2Event) (*pdApi.V2EventResponse, error) UpdateService(service pdApi.Service) (*pdApi.Service, error) }
type SvcClient ¶
SvcClient wraps pdApi.Client
func (*SvcClient) ApplyServiceOrchestrationRule ¶
ApplyServiceOrchestrationRule applies the pre-defined orchestration rule to the service after enabled
func (*SvcClient) CreateService ¶
CreateService creates a service in pagerduty for the specified clusterid and returns the service key
func (*SvcClient) DeleteService ¶
DeleteService will get a service from the PD api and delete it
func (*SvcClient) DisableService ¶
DisableService will set the PD service disabled
func (*SvcClient) EnableService ¶
EnableService will set the PD service active
func (*SvcClient) GetIntegrationKey ¶
GetIntegrationKey searches the PD API for an already existing service and returns the first integration key
func (*SvcClient) GetService ¶
GetService searches the PD API for an already existing service
func (*SvcClient) ToggleServiceOrchestration ¶
ToggleServiceOrchestration enables/disables the service orchestration for a given PD service
func (*SvcClient) UpdateAlertGrouping ¶
UpdateAlertGrouping will update the PD service alert grouping
func (*SvcClient) UpdateEscalationPolicy ¶
UpdateEscalationPolicy will update the PD service escalation policy