Documentation ¶
Index ¶
- Constants
- func LogEntryInternalOnly(c *LogEntryConfig)
- type Addon
- type AddonConfig
- type AddonInstallation
- type AddonInstallationRowObject
- type AddonInstallations
- type AddonOption
- type AddonPager
- func (p *AddonPager) FindByIDs(ids ...string) *AddonPager
- func (p *AddonPager) ForEach(ctx context.Context, applyFunc func(*Addon) error) error
- func (p *AddonPager) NextPage(ctx context.Context) ([]Addon, bool, error)
- func (p *AddonPager) Search(query string) *AddonPager
- func (p *AddonPager) SearchByNameOrID(pattern string) *AddonPager
- type AddonParameter
- type AddonRequirement
- type AddonSubOperator
- type AddonVersion
- type Cluster
- func (c *Cluster) ExternalID() string
- func (c *Cluster) GetLogs(ctx context.Context, opts GetLogsOptions) ([]LogEntry, error)
- func (c *Cluster) ID() string
- func (c *Cluster) Name() string
- func (c *Cluster) PostLog(ctx context.Context, opts ...LogEntryOption) error
- func (c *Cluster) ProductID() string
- func (c *Cluster) ProvideRowData() map[string]interface{}
- func (c *Cluster) WithAddonInstallations(ctx context.Context) (*Cluster, error)
- func (c *Cluster) WithSubscription(ctx context.Context) (*Cluster, error)
- type ClusterConfig
- type ClusterOption
- type ClusterPager
- type GetLogsOption
- type GetLogsOptions
- type LogEntry
- type LogEntryConfig
- type LogEntryOption
- type LogEntrySortFunc
- type LogEntrySorter
- type LogLevel
- type Order
- type Subscription
- type WithConnection
- type WithLogger
Constants ¶
const ( LogLevelNone = "" LogLevelDebug = "Debug" LogLevelInfo = "Info" LogLevelWarning = "Warning" LogLevelError = "Error" LogLevelFatal = "Fatal" )
const ( OrderNone = "" OrderAsc = "ascending" OrderDesc = "descending" )
Variables ¶
This section is empty.
Functions ¶
func LogEntryInternalOnly ¶ added in v0.2.0
func LogEntryInternalOnly(c *LogEntryConfig)
Types ¶
type Addon ¶
type Addon struct {
// contains filtered or unexported fields
}
Addon wraps an 'ocm-sdk-go' AddOn object.
func (*Addon) ProvideRowData ¶ added in v0.2.2
type AddonConfig ¶ added in v0.2.2
type AddonConfig struct { Conn *sdk.Connection Logger log.Interface }
func (*AddonConfig) Default ¶ added in v0.2.2
func (c *AddonConfig) Default()
func (*AddonConfig) Option ¶ added in v0.2.2
func (c *AddonConfig) Option(opts ...AddonOption)
type AddonInstallation ¶
type AddonInstallation struct { *cmv1.AddOnInstallation // contains filtered or unexported fields }
AddonInstallation provides details of an AddonInstallation.
func (*AddonInstallation) ProvideRowData ¶ added in v0.2.2
func (a *AddonInstallation) ProvideRowData() map[string]interface{}
type AddonInstallations ¶
type AddonInstallations []AddonInstallation
AddonInstallations wraps a slice of AddonInstallation objects.
func (AddonInstallations) Matching ¶
func (installations AddonInstallations) Matching(pattern string) AddonInstallations
Matching filters the addons within an AddonInstallations object by only including addons whose name or id matches the supplied pattern.
type AddonOption ¶ added in v0.2.2
type AddonOption interface {
ConfigureAddon(*AddonConfig)
}
type AddonPager ¶
type AddonPager struct {
// contains filtered or unexported fields
}
AddonPager retains state for paged addon requests and maintains a buffer of the last page of objects.
func RetrieveAddons ¶
func RetrieveAddons(conn *sdk.Connection, logger log.Interface) (*AddonPager, error)
RetrieveAddons initializes a Pager which will request addons from OCM with a fixed page size.
func (*AddonPager) FindByIDs ¶
func (p *AddonPager) FindByIDs(ids ...string) *AddonPager
FindByIDs uses the supplied addon IDs to filter the request to OCM and return only the addons which match.
func (*AddonPager) ForEach ¶
ForEach iterates over the addons requested by an Pager applying the provided function. If the iteration will stop with the first error returned by the provided function.
func (*AddonPager) NextPage ¶
NextPage returns the next page of requested addons if there are any remaining. If no addons remain the second return value will be 'false'.
func (*AddonPager) Search ¶
func (p *AddonPager) Search(query string) *AddonPager
Search filters the addons requested by a generic query string. See 'ocm-sdk-go' for more information on the SQL-like strings that are accepted.
func (*AddonPager) SearchByNameOrID ¶
func (p *AddonPager) SearchByNameOrID(pattern string) *AddonPager
SearchByNameOrID filters the addons requested by a Pager for those whose 'name' or 'id' matches the supplied pattern.
type AddonParameter ¶ added in v0.2.2
type AddonParameter struct {
// contains filtered or unexported fields
}
func (*AddonParameter) ProvideRowData ¶ added in v0.2.2
func (ap *AddonParameter) ProvideRowData() map[string]interface{}
type AddonRequirement ¶ added in v0.2.2
type AddonRequirement struct {
// contains filtered or unexported fields
}
func (*AddonRequirement) ProvideRowData ¶ added in v0.2.2
func (ar *AddonRequirement) ProvideRowData() map[string]interface{}
type AddonSubOperator ¶ added in v0.2.2
type AddonSubOperator struct {
// contains filtered or unexported fields
}
func (*AddonSubOperator) ProvideRowData ¶ added in v0.2.2
func (aso *AddonSubOperator) ProvideRowData() map[string]interface{}
type AddonVersion ¶ added in v0.2.2
type AddonVersion struct {
// contains filtered or unexported fields
}
func (*AddonVersion) ProvideRowData ¶ added in v0.2.2
func (v *AddonVersion) ProvideRowData() map[string]interface{}
type Cluster ¶
type Cluster struct { AddonInstallations AddonInstallations // contains filtered or unexported fields }
Cluster wraps for 'ocm-sdk-go' Cluster objects.
func NewCluster ¶ added in v0.2.2
func NewCluster(cluster *cmv1.Cluster, opts ...ClusterOption) Cluster
func (*Cluster) ExternalID ¶ added in v0.2.2
func (*Cluster) PostLog ¶ added in v0.2.0
func (c *Cluster) PostLog(ctx context.Context, opts ...LogEntryOption) error
func (*Cluster) ProductID ¶
ProductID returns a string indicating the product type (OSD, ROSA, ARO, ...) and whether the cluster is of the Customer Cloud Subscription (CSS) Model.
func (*Cluster) ProvideRowData ¶ added in v0.2.2
func (*Cluster) WithAddonInstallations ¶
WithAddonInstallations attempts to retrieve and abstract information about installed addons on the cluster. Any failure to retrieve data will return an error.
type ClusterConfig ¶ added in v0.2.2
type ClusterConfig struct { Conn *sdk.Connection Logger log.Interface }
func (*ClusterConfig) Default ¶ added in v0.2.2
func (c *ClusterConfig) Default()
func (*ClusterConfig) Option ¶ added in v0.2.2
func (c *ClusterConfig) Option(opts ...ClusterOption)
type ClusterOption ¶ added in v0.2.2
type ClusterOption interface {
ConfigureCluster(*ClusterConfig)
}
type ClusterPager ¶
type ClusterPager struct {
// contains filtered or unexported fields
}
ClusterPager retains state for paged cluster requests and maintains a buffer of the last page of objects.
func RetrieveClusters ¶
func RetrieveClusters(conn *sdk.Connection, logger log.Interface) (*ClusterPager, error)
RetrieveClusters initializes a ClusterPager which will request clusters from OCM with a fixed page size.
func (*ClusterPager) ForEach ¶
ForEach iterates over the clusters requested by an ClusterPager applying the provided function. If the iteration will stop with the first error returned by the provided function.
func (*ClusterPager) NextPage ¶
NextPage returns the next page of requested clusters if there are any remaining. If no clusters remain the second return value will be 'false'.
func (*ClusterPager) Search ¶
func (p *ClusterPager) Search(query string) *ClusterPager
Search filters the clusters requested by a generic query string. See 'ocm-sdk-go' for more information on the SQL-like strings that are accepted.
func (*ClusterPager) SearchByNameOrID ¶
func (p *ClusterPager) SearchByNameOrID(pattern string) *ClusterPager
SearchByNameOrID filters the clusters requested by an ClusterPager for those whose 'name', 'id', or 'external_id' matches the supplied pattern.
type GetLogsOption ¶
type GetLogsOption func(*GetLogsOptions)
func GetLogsAfter ¶
func GetLogsAfter(t time.Time) GetLogsOption
func GetLogsBefore ¶
func GetLogsBefore(t time.Time) GetLogsOption
func GetLogsMatchingPattern ¶
func GetLogsMatchingPattern(p string) GetLogsOption
func GetLogsSorted ¶
func GetLogsSorted(s LogEntrySortFunc) GetLogsOption
func GetLogsWithLevel ¶
func GetLogsWithLevel(l LogLevel) GetLogsOption
type GetLogsOptions ¶
type GetLogsOptions struct {
// contains filtered or unexported fields
}
func NewGetLogsOptions ¶
func NewGetLogsOptions(opts ...GetLogsOption) GetLogsOptions
func (GetLogsOptions) Query ¶
func (g GetLogsOptions) Query() string
type LogEntry ¶
func NewLogEntry ¶ added in v0.2.0
func NewLogEntry(cluster *Cluster, opts ...LogEntryOption) (LogEntry, error)
func (*LogEntry) ProvideRowData ¶ added in v0.2.2
type LogEntryConfig ¶ added in v0.2.0
type LogEntryOption ¶ added in v0.2.0
type LogEntryOption func(*LogEntryConfig)
func LogEntryDescription ¶ added in v0.2.0
func LogEntryDescription(desc string) LogEntryOption
func LogEntryServiceName ¶ added in v0.2.0
func LogEntryServiceName(name string) LogEntryOption
func LogEntrySeverity ¶ added in v0.2.0
func LogEntrySeverity(sev string) LogEntryOption
func LogEntrySummary ¶ added in v0.2.0
func LogEntrySummary(sum string) LogEntryOption
type LogEntrySortFunc ¶
func LogEntryByTime ¶
func LogEntryByTime(ord Order) LogEntrySortFunc
type LogEntrySorter ¶
type LogEntrySorter struct {
// contains filtered or unexported fields
}
func NewLogEntrySorter ¶
func NewLogEntrySorter(size int, sortFunc LogEntrySortFunc) *LogEntrySorter
func (*LogEntrySorter) Append ¶
func (s *LogEntrySorter) Append(e LogEntry)
func (*LogEntrySorter) Entries ¶
func (s *LogEntrySorter) Entries() []LogEntry
func (*LogEntrySorter) Len ¶
func (s *LogEntrySorter) Len() int
func (*LogEntrySorter) Less ¶
func (s *LogEntrySorter) Less(i, j int) bool
func (*LogEntrySorter) Swap ¶
func (s *LogEntrySorter) Swap(i, j int)
type Subscription ¶
type Subscription struct {
// contains filtered or unexported fields
}
Subscription wraps an 'ocm-sdk-go' Subscription object.
func (*Subscription) ProvideRowData ¶ added in v0.2.2
func (s *Subscription) ProvideRowData() map[string]interface{}
type WithConnection ¶ added in v0.2.2
type WithConnection struct{ *sdk.Connection }
func (WithConnection) ConfigureAddon ¶ added in v0.2.2
func (wc WithConnection) ConfigureAddon(c *AddonConfig)
func (WithConnection) ConfigureCluster ¶ added in v0.2.2
func (wc WithConnection) ConfigureCluster(c *ClusterConfig)
type WithLogger ¶ added in v0.2.2
func (WithLogger) ConfigureAddon ¶ added in v0.2.2
func (wl WithLogger) ConfigureAddon(c *AddonConfig)
func (WithLogger) ConfigureCluster ¶ added in v0.2.2
func (wl WithLogger) ConfigureCluster(c *ClusterConfig)