Documentation ¶
Overview ¶
Package ocm contains ocm api related functions
Index ¶
- func Location() (path string, err error)
- type Client
- type Config
- type LimitedSupportReason
- type SdkClient
- func (c *SdkClient) AwsClassicJumpRoleCompatible(cluster *cmv1.Cluster) (bool, error)
- func (c *SdkClient) GetAWSAccountClaim(internalClusterID string) (*awsv1alpha1.AccountClaim, error)
- func (c *SdkClient) GetClusterDeployment(internalClusterID string) (*hivev1.ClusterDeployment, error)
- func (c *SdkClient) GetClusterInfo(identifier string) (*cmv1.Cluster, error)
- func (c *SdkClient) GetClusterMachinePools(internalClusterID string) ([]*cmv1.MachinePool, error)
- func (c *SdkClient) GetConnection() *sdk.Connection
- func (c *SdkClient) GetServiceLog(cluster *cmv1.Cluster, filter string) (*servicelogsv1.ClusterLogsUUIDListResponse, error)
- func (c *SdkClient) GetSupportRoleARN(internalClusterID string) (string, error)
- func (c *SdkClient) IsAccessProtected(cluster *cmv1.Cluster) (bool, error)
- func (c *SdkClient) PostLimitedSupportReason(limitedSupportReason *LimitedSupportReason, internalClusterID string) error
- func (c *SdkClient) PostServiceLog(clusterID string, sl *ServiceLog) error
- type ServiceLog
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client interface { GetClusterMachinePools(internalClusterID string) ([]*cmv1.MachinePool, error) PostLimitedSupportReason(limitedSupportReason *LimitedSupportReason, internalClusterID string) error GetSupportRoleARN(internalClusterID string) (string, error) GetServiceLog(cluster *cmv1.Cluster, filter string) (*servicelogsv1.ClusterLogsUUIDListResponse, error) PostServiceLog(clusterID string, sl *ServiceLog) error AwsClassicJumpRoleCompatible(cluster *cmv1.Cluster) (bool, error) GetConnection() *sdk.Connection IsAccessProtected(cluster *cmv1.Cluster) (bool, error) }
Client is the interface exposing OCM related functions
type Config ¶
type Config struct { // TODO(efried): Better docs for things like AccessToken // TODO(efried): Dedup with flag docs in cmd/ocm/login/cmd.go:init where possible 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 is the type used to store the configuration of the client. There's no way to line-split or predefine tags, so...
func Load ¶
Load loads the configuration from the configuration file. If the configuration file doesn't exist it will return an empty configuration object.
func (*Config) Connection ¶
func (c *Config) Connection() (connection *sdk.Connection, err error)
Connection creates a connection using this configuration.
type LimitedSupportReason ¶
LimitedSupportReason is the internal representation of a limited support reason
type SdkClient ¶
type SdkClient struct {
// contains filtered or unexported fields
}
SdkClient is the ocm client with which we can run the commands currently we do not need to export the connection or the config, as we create the SdkClient using the New func
func New ¶
New will create a new ocm client by using the path to a config file if no path is provided, it will assume it in the default path
func (*SdkClient) AwsClassicJumpRoleCompatible ¶
AwsClassicJumpRoleCompatible check whether or not the CAD jumprole path is supported by the cluster
func (*SdkClient) GetAWSAccountClaim ¶
func (c *SdkClient) GetAWSAccountClaim(internalClusterID string) (*awsv1alpha1.AccountClaim, error)
GetAWSAccountClaim gets the AWS Account Claim object for a given cluster
func (*SdkClient) GetClusterDeployment ¶
func (c *SdkClient) GetClusterDeployment(internalClusterID string) (*hivev1.ClusterDeployment, error)
GetClusterDeployment gets the ClusterDeployment object for a given cluster
func (*SdkClient) GetClusterInfo ¶
GetClusterInfo returns cluster information from ocm by using either internal, external id or the cluster name Returns a v1.Cluster object or an error
func (*SdkClient) GetClusterMachinePools ¶
func (c *SdkClient) GetClusterMachinePools(internalClusterID string) ([]*cmv1.MachinePool, error)
GetClusterMachinePools get the machine pools for a given cluster
func (*SdkClient) GetConnection ¶
func (c *SdkClient) GetConnection() *sdk.Connection
GetConnection returns the active connection of the SdkClient
func (*SdkClient) GetServiceLog ¶
func (c *SdkClient) GetServiceLog(cluster *cmv1.Cluster, filter string) (*servicelogsv1.ClusterLogsUUIDListResponse, error)
GetServiceLog returns all ServiceLogs for a cluster. When supplying a filter it will use the Search call and pass it to this one directly.
func (*SdkClient) GetSupportRoleARN ¶
GetSupportRoleARN returns the support role ARN that allows the access to the cluster from internal cluster ID
func (*SdkClient) IsAccessProtected ¶
IsAccessProtected returns whether access protection is enabled for a cluster
func (*SdkClient) PostLimitedSupportReason ¶
func (c *SdkClient) PostLimitedSupportReason(limitedSupportReason *LimitedSupportReason, internalClusterID string) error
PostLimitedSupportReason allows to post a generic limited support reason to a cluster
func (*SdkClient) PostServiceLog ¶
func (c *SdkClient) PostServiceLog(clusterID string, sl *ServiceLog) error
PostServiceLog allows to send a generic servicelog to a cluster.