Documentation ¶
Index ¶
- Constants
- Variables
- func ApplyFilters(ocmClient *sdk.Connection, filters []string) ([]*v1.Cluster, error)
- func ConfirmSend() error
- func Contains(list []string, key string) bool
- func CreateConnection() *sdk.Connection
- func GenerateQuery(clusterIdentifier string) string
- func GetAWSAccountIdForCluster(ocmClient *sdk.Connection, clusterID string) (string, error)
- func GetAccount(connection *sdk.Connection, key string) (account *amv1.Account, err error)
- func GetCluster(connection *sdk.Connection, key string) (cluster *cmv1.Cluster, err error)
- func GetClusterAnyStatus(conn *sdk.Connection, clusterId string) (*v1.Cluster, error)
- func GetClusterLimitedSupportReasons(connection *sdk.Connection, clusterID string) ([]*cmv1.LimitedSupportReason, error)
- func GetClusters(ocmClient *sdk.Connection, clusterIds []string) []*v1.Cluster
- func GetCurrentOCMEnv(connection *sdk.Connection) string
- func GetHiveShard(clusterID string) (string, error)
- func GetLatestVersion() (latest string, err error)
- func GetOrgfromClusterID(ocmClient *sdk.Connection, cluster v1.Cluster) (string, error)
- func GetSubscription(connection *sdk.Connection, key string) (subscription *amv1.Subscription, err error)
- func GetSupportRoleArnForCluster(ocmClient *sdk.Connection, clusterID string) (string, error)
- func IsClusterCCS(ocmClient *sdk.Connection, clusterID string) (bool, error)
- func IsValidClusterKey(clusterKey string) (err error)
- func IsValidKey(clusterKey string) bool
- func StreamErrorln(stream genericclioptions.IOStreams, msg string)
- func StreamPrint(stream genericclioptions.IOStreams, msg string)
- func StreamPrintln(stream genericclioptions.IOStreams, msg string)
- func StreamRead(stream genericclioptions.IOStreams, delim byte) (string, error)
- type Config
Constants ¶
const ( VersionAPIEndpoint = "https://api.github.com/repos/openshift/osdctl/releases/latest" VersionAddressTemplate = "https://github.com/openshift/osdctl/releases/download/v%s/osdctl_%s_%s_%s.tar.gz" // version, version, GOOS, GOARCH )
const ClusterServiceClusterSearch = "id = '%s' or name = '%s' or external_id = '%s'"
Variables ¶
var ( // GitCommit is the short git commit hash from the environment // Will be set during build process via GoReleaser // See also: https://pkg.go.dev/cmd/link GitCommit string // Version is the tag version from the environment // Will be set during build process via GoReleaser // See also: https://pkg.go.dev/cmd/link Version string )
Functions ¶
func ApplyFilters ¶ added in v0.9.6
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
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
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
GetAccount Function allows to get a single account with any identifier (username, ID)
func GetCluster ¶ added in v0.9.6
GetCluster Function allows to get a single cluster with any identifier (displayname, ID, or external ID)
func GetClusterAnyStatus ¶ added in v0.13.5
GetClusterAnyStatus returns an OCM cluster object given an OCM connection and cluster id (internal and external ids both supported).
func GetClusterLimitedSupportReasons ¶ added in v0.9.6
func GetClusterLimitedSupportReasons(connection *sdk.Connection, clusterID string) ([]*cmv1.LimitedSupportReason, error)
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
Returns the hive shard corresponding to a cluster e.g. https://api.<hive_cluster>.byo5.p1.openshiftapps.com:6443
func GetLatestVersion ¶ added in v0.13.5
getLatestVersion connects to the GitHub API and returns the latest osdctl tag name Interesting Note: GitHub only shows the latest "stable" tag. This means, that tags with a suffix like *-rc.1 are not returned. We will always show the latest stable on master branch.
func GetOrgfromClusterID ¶ added in v0.13.7
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 IsValidKey ¶ added in v0.11.0
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 Config ¶ added in v0.14.3
type Config struct { AccessToken string `json:"access_token,omitempty" doc:"Bearer access token."` ClientID string `json:"client_id,omitempty" doc:"OpenID client identifier."` ClientSecret string `json:"client_secret,omitempty" doc:"OpenID client secret."` Insecure bool `` /* 142-byte string literal not displayed */ Password string `json:"password,omitempty" doc:"User password."` RefreshToken string `json:"refresh_token,omitempty" doc:"Offline or refresh token."` Scopes []string `` /* 172-byte string literal not displayed */ TokenURL string `json:"token_url,omitempty" doc:"OpenID token URL."` URL string `` /* 162-byte string literal not displayed */ User string `json:"user,omitempty" doc:"User name."` Pager string `json:"pager,omitempty" doc:"Pager command, for example 'less'. If empty no pager will be used."` }
Config describes the OCM client configuration Taken wholesale from openshift-online/ocm-cli