Documentation ¶
Index ¶
Constants ¶
View Source
const ( OcmOperationIdHeader = "X-Operation-Id" ServiceLogActivePrefix = "Issue Notification" ServiceLogResolvePrefix = "Issue Resolution" )
Variables ¶
This section is empty.
Functions ¶
func BuildAndSendServiceLog ¶
func GetInternalIDByExternalID ¶
func GetInternalIDByExternalID(externalID string, ocm *sdk.Connection) (string, error)
Adapted from https://github.com/gdbranco/rosa/blob/9c5d9a00eef233a7989aca5ddca6762dc0f4d01d/pkg/ocm/clusters.go#L371
Types ¶
type ConnectionBuilder ¶
type ConnectionBuilder struct {
// contains filtered or unexported fields
}
ConnectionBuilder contains the information and logic needed to build a connection to OCM. Don't create instances of this type directly; use the NewConnection function instead.
func NewConnection ¶
func NewConnection() *ConnectionBuilder
NewConnection creates a builder that can then be used to configure and build an OCM connection. Don't create instances of this type directly; use the NewConnection function instead.
func (*ConnectionBuilder) Build ¶
func (b *ConnectionBuilder) Build(baseUrl string, clusterId string, accessToken string) (result *sdk.Connection, err error)
Build uses the information stored in the builder to create a new OCM connection.
func (*ConnectionBuilder) Logger ¶
func (b *ConnectionBuilder) Logger(logger *sdk.Logger) *ConnectionBuilder
func (*ConnectionBuilder) TransportWrapper ¶
func (b *ConnectionBuilder) TransportWrapper(wrapper sdk.TransportWrapper) *ConnectionBuilder
type OCMClient ¶
type OCMClient interface { SendServiceLog(logEntry *slv1.LogEntry) error SendLimitedSupport(clusterUUID string, lsReason *cmv1.LimitedSupportReason) error RemoveLimitedSupport(clusterUUID string, lsReasonID string) error GetLimitedSupportReasons(clusterUUID string) ([]*cmv1.LimitedSupportReason, error) GetCluster(clusterID string) (*cmv1.Cluster, string, error) GetUpgradePolicyState(clusterID string, upgradePolicyID string) (*cmv1.UpgradePolicyState, string, error) GetUpgradePolicy(clusterID string, upgradePolicyID string) (*cmv1.UpgradePolicy, string, error) GetUpgradePolicies(clusterID string) ([]*cmv1.UpgradePolicy, string, error) UpdateUpgradePolicyState(clusterID string, upgradePolicyID string, policyState *cmv1.UpgradePolicyState) (*cmv1.UpgradePolicyState, string, error) }
func NewOcmClient ¶
func NewOcmClient(ocmConnection *sdk.Connection) OCMClient
type ServiceLog ¶
type ServiceLogBuilder ¶
type ServiceLogBuilder struct {
// contains filtered or unexported fields
}
func NewServiceLogBuilder ¶
func NewServiceLogBuilder(summary, firingDesc, resolveDesc, clusterUUID string, severity v1alpha1.NotificationSeverity, logType string, references []v1alpha1.NotificationReferenceType) *ServiceLogBuilder
func (*ServiceLogBuilder) Build ¶
func (b *ServiceLogBuilder) Build(firing bool, alert *template.Alert) (*ServiceLog, error)
Click to show internal directories.
Click to hide internal directories.