Documentation ¶
Index ¶
- Constants
- Variables
- func AddClusterFlag(cmd *cobra.Command)
- func ClusterNameValidator(name interface{}) error
- func GetAvailableMachineTypeList(machineTypes []*MachineType, multiAZ bool) (machineTypeList []string)
- func GetClusterKey() (string, error)
- func GetEnv() (string, error)
- func GetVersionID(cluster *cmv1.Cluster) string
- func GetVersionMinorList(ocmClient *Client) (versionList []string, err error)
- func HasSTSSupport(rawID string, channelGroup string) bool
- func HasSTSSupportMinor(minor string) bool
- func IdentityProviderType(idp *cmv1.IdentityProvider) string
- func IsEmptyCIDR(cidr net.IPNet) bool
- func IsValidClusterKey(clusterKey string) bool
- func IsValidClusterName(clusterName string) bool
- func IsValidUsername(username string) bool
- func Location() (path string, err error)
- func RandomLabel(size int) string
- func Remove() error
- func Save(cfg *Config) error
- func SetClusterKey(key string)
- func ValidateAdditionalTrustBundle(val interface{}) error
- func ValidateHTTPProxy(val interface{}) error
- func ValidateMachineType(machineType string, machineTypes []*MachineType, multiAZ bool) (string, error)
- func ValidateVersion(version string, versionList []string) (string, error)
- type AddOnParam
- type AddOnResource
- type Client
- func (c *Client) AckVersionGate(clusterID string, gateID string) error
- func (c *Client) AcknowledgeGate(versionGates []*cmv1.VersionGate) (err error)
- func (c *Client) CancelUpgrade(clusterID string) (bool, error)
- func (c *Client) CheckIfAWSAccountExists(orgID string, awsAccountID string) (bool, string, string, error)
- func (c *Client) CheckRoleExists(orgID string, roleName string, awsAccountID string) (bool, string, error)
- func (c *Client) Close() error
- func (c *Client) CreateCluster(config Spec) (*cmv1.Cluster, error)
- func (c *Client) CreateIdentityProvider(clusterID string, idp *cmv1.IdentityProvider) (*cmv1.IdentityProvider, error)
- func (c *Client) CreateIngress(clusterID string, ingress *cmv1.Ingress) (*cmv1.Ingress, error)
- func (c *Client) CreateMachinePool(clusterID string, machinePool *cmv1.MachinePool) (*cmv1.MachinePool, error)
- func (c *Client) CreateUser(clusterID string, group string, user *cmv1.User) (*cmv1.User, error)
- func (c *Client) DeleteCluster(clusterKey string, creator *aws.Creator) (*cmv1.Cluster, error)
- func (c *Client) DeleteIdentityProvider(clusterID string, idpID string) error
- func (c *Client) DeleteIngress(clusterID string, ingressID string) error
- func (c *Client) DeleteMachinePool(clusterID string, machinePoolID string) error
- func (c *Client) DeleteUser(clusterID string, group string, username string) error
- func (c *Client) GetAddOn(id string) (*cmv1.AddOn, error)
- func (c *Client) GetAddOnInstallation(clusterKey string, creator *aws.Creator, addOnID string) (*cmv1.AddOnInstallation, error)
- func (c *Client) GetAddOnParameters(clusterID string, addOnID string) (*cmv1.AddOnParameterList, error)
- func (c *Client) GetAllClusters(creator *aws.Creator) (clusters []*cmv1.Cluster, err error)
- func (c *Client) GetAvailableAddOns() ([]*AddOnResource, error)
- func (c *Client) GetAvailableMachineTypes() ([]*MachineType, error)
- func (c *Client) GetAvailableUpgrades(versionID string) ([]string, error)
- func (c *Client) GetCluster(clusterKey string, creator *aws.Creator) (*cmv1.Cluster, error)
- func (c *Client) GetClusterAddOns(cluster *cmv1.Cluster) ([]*ClusterAddOn, error)
- func (c *Client) GetClusterByID(clusterKey string, creator *aws.Creator) (*cmv1.Cluster, error)
- func (c *Client) GetClusterState(clusterID string) (cmv1.ClusterState, error)
- func (c *Client) GetClusterStatus(clusterID string) (*cmv1.ClusterStatus, error)
- func (c *Client) GetClusterUsingSubscription(clusterKey string, creator *aws.Creator) (*amv1.Subscription, error)
- func (c *Client) GetClusters(creator *aws.Creator, count int) (clusters []*cmv1.Cluster, err error)
- func (c *Client) GetConnectionTokens() (string, string, error)
- func (c *Client) GetConnectionURL() string
- func (c *Client) GetCurrentAccount() (*amsv1.Account, error)
- func (c *Client) GetCurrentOrganization() (id string, externalID string, err error)
- func (c *Client) GetDefaultClusterFlavors(flavour string) (dMachinecidr *net.IPNet, dPodcidr *net.IPNet, dServicecidr *net.IPNet, ...)
- func (c *Client) GetIdentityProviders(clusterID string) ([]*cmv1.IdentityProvider, error)
- func (c *Client) GetIngresses(clusterID string) ([]*cmv1.Ingress, error)
- func (c *Client) GetInstallLogs(clusterID string, tail int) (logs *cmv1.Log, err error)
- func (c *Client) GetMachinePools(clusterID string) ([]*cmv1.MachinePool, error)
- func (c *Client) GetMachineTypeList() (machineTypeList []string, err error)
- func (c *Client) GetMachineTypes() (machineTypes []*cmv1.MachineType, err error)
- func (c *Client) GetMissingGateAgreements(clusterID string, upgradePolicy *cmv1.UpgradePolicy) ([]*cmv1.VersionGate, error)
- func (c *Client) GetPendingClusterForARN(creator *aws.Creator) (cluster *cmv1.Cluster, err error)
- func (c *Client) GetRegionList(multiAZ bool, roleARN string, externalID string) (regionList []string, regionAZ map[string]bool, err error)
- func (c *Client) GetRegions(roleARN string, externalID string) (regions []*cmv1.CloudRegion, err error)
- func (c *Client) GetScheduledUpgrade(clusterID string) (*cmv1.UpgradePolicy, *cmv1.UpgradePolicyState, error)
- func (c *Client) GetUninstallLogs(clusterID string, tail int) (logs *cmv1.Log, err error)
- func (c *Client) GetUpgradePolicies(clusterID string) (upgradePolicies []*cmv1.UpgradePolicy, err error)
- func (c *Client) GetUser(clusterID string, group string, username string) (*cmv1.User, error)
- func (c *Client) GetUsers(clusterID string, group string) ([]*cmv1.User, error)
- func (c *Client) GetVersions(channelGroup string) (versions []*cmv1.Version, err error)
- func (c *Client) HasClusters(creator *aws.Creator) (bool, error)
- func (c *Client) HibernateCluster(clusterID string) error
- func (c *Client) InstallAddOn(clusterKey string, creator *aws.Creator, addOnID string, params []AddOnParam) error
- func (c *Client) IsCapabilityEnabled(capabilityName string, orgID string) (bool, error)
- func (c *Client) IsHibernateCapabilityEnabled() error
- func (c *Client) IsSTSClusterExists(creator *aws.Creator, count int, roleARN string) (exists bool, err error)
- func (c *Client) LinkAccountRole(accountID string, roleARN string) error
- func (c *Client) LinkOrgToRole(orgID string, roleARN string) (bool, error)
- func (c *Client) ListAllOcpGates(version string) (versionGates []*cmv1.VersionGate, err error)
- func (c *Client) ListOcpGates(version string) (stsVersionGates []*cmv1.VersionGate, err error)
- func (c *Client) ListStsGates(version string) (stsVersionGates []*cmv1.VersionGate, err error)
- func (c *Client) LogEvent(key string, body map[string]string)
- func (c *Client) PollInstallLogs(clusterID string, cb func(*cmv1.LogGetResponse) bool) (logs *cmv1.Log, err error)
- func (c *Client) PollUninstallLogs(clusterID string, cb func(*cmv1.LogGetResponse) bool) (logs *cmv1.Log, err error)
- func (c *Client) ResumeCluster(clusterID string) error
- func (c *Client) ScheduleUpgrade(clusterID string, upgradePolicy *cmv1.UpgradePolicy) error
- func (c *Client) UninstallAddOn(clusterKey string, creator *aws.Creator, addOnID string) error
- func (c *Client) UpdateAddOnInstallation(clusterKey string, creator *aws.Creator, addOnID string, params []AddOnParam) error
- func (c *Client) UpdateCluster(clusterKey string, creator *aws.Creator, config Spec) error
- func (c *Client) UpdateIngress(clusterID string, ingress *cmv1.Ingress) (*cmv1.Ingress, error)
- func (c *Client) UpdateMachinePool(clusterID string, machinePool *cmv1.MachinePool) (*cmv1.MachinePool, error)
- type ClientBuilder
- type ClusterAddOn
- type Config
- type MachineType
- type OperatorIAMRole
- type Spec
Constants ¶
const ( ANY = "any" HibernateCapability = "capability.organization.hibernate_cluster" //Pendo Events Success = "Success" Failure = "Failure" Response = "Response" ClusterID = "ClusterID" Version = "Version" Username = "Username" URL = "URL" )
const AcceleratedComputing = "accelerated_computing"
const DefaultChannelGroup = "stable"
const LowestSTSMinor = "4.7"
const LowestSTSSupport = "4.7.11"
Variables ¶
var NetworkTypes = []string{"OpenShiftSDN", "OVNKubernetes"}
var URLAliases = map[string]string{
"production": "https://api.openshift.com",
"staging": "https://api.stage.openshift.com",
"integration": "https://api.integration.openshift.com",
}
URLAliases allows the value of the `--env` option to map to the various API URLs.
Functions ¶
func AddClusterFlag ¶ added in v1.1.5
func ClusterNameValidator ¶ added in v1.1.1
func ClusterNameValidator(name interface{}) error
func GetAvailableMachineTypeList ¶ added in v1.1.0
func GetAvailableMachineTypeList(machineTypes []*MachineType, multiAZ bool) (machineTypeList []string)
func GetClusterKey ¶ added in v1.1.5
func GetVersionID ¶ added in v1.1.0
func GetVersionMinorList ¶ added in v1.1.3
Get a list of all STS-supported minor versions
func HasSTSSupport ¶ added in v1.1.0
func HasSTSSupportMinor ¶ added in v1.1.0
func IdentityProviderType ¶
func IdentityProviderType(idp *cmv1.IdentityProvider) string
func IsEmptyCIDR ¶ added in v1.1.0
func IsValidClusterKey ¶
func IsValidClusterName ¶ added in v1.1.0
func IsValidUsername ¶
func Location ¶ added in v1.1.0
Location returns the location of the configuration file. If a configuration file already exists in the HOME directory, it uses that, otherwise it prefers to use the XDG config directory.
func RandomLabel ¶ added in v1.1.2
func SetClusterKey ¶ added in v1.1.5
func SetClusterKey(key string)
func ValidateAdditionalTrustBundle ¶ added in v1.1.6
func ValidateAdditionalTrustBundle(val interface{}) error
func ValidateHTTPProxy ¶ added in v1.1.6
func ValidateHTTPProxy(val interface{}) error
func ValidateMachineType ¶ added in v1.1.0
func ValidateMachineType(machineType string, machineTypes []*MachineType, multiAZ bool) (string, error)
Validate AWS machine types
Types ¶
type AddOnParam ¶ added in v1.1.0
type AddOnResource ¶ added in v0.1.10
type Client ¶ added in v1.1.0
type Client struct {
// contains filtered or unexported fields
}
func (*Client) AckVersionGate ¶ added in v1.1.8
func (*Client) AcknowledgeGate ¶ added in v1.1.8
func (c *Client) AcknowledgeGate(versionGates []*cmv1.VersionGate) (err error)
func (*Client) CancelUpgrade ¶ added in v1.1.0
func (*Client) CheckIfAWSAccountExists ¶ added in v1.1.7
func (*Client) CheckRoleExists ¶ added in v1.1.7
func (c *Client) CheckRoleExists(orgID string, roleName string, awsAccountID string) (bool, string, error)
* We should allow only one role per aws account per organization If the user request same ocm role we should let them proceed to ensure they can add admin role if not exists or attach policies or link etc if the user request diff ocm role name we error out
func (*Client) CreateCluster ¶ added in v1.1.0
func (*Client) CreateIdentityProvider ¶ added in v1.1.0
func (c *Client) CreateIdentityProvider(clusterID string, idp *cmv1.IdentityProvider) (*cmv1.IdentityProvider, error)
func (*Client) CreateIngress ¶ added in v1.1.0
func (*Client) CreateMachinePool ¶ added in v1.1.0
func (c *Client) CreateMachinePool(clusterID string, machinePool *cmv1.MachinePool) (*cmv1.MachinePool, error)
func (*Client) CreateUser ¶ added in v1.1.0
func (*Client) DeleteCluster ¶ added in v1.1.0
func (*Client) DeleteIdentityProvider ¶ added in v1.1.0
func (*Client) DeleteIngress ¶ added in v1.1.0
func (*Client) DeleteMachinePool ¶ added in v1.1.0
func (*Client) DeleteUser ¶ added in v1.1.0
func (*Client) GetAddOnInstallation ¶ added in v1.1.0
func (*Client) GetAddOnParameters ¶ added in v1.1.0
func (*Client) GetAllClusters ¶ added in v1.1.5
func (*Client) GetAvailableAddOns ¶ added in v1.1.0
func (c *Client) GetAvailableAddOns() ([]*AddOnResource, error)
Get complete list of available add-ons for the current organization
func (*Client) GetAvailableMachineTypes ¶ added in v1.1.0
func (c *Client) GetAvailableMachineTypes() ([]*MachineType, error)
func (*Client) GetAvailableUpgrades ¶ added in v1.1.0
func (*Client) GetCluster ¶ added in v1.1.0
func (*Client) GetClusterAddOns ¶ added in v1.1.0
func (c *Client) GetClusterAddOns(cluster *cmv1.Cluster) ([]*ClusterAddOn, error)
Get all add-ons available for a cluster
func (*Client) GetClusterByID ¶ added in v1.1.5
func (*Client) GetClusterState ¶ added in v1.1.0
func (c *Client) GetClusterState(clusterID string) (cmv1.ClusterState, error)
func (*Client) GetClusterStatus ¶ added in v1.1.0
func (c *Client) GetClusterStatus(clusterID string) (*cmv1.ClusterStatus, error)
func (*Client) GetClusterUsingSubscription ¶ added in v1.1.6
func (*Client) GetClusters ¶ added in v1.1.0
* pass 0 to get all clusters
func (*Client) GetConnectionTokens ¶ added in v1.1.0
func (*Client) GetConnectionURL ¶ added in v1.1.0
func (*Client) GetCurrentAccount ¶ added in v1.1.0
func (*Client) GetCurrentOrganization ¶ added in v1.1.0
func (*Client) GetDefaultClusterFlavors ¶ added in v1.1.0
func (*Client) GetIdentityProviders ¶ added in v1.1.0
func (c *Client) GetIdentityProviders(clusterID string) ([]*cmv1.IdentityProvider, error)
func (*Client) GetIngresses ¶ added in v1.1.0
func (*Client) GetInstallLogs ¶ added in v1.1.0
func (*Client) GetMachinePools ¶ added in v1.1.0
func (c *Client) GetMachinePools(clusterID string) ([]*cmv1.MachinePool, error)
func (*Client) GetMachineTypeList ¶ added in v1.1.0
func (*Client) GetMachineTypes ¶ added in v1.1.0
func (c *Client) GetMachineTypes() (machineTypes []*cmv1.MachineType, err error)
func (*Client) GetMissingGateAgreements ¶ added in v1.1.8
func (c *Client) GetMissingGateAgreements( clusterID string, upgradePolicy *cmv1.UpgradePolicy) ([]*cmv1.VersionGate, error)
func (*Client) GetPendingClusterForARN ¶ added in v1.1.0
Gets only pending non-STS clusters that are installed in the same AWS account
func (*Client) GetRegionList ¶ added in v1.1.0
func (*Client) GetRegions ¶ added in v1.1.0
func (*Client) GetScheduledUpgrade ¶ added in v1.1.0
func (c *Client) GetScheduledUpgrade(clusterID string) (*cmv1.UpgradePolicy, *cmv1.UpgradePolicyState, error)
func (*Client) GetUninstallLogs ¶ added in v1.1.0
func (*Client) GetUpgradePolicies ¶ added in v1.1.0
func (c *Client) GetUpgradePolicies(clusterID string) (upgradePolicies []*cmv1.UpgradePolicy, err error)
func (*Client) GetVersions ¶ added in v1.1.0
func (*Client) HasClusters ¶ added in v1.1.0
func (*Client) HibernateCluster ¶ added in v1.1.0
func (*Client) InstallAddOn ¶ added in v1.1.0
func (*Client) IsCapabilityEnabled ¶ added in v1.1.0
func (*Client) IsHibernateCapabilityEnabled ¶ added in v1.1.0
func (*Client) IsSTSClusterExists ¶ added in v1.1.5
func (*Client) LinkAccountRole ¶ added in v1.1.6
func (*Client) LinkOrgToRole ¶ added in v1.1.6
func (*Client) ListAllOcpGates ¶ added in v1.1.8
func (c *Client) ListAllOcpGates(version string) (versionGates []*cmv1.VersionGate, err error)
func (*Client) ListOcpGates ¶ added in v1.1.8
func (c *Client) ListOcpGates(version string) (stsVersionGates []*cmv1.VersionGate, err error)
func (*Client) ListStsGates ¶ added in v1.1.8
func (c *Client) ListStsGates(version string) (stsVersionGates []*cmv1.VersionGate, err error)
func (*Client) PollInstallLogs ¶ added in v1.1.0
func (*Client) PollUninstallLogs ¶ added in v1.1.0
func (*Client) ResumeCluster ¶ added in v1.1.0
func (*Client) ScheduleUpgrade ¶ added in v1.1.0
func (c *Client) ScheduleUpgrade(clusterID string, upgradePolicy *cmv1.UpgradePolicy) error
func (*Client) UninstallAddOn ¶ added in v1.1.0
func (*Client) UpdateAddOnInstallation ¶ added in v1.1.0
func (*Client) UpdateCluster ¶ added in v1.1.0
func (*Client) UpdateIngress ¶ added in v1.1.0
func (*Client) UpdateMachinePool ¶ added in v1.1.0
func (c *Client) UpdateMachinePool(clusterID string, machinePool *cmv1.MachinePool) (*cmv1.MachinePool, error)
type ClientBuilder ¶ added in v1.1.0
type ClientBuilder struct {
// contains filtered or unexported fields
}
ClientBuilder contains the information and logic needed to build a connection to OCM. Don't create instances of this type directly; use the NewClient function instead.
func NewClient ¶ added in v1.1.0
func NewClient() *ClientBuilder
NewClient creates a builder that can then be used to configure and build an OCM connection.
func (*ClientBuilder) Build ¶ added in v1.1.0
func (b *ClientBuilder) Build() (result *Client, err error)
Build uses the information stored in the builder to create a new OCM connection.
func (*ClientBuilder) Config ¶ added in v1.1.0
func (b *ClientBuilder) Config(value *Config) *ClientBuilder
Config sets the configuration that the connection will use to authenticate the user
func (*ClientBuilder) Logger ¶ added in v1.1.0
func (b *ClientBuilder) Logger(value *logrus.Logger) *ClientBuilder
Logger sets the logger that the connection will use to send messages to the log. This is mandatory.
type ClusterAddOn ¶
type Config ¶ added in v1.1.0
type Config struct { AccessToken string `json:"access_token,omitempty"` ClientID string `json:"client_id,omitempty"` ClientSecret string `json:"client_secret,omitempty"` Insecure bool `json:"insecure,omitempty"` RefreshToken string `json:"refresh_token,omitempty"` Scopes []string `json:"scopes,omitempty"` TokenURL string `json:"token_url,omitempty"` URL string `json:"url,omitempty"` }
Config is the type used to store the configuration of the client.
func Load ¶ added in v1.1.0
Load loads the configuration from the configuration file. If the configuration file doesn't exist it will return an empty configuration object.
func (*Config) Armed ¶ added in v1.1.0
Armed checks if the configuration contains either credentials or tokens that haven't expired, so that it can be used to perform authenticated requests.
func (*Config) Connection ¶ added in v1.1.0
func (c *Config) Connection() (connection *sdk.Connection, err error)
Connection creates a connection using this configuration.
type MachineType ¶ added in v1.1.0
type MachineType struct { MachineType *cmv1.MachineType Available bool AvailableQuota int }
type OperatorIAMRole ¶ added in v1.1.0
type Spec ¶ added in v1.1.0
type Spec struct { // Basic configs Name string Region string MultiAZ bool Version string ChannelGroup string Expiration time.Time Flavour string DisableWorkloadMonitoring *bool //Encryption FIPS bool EtcdEncryption bool KMSKeyArn string // Scaling config ComputeMachineType string ComputeNodes int Autoscaling bool MinReplicas int MaxReplicas int // SubnetIDs SubnetIds []string // AvailabilityZones AvailabilityZones []string // Network config NetworkType string MachineCIDR net.IPNet ServiceCIDR net.IPNet PodCIDR net.IPNet HostPrefix int Private *bool PrivateLink *bool // Properties CustomProperties map[string]string // User-defined tags for AWS resources Tags map[string]string // Simulate creating a cluster but don't actually create it DryRun *bool // Disable SCP checks in the installer by setting credentials mode as mint DisableSCPChecks *bool // STS IsSTS bool RoleARN string ExternalID string SupportRoleARN string OperatorIAMRoles []OperatorIAMRole ControlPlaneRoleARN string WorkerRoleARN string Mode string NodeDrainGracePeriodInMinutes float64 EnableProxy bool HTTPProxy *string HTTPSProxy *string AdditionalTrustBundleFile *string AdditionalTrustBundle *string }
Spec is the configuration for a cluster spec.