utils

package
v0.13.4 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2022 License: Apache-2.0 Imports: 12 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyFilters added in v0.9.6

func ApplyFilters(ocmClient *sdk.Connection, filters []string) ([]*v1.Cluster, error)

ApplyFilters retrieves clusters in OCM which match the filters given

func ConfirmSend added in v0.12.0

func ConfirmSend() error

func Contains added in v0.13.0

func Contains(list []string, key string) bool

Contains returns true if the given key is present in the provided list

func CreateConnection added in v0.9.6

func CreateConnection() *sdk.Connection

func GenerateQuery added in v0.9.6

func GenerateQuery(clusterIdentifier string) string

GenerateQuery returns an OCM search query to retrieve all clusters matching an expression (ie- "foo%")

func GetAWSAccountIdForCluster added in v0.13.0

func GetAWSAccountIdForCluster(ocmClient *sdk.Connection, clusterID string) (string, error)

func GetAccount added in v0.12.0

func GetAccount(connection *sdk.Connection, key string) (account *amv1.Account, err error)

GetAccount Function allows to get a single account with any identifier (username, ID)

func GetBackplaneURL added in v0.13.0

func GetBackplaneURL(clusterID string) (string, error)

Returns the backplane url corresponding to a cluster e.g. https://api-backplane.apps.<hive_cluster>.p1.openshiftapps.com/backplane/cloud/credentials/<cluster_id>

func GetCluster added in v0.9.6

func GetCluster(connection *sdk.Connection, key string) (cluster *cmv1.Cluster, err error)

GetCluster Function allows to get a single cluster with any identifier (displayname, ID, or external ID)

func GetClusters added in v0.9.6

func GetClusters(ocmClient *sdk.Connection, clusterIds []string) []*v1.Cluster

func GetCurrentOCMEnv added in v0.13.0

func GetCurrentOCMEnv(connection *sdk.Connection) string

func GetHiveShard added in v0.13.0

func GetHiveShard(clusterID string) (string, error)

Returns the hive shard corresponding to a cluster e.g. https://api.<hive_cluster>.byo5.p1.openshiftapps.com:6443

func GetOCMApiServerToken added in v0.13.0

func GetOCMApiServerToken() (*string, error)

Returns the token created from ocm login to the api server

func GetSubscription added in v0.12.0

func GetSubscription(connection *sdk.Connection, key string) (subscription *amv1.Subscription, err error)

GetSubscription Function allows to get a single subscription with any identifier (displayname, ID, internal or external ID)

func GetSupportRoleArnForCluster added in v0.13.0

func GetSupportRoleArnForCluster(ocmClient *sdk.Connection, clusterID string) (string, error)

func IsClusterCCS added in v0.13.0

func IsClusterCCS(ocmClient *sdk.Connection, clusterID string) (bool, error)

func IsValidClusterKey added in v0.11.0

func IsValidClusterKey(clusterKey string) (err error)

func IsValidKey added in v0.11.0

func IsValidKey(clusterKey string) bool

func StreamErrorln added in v0.13.0

func StreamErrorln(stream genericclioptions.IOStreams, msg string)

streamPrint prints the given error msg using the provided IOStreams

func StreamPrint added in v0.13.0

func StreamPrint(stream genericclioptions.IOStreams, msg string)

streamPrint prints the given msg using the provided IOStreams

func StreamPrintln added in v0.13.0

func StreamPrintln(stream genericclioptions.IOStreams, msg string)

streamPrintln appends a newline then prints the given msg using the provided IOStreams

func StreamRead added in v0.13.0

func StreamRead(stream genericclioptions.IOStreams, delim byte) (string, error)

StreamRead retrieves input from the provided IOStreams up to (and including) the delimiter given

Types

type LimitedSupportReasonItem added in v0.13.0

type LimitedSupportReasonItem struct {
	ID      string
	Summary string
	Details string
}

func GetClusterLimitedSupportReasons added in v0.9.6

func GetClusterLimitedSupportReasons(connection *sdk.Connection, clusterID string) ([]*LimitedSupportReasonItem, error)

Jump to

Keyboard shortcuts

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