ocm

package
v0.0.0-...-380b840 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 22, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

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 BuildAndSendServiceLog(slBuilder *ServiceLogBuilder, firing bool, alert *template.Alert, ocmClient OCMClient) error

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 ServiceLog = slv1.LogEntry

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)

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL