Documentation ¶
Index ¶
- Constants
- func MultipleSourceComponents(fileName string, in io.Reader) ([]byte, error)
- func New(clusterName string, namespace string, cli dynamic.Interface, ...) *configObjectsWrapper
- func NewCancelCmd(f cmdutil.Factory, streams genericiooptions.IOStreams) *cobra.Command
- func NewClusterCmd(f cmdutil.Factory, streams genericiooptions.IOStreams) *cobra.Command
- func NewConnectCmd(f cmdutil.Factory, streams genericiooptions.IOStreams) *cobra.Command
- func NewCreateAccountCmd(f cmdutil.Factory, streams genericiooptions.IOStreams) *cobra.Command
- func NewCreateBackupCmd(f cmdutil.Factory, streams genericiooptions.IOStreams) *cobra.Command
- func NewCreateCmd(f cmdutil.Factory, streams genericiooptions.IOStreams) *cobra.Command
- func NewCreateRestoreCmd(f cmdutil.Factory, streams genericiooptions.IOStreams) *cobra.Command
- func NewCustomOpsCmd(f cmdutil.Factory, streams genericiooptions.IOStreams) *cobra.Command
- func NewDeleteAccountCmd(f cmdutil.Factory, streams genericiooptions.IOStreams) *cobra.Command
- func NewDeleteBackupCmd(f cmdutil.Factory, streams genericiooptions.IOStreams) *cobra.Command
- func NewDeleteCmd(f cmdutil.Factory, streams genericiooptions.IOStreams) *cobra.Command
- func NewDeleteOpsCmd(f cmdutil.Factory, streams genericiooptions.IOStreams) *cobra.Command
- func NewDescAccountCmd(f cmdutil.Factory, streams genericiooptions.IOStreams) *cobra.Command
- func NewDescribeBackupCmd(f cmdutil.Factory, streams genericiooptions.IOStreams) *cobra.Command
- func NewDescribeBackupPolicyCmd(f cmdutil.Factory, streams genericiooptions.IOStreams) *cobra.Command
- func NewDescribeCmd(f cmdutil.Factory, streams genericiooptions.IOStreams) *cobra.Command
- func NewDescribeOpsCmd(f cmdutil.Factory, streams genericiooptions.IOStreams) *cobra.Command
- func NewDescribeReconfigureCmd(f cmdutil.Factory, streams genericiooptions.IOStreams) *cobra.Command
- func NewDiffConfigureCmd(f cmdutil.Factory, streams genericiooptions.IOStreams) *cobra.Command
- func NewEditBackupPolicyCmd(f cmdutil.Factory, streams genericiooptions.IOStreams) *cobra.Command
- func NewEditConfigureCmd(f cmdutil.Factory, streams genericiooptions.IOStreams) *cobra.Command
- func NewExplainReconfigureCmd(f cmdutil.Factory, streams genericiooptions.IOStreams) *cobra.Command
- func NewExposeCmd(f cmdutil.Factory, streams genericiooptions.IOStreams) *cobra.Command
- func NewGrantOptions(f cmdutil.Factory, streams genericiooptions.IOStreams) *cobra.Command
- func NewHorizontalScalingCmd(f cmdutil.Factory, streams genericiooptions.IOStreams) *cobra.Command
- func NewLabelCmd(f cmdutil.Factory, streams genericiooptions.IOStreams) *cobra.Command
- func NewListAccountsCmd(f cmdutil.Factory, streams genericiooptions.IOStreams) *cobra.Command
- func NewListBackupCmd(f cmdutil.Factory, streams genericiooptions.IOStreams) *cobra.Command
- func NewListBackupPolicyCmd(f cmdutil.Factory, streams genericiooptions.IOStreams) *cobra.Command
- func NewListCmd(f cmdutil.Factory, streams genericiooptions.IOStreams) *cobra.Command
- func NewListComponentsCmd(f cmdutil.Factory, streams genericiooptions.IOStreams) *cobra.Command
- func NewListEventsCmd(f cmdutil.Factory, streams genericiooptions.IOStreams) *cobra.Command
- func NewListInstancesCmd(f cmdutil.Factory, streams genericiooptions.IOStreams) *cobra.Command
- func NewListLogsCmd(f cmdutil.Factory, streams genericiooptions.IOStreams) *cobra.Command
- func NewListOpsCmd(f cmdutil.Factory, streams genericiooptions.IOStreams) *cobra.Command
- func NewLogsCmd(f cmdutil.Factory, streams genericiooptions.IOStreams) *cobra.Command
- func NewPromoteCmd(f cmdutil.Factory, streams genericiooptions.IOStreams) *cobra.Command
- func NewRebuildInstanceCmd(f cmdutil.Factory, streams genericiooptions.IOStreams) *cobra.Command
- func NewReconfigureCmd(f cmdutil.Factory, streams genericiooptions.IOStreams) *cobra.Command
- func NewRestartCmd(f cmdutil.Factory, streams genericiooptions.IOStreams) *cobra.Command
- func NewRevokeOptions(f cmdutil.Factory, streams genericiooptions.IOStreams) *cobra.Command
- func NewStartCmd(f cmdutil.Factory, streams genericiooptions.IOStreams) *cobra.Command
- func NewStopCmd(f cmdutil.Factory, streams genericiooptions.IOStreams) *cobra.Command
- func NewUpdateCmd(f cmdutil.Factory, streams genericiooptions.IOStreams) *cobra.Command
- func NewUpgradeCmd(f cmdutil.Factory, streams genericiooptions.IOStreams) *cobra.Command
- func NewVerticalScalingCmd(f cmdutil.Factory, streams genericiooptions.IOStreams) *cobra.Command
- func NewVolumeExpansionCmd(f cmdutil.Factory, streams genericiooptions.IOStreams) *cobra.Command
- func PrintBackupList(o ListBackupOptions) error
- func PrintBackupPolicyList(o action.ListOptions) error
- type ConfigRelatedObjects
- type ConnectOptions
- type CreateBackupOptions
- type CreateOptions
- type CreateRestoreOptions
- type CreateSubCmdsOptions
- type CustomOperations
- type DescribeBackupOptions
- type DescribeBackupPolicyOptions
- type LabelOptions
- type ListBackupOptions
- type ListLogsOptions
- type LogsOptions
- type OperationsOptions
- func (o *OperationsOptions) CompleteCharacterType(clusterObj *appsv1alpha1.Cluster) error
- func (o *OperationsOptions) CompleteComponentsFlag() error
- func (o *OperationsOptions) CompleteHaEnabled()
- func (o *OperationsOptions) CompletePromoteOps() error
- func (o *OperationsOptions) CompleteRestartOps() error
- func (o *OperationsOptions) Validate() error
- type UpdatableFlags
- type UpdateOptions
Constants ¶
const (
ComponentStatusDefaultPodName = "Unknown"
)
const (
CueTemplateName = "cluster_template.cue"
)
const TrueValue = "true"
Variables ¶
This section is empty.
Functions ¶
func MultipleSourceComponents ¶
MultipleSourceComponents gets component data from multiple source, such as stdin, URI and local file
func NewCancelCmd ¶
func NewClusterCmd ¶
NewClusterCmd creates the cluster command
func NewConnectCmd ¶
NewConnectCmd returns the cmd of connecting to a cluster
func NewCreateAccountCmd ¶
func NewCreateBackupCmd ¶
func NewCreateCmd ¶
func NewCreateRestoreCmd ¶
func NewCustomOpsCmd ¶ added in v0.7.2
func NewDeleteAccountCmd ¶
func NewDeleteBackupCmd ¶
func NewDeleteCmd ¶
func NewDeleteOpsCmd ¶
func NewDescAccountCmd ¶
func NewDescribeBackupCmd ¶
func NewDescribeCmd ¶
func NewDescribeOpsCmd ¶
func NewDescribeReconfigureCmd ¶
func NewDescribeReconfigureCmd(f cmdutil.Factory, streams genericiooptions.IOStreams) *cobra.Command
NewDescribeReconfigureCmd shows details of history modifications or configuration file of reconfiguring operations
func NewDiffConfigureCmd ¶
NewDiffConfigureCmd shows the difference between two configuration version.
func NewEditBackupPolicyCmd ¶
func NewEditConfigureCmd ¶
NewEditConfigureCmd shows the difference between two configuration version.
func NewExplainReconfigureCmd ¶
NewExplainReconfigureCmd shows details of modifiable parameters.
func NewExposeCmd ¶
NewExposeCmd creates an expose command
func NewGrantOptions ¶
func NewHorizontalScalingCmd ¶
NewHorizontalScalingCmd creates a horizontal scaling command
func NewLabelCmd ¶
func NewListAccountsCmd ¶
func NewListBackupCmd ¶
func NewListBackupPolicyCmd ¶
func NewListCmd ¶
func NewListComponentsCmd ¶
func NewListEventsCmd ¶
func NewListInstancesCmd ¶
func NewListLogsCmd ¶
func NewListOpsCmd ¶
func NewLogsCmd ¶
NewLogsCmd returns the logic of accessing cluster log file
func NewPromoteCmd ¶
NewPromoteCmd creates a promote command
func NewRebuildInstanceCmd ¶ added in v0.9.0
NewRebuildInstanceCmd creates a rebuildInstance command
func NewReconfigureCmd ¶
NewReconfigureCmd creates a Reconfiguring command
func NewRestartCmd ¶
NewRestartCmd creates a restart command
func NewRevokeOptions ¶
func NewStartCmd ¶
NewStartCmd creates a start command
func NewStopCmd ¶
NewStopCmd creates a stop command
func NewUpdateCmd ¶
func NewUpgradeCmd ¶
NewUpgradeCmd creates an upgrade command
func NewVerticalScalingCmd ¶
NewVerticalScalingCmd creates a vertical scaling command
func NewVolumeExpansionCmd ¶
NewVolumeExpansionCmd creates a volume expanding command
func PrintBackupList ¶
func PrintBackupList(o ListBackupOptions) error
func PrintBackupPolicyList ¶
func PrintBackupPolicyList(o action.ListOptions) error
PrintBackupPolicyList prints the backup policy list.
Types ¶
type ConfigRelatedObjects ¶
type ConfigRelatedObjects struct { Cluster *appsv1alpha1.Cluster ConfigSpecs map[string]configSpecsType Configurations []*appsv1alpha1.Configuration }
type ConnectOptions ¶
type ConnectOptions struct { *action.ExecOptions // contains filtered or unexported fields }
func (*ConnectOptions) Complete ¶ added in v0.7.3
func (o *ConnectOptions) Complete() error
func (*ConnectOptions) Connect ¶ added in v0.7.3
func (o *ConnectOptions) Connect() error
Connect creates connection string and connects to cluster
func (*ConnectOptions) Validate ¶ added in v0.7.3
func (o *ConnectOptions) Validate(args []string) error
type CreateBackupOptions ¶
type CreateBackupOptions struct { BackupSpec appsv1alpha1.BackupSpec `json:"backupSpec"` ClusterRef string `json:"clusterRef"` OpsType string `json:"opsType"` OpsRequestName string `json:"opsRequestName"` Force bool `json:"force"` action.CreateOptions `json:"-"` }
func (*CreateBackupOptions) CompleteBackup ¶
func (o *CreateBackupOptions) CompleteBackup() error
func (*CreateBackupOptions) RegisterBackupFlagCompletionFunc ¶
func (o *CreateBackupOptions) RegisterBackupFlagCompletionFunc(cmd *cobra.Command, f cmdutil.Factory)
func (*CreateBackupOptions) Validate ¶
func (o *CreateBackupOptions) Validate() error
type CreateOptions ¶
type CreateOptions struct { // ClusterDefRef reference clusterDefinition ClusterDefRef string `json:"clusterDefRef"` ClusterVersionRef string `json:"clusterVersionRef"` Tolerations []interface{} `json:"tolerations,omitempty"` ComponentSpecs []map[string]interface{} `json:"componentSpecs"` Annotations map[string]string `json:"annotations,omitempty"` Labels map[string]string `json:"labels,omitempty"` // create components exclusively configured in 'set'. CreateOnlySet bool `json:"-"` SetFile string `json:"-"` Values []string `json:"-"` RBACEnabled bool `json:"-"` Storages []string `json:"-"` ServiceRef []string `json:"-"` LabelStrs []string `json:"-"` AnnotationStrs []string `json:"-"` CPUOversellRatio float64 `json:"-"` MemoryOversellRatio float64 `json:"-"` // backup name to restore in creation Backup string `json:"backup,omitempty"` RestoreTime string `json:"restoreTime,omitempty"` VolumeRestorePolicy string `json:"-"` // backup config BackupConfig *appsv1alpha1.ClusterBackup `json:"backupConfig,omitempty"` Cmd *cobra.Command `json:"-"` UpdatableFlags action.CreateOptions `json:"-"` }
func NewCreateOptions ¶
func NewCreateOptions(f cmdutil.Factory, streams genericiooptions.IOStreams) *CreateOptions
func (*CreateOptions) CleanUp ¶
func (o *CreateOptions) CleanUp() error
func (*CreateOptions) Complete ¶
func (o *CreateOptions) Complete() error
func (*CreateOptions) CreateDependencies ¶
func (o *CreateOptions) CreateDependencies(dryRun []string) error
func (*CreateOptions) PreCreate ¶
func (o *CreateOptions) PreCreate(obj *unstructured.Unstructured) error
PreCreate before saving yaml to k8s, makes changes on Unstructured yaml
func (*CreateOptions) Validate ¶
func (o *CreateOptions) Validate() error
type CreateRestoreOptions ¶
type CreateRestoreOptions struct { RestoreSpec appsv1alpha1.RestoreSpec `json:"restoreSpec"` ClusterRef string `json:"clusterRef"` OpsType string `json:"opsType"` OpsRequestName string `json:"opsRequestName"` Force bool `json:"force"` action.CreateOptions `json:"-"` }
func (*CreateRestoreOptions) Validate ¶
func (o *CreateRestoreOptions) Validate() error
type CreateSubCmdsOptions ¶ added in v0.7.2
type CreateSubCmdsOptions struct { // ClusterType is the type of the cluster to create. ClusterType cluster.ClusterType // values is used to render the cluster helm ChartInfo. Values map[string]interface{} // ChartInfo is the cluster chart information, used to render the command flag // and validate the values. ChartInfo *cluster.ChartInfo *action.CreateOptions }
func NewSubCmdsOptions ¶ added in v0.7.2
func NewSubCmdsOptions(createOptions *action.CreateOptions, t cluster.ClusterType) (*CreateSubCmdsOptions, error)
func (*CreateSubCmdsOptions) Run ¶ added in v0.7.2
func (o *CreateSubCmdsOptions) Run() error
type CustomOperations ¶ added in v0.7.3
type CustomOperations struct { *OperationsOptions OpsDefinitionName string `json:"opsDefinitionName"` Params []appsv1alpha1.Parameter `json:"params"` SchemaProperties *apiextensionsv1.JSONSchemaProps }
type DescribeBackupOptions ¶
type DescribeBackupOptions struct { Factory cmdutil.Factory // resource type and names Gvr schema.GroupVersionResource genericiooptions.IOStreams // contains filtered or unexported fields }
func (*DescribeBackupOptions) Complete ¶
func (o *DescribeBackupOptions) Complete(args []string) error
func (*DescribeBackupOptions) Run ¶
func (o *DescribeBackupOptions) Run() error
type DescribeBackupPolicyOptions ¶
type DescribeBackupPolicyOptions struct { Factory cmdutil.Factory LabelSelector string ClusterNames []string Names []string genericiooptions.IOStreams // contains filtered or unexported fields }
func (*DescribeBackupPolicyOptions) Complete ¶
func (o *DescribeBackupPolicyOptions) Complete() error
func (*DescribeBackupPolicyOptions) Run ¶
func (o *DescribeBackupPolicyOptions) Run() error
func (*DescribeBackupPolicyOptions) Validate ¶
func (o *DescribeBackupPolicyOptions) Validate() error
type LabelOptions ¶
type LabelOptions struct { Factory cmdutil.Factory GVR schema.GroupVersionResource genericiooptions.IOStreams // contains filtered or unexported fields }
func NewLabelOptions ¶
func NewLabelOptions(f cmdutil.Factory, streams genericiooptions.IOStreams, gvr schema.GroupVersionResource) *LabelOptions
type ListBackupOptions ¶
type ListBackupOptions struct { *action.ListOptions BackupName string }
type ListLogsOptions ¶
type ListLogsOptions struct { genericiooptions.IOStreams // contains filtered or unexported fields }
ListLogsOptions declares the arguments accepted by the list-logs command
func (*ListLogsOptions) Complete ¶
func (o *ListLogsOptions) Complete(f cmdutil.Factory, args []string) error
func (*ListLogsOptions) Run ¶
func (o *ListLogsOptions) Run() error
func (*ListLogsOptions) Validate ¶
func (o *ListLogsOptions) Validate(args []string) error
type LogsOptions ¶
type LogsOptions struct { *action.ExecOptions // contains filtered or unexported fields }
LogsOptions declares the arguments accepted by the logs command
type OperationsOptions ¶
type OperationsOptions struct { action.CreateOptions `json:"-"` HasCompNamesOrShardingNamesFlag bool `json:"-"` // AutoApprove when set true, skip the double check. AutoApprove bool `json:"-"` ComponentNames []string `json:"componentNames,omitempty"` ShardingNames []string `json:"shardingNames,omitempty"` OpsRequestName string `json:"opsRequestName"` TTLSecondsAfterSucceed int `json:"ttlSecondsAfterSucceed"` Force bool `json:"force"` // OpsType operation type OpsType appsv1alpha1.OpsType `json:"type"` // OpsTypeLower lower OpsType OpsTypeLower string `json:"typeLower"` // Upgrade options ClusterVersionRef string `json:"clusterVersionRef"` // VerticalScaling options CPU string `json:"cpu"` Memory string `json:"memory"` // HorizontalScaling options Replicas int `json:"replicas"` // Reconfiguring options KeyValues map[string]*string `json:"keyValues"` CfgTemplateName string `json:"cfgTemplateName"` CfgFile string `json:"cfgFile"` ForceRestart bool `json:"forceRestart"` FileContent string `json:"fileContent"` HasPatch bool `json:"hasPatch"` // VolumeExpansion options. // VCTNames VolumeClaimTemplate names VCTNames []string `json:"vctNames,omitempty"` Storage string `json:"storage"` // Expose options ExposeType string `json:"-"` ExposeEnabled string `json:"exposeEnabled,omitempty"` Services []appsv1alpha1.OpsService `json:"services,omitempty"` // Switchover options Component string `json:"component"` Instance string `json:"instance"` Primary string `json:"-"` CharacterType string `json:"-"` LorryHAEnabled bool `json:"-"` ExecPod *corev1.Pod `json:"-"` BackupName string `json:"-"` InstanceNames []string `json:"-"` Nodes []string `json:"-"` RebuildInstanceFrom []appsv1alpha1.RebuildInstance `json:"rebuildInstanceFrom,omitempty"` Env []string `json:"-"` }
func (*OperationsOptions) CompleteCharacterType ¶ added in v0.7.3
func (o *OperationsOptions) CompleteCharacterType(clusterObj *appsv1alpha1.Cluster) error
CompleteCharacterType will get the cluster character type compatible with 0.7 If both componentDefRef and componentDef are provided, the componentDef will take precedence over componentDefRef.
func (*OperationsOptions) CompleteComponentsFlag ¶
func (o *OperationsOptions) CompleteComponentsFlag() error
CompleteComponentsFlag when components flag is null and the cluster only has one component, auto complete it.
func (*OperationsOptions) CompleteHaEnabled ¶ added in v0.7.3
func (o *OperationsOptions) CompleteHaEnabled()
func (*OperationsOptions) CompletePromoteOps ¶ added in v0.7.3
func (o *OperationsOptions) CompletePromoteOps() error
func (*OperationsOptions) CompleteRestartOps ¶
func (o *OperationsOptions) CompleteRestartOps() error
CompleteRestartOps restarts all components of the cluster we should set all component names to ComponentNames flag.
func (*OperationsOptions) Validate ¶
func (o *OperationsOptions) Validate() error
Validate command flags or args is legal
type UpdatableFlags ¶
type UpdatableFlags struct { // Options for cluster termination policy TerminationPolicy string `json:"terminationPolicy"` // Add-on switches for cluster observability MonitoringInterval uint8 `json:"monitor"` EnableAllLogs bool `json:"enableAllLogs"` // Configuration and options for cluster affinity and tolerations PodAntiAffinity string `json:"podAntiAffinity"` // TopologyKeys if TopologyKeys is nil, add omitempty json tag, because CueLang can not covert null to list. TopologyKeys []string `json:"topologyKeys,omitempty"` NodeLabels map[string]string `json:"nodeLabels,omitempty"` Tenancy string `json:"tenancy"` TolerationsRaw []string `json:"-"` // backup config BackupEnabled bool `json:"-"` BackupRetentionPeriod string `json:"-"` BackupMethod string `json:"-"` BackupCronExpression string `json:"-"` BackupStartingDeadlineMinutes int64 `json:"-"` BackupRepoName string `json:"-"` BackupPITREnabled bool `json:"-"` }
UpdatableFlags is the flags that cat be updated by update command
type UpdateOptions ¶ added in v0.7.2
type UpdateOptions struct { ValMap map[string]interface{} UpdatableFlags *action.PatchOptions // contains filtered or unexported fields }
func NewUpdateOptions ¶ added in v0.7.2
func NewUpdateOptions(f cmdutil.Factory, streams genericiooptions.IOStreams) *UpdateOptions
func (*UpdateOptions) CmdComplete ¶ added in v0.7.2
func (o *UpdateOptions) CmdComplete(cmd *cobra.Command, args []string) error
func (*UpdateOptions) Complete ¶ added in v0.7.2
func (o *UpdateOptions) Complete() error
func (*UpdateOptions) Exec ¶ added in v0.7.2
func (o *UpdateOptions) Exec() error
func (*UpdateOptions) Validate ¶ added in v0.7.2
func (o *UpdateOptions) Validate() error
Source Files ¶
- accounts.go
- cluster.go
- config_diff.go
- config_edit.go
- config_observer.go
- config_ops.go
- config_resource.go
- config_util.go
- config_wrapper.go
- connect.go
- create.go
- create_subcmds.go
- create_util.go
- dataprotection.go
- delete.go
- delete_ops.go
- describe.go
- describe_ops.go
- errors.go
- label.go
- list.go
- list_logs.go
- list_ops.go
- logs.go
- operations.go
- register.go
- update.go