Documentation ¶
Index ¶
- Constants
- func LogEntryInternalOnly(c *LogEntryConfig)
- type Addon
- type AddonInstallation
- type AddonInstallationRowObject
- type AddonInstallations
- 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 Cluster
- func (c *Cluster) Domain() string
- func (c *Cluster) GetLogs(ctx context.Context, opts GetLogsOptions) ([]LogEntry, error)
- func (c *Cluster) InstalledAddons() string
- func (c *Cluster) Organization() string
- func (c *Cluster) PostLog(ctx context.Context, opts ...LogEntryOption) error
- func (c *Cluster) ProductID() string
- func (c *Cluster) WithAddonInstallations(ctx context.Context) (*Cluster, error)
- func (c *Cluster) WithSubscription(ctx context.Context) (*Cluster, error)
- type ClusterPager
- type GetLogsOption
- type GetLogsOptions
- type LogEntry
- type LogEntryConfig
- type LogEntryOption
- type LogEntrySortFunc
- type LogEntrySorter
- type LogLevel
- type Order
- type Subscription
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 AddonInstallation ¶
type AddonInstallation struct { *cmv1.AddOnInstallation // contains filtered or unexported fields }
AddonInstallation provides details of an AddonInstallation.
func (*AddonInstallation) ToRow ¶
func (a *AddonInstallation) ToRow() output.Row
func (*AddonInstallation) ToRowObject ¶
func (a *AddonInstallation) ToRowObject() *AddonInstallationRowObject
ToRowObject presents addon installation data as a record with static fields. This is currently used to make the 'ocm-cli' TableWriter happy as the logic which resolves column names to fields using reflection has trouble with AddonInstallations.
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 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 Cluster ¶
type Cluster struct { *cmv1.Cluster AddonInstallations AddonInstallations // contains filtered or unexported fields }
Cluster wraps for 'ocm-sdk-go' Cluster objects.
func (*Cluster) InstalledAddons ¶
InstalledAddons returns a comma-separated list of installed addons for the cluster and their status.
func (*Cluster) Organization ¶
Organization returns the Organization ID associated with the subscription for this cluster if the subscription is retrievable and populated.
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) WithAddonInstallations ¶
WithAddonInstallations attempts to retrieve and abstract information about installed addons on the cluster. Any failure to retrieve data will return an error.
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)
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 {
*amv1.Subscription
}
Subscription wraps an 'ocm-sdk-go' Subscription object.