
# CLI命令参考
#### UCS集群
| API名称            | 命令                                       | 描述                                                                                                                                          | 操作                                                                                                     |
|:---|:---|:---|:---|
| 获取集群列表           | hcloud UCS ShowClusterList               | 获取集群信息列表                                                                                                                                    | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/UCS/cli?api=ShowClusterList)               |
| 注册集群             | hcloud UCS RegisterCluster               | 集群注册接口。支持三方集群的注册和CCE导入集群的注册。                                                                                                                | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/UCS/cli?api=RegisterCluster)               |
| 获取单个集群           | hcloud UCS ShowCluster                   | 获取集群信息。传入的cluster ID必须符合k8s UUID的格式规则；同时需要用户有对应集群的获取权限，否则会鉴权失败                                                                              | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/UCS/cli?api=ShowCluster)                   |
| 更新集群             | hcloud UCS UpdateCluster                 | 更新集群。当前仅允许更新附着集群和本地集群的国家/城市，允许更新多云集群的工作节点个数。                                                                                                | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/UCS/cli?api=UpdateCluster)                 |
| 删除集群             | hcloud UCS DeleteCluster                 | 用于集群解除注册；传入的cluster ID必须符合k8s UUID的格式规则；同时需要用户有对应集群的操作权限，否则会鉴权失败。                                                                           | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/UCS/cli?api=DeleteCluster)                 |
| 获取集群接入信息         | hcloud UCS ShowClusterAccessInfo         | 该API接口用于获取集群接入信息；传入的cluster ID必须符合k8s UUID的格式规则；同时需要用户有对应集群证书的获取权限，否则会鉴权失败；agent证书只可以下载一次。仅用于获取三方集群的集群接入信息，CCE集群不从该接口获取，如果传入CCE集群ID，返回码为400 | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/UCS/cli?api=ShowClusterAccessInfo)         |
| 激活集群             | hcloud UCS RetryClusterActivation        | 激活集群接口；传入的cluster ID必须符合k8s UUID的格式规则；同时需要用户有对应集群的更新权限，否则会鉴权失败                                                                              | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/UCS/cli?api=RetryClusterActivation)        |
| 获取租户的CCE集群列表     | hcloud UCS ListManagedClusters           | 获取当前租户的CCE集群列表                                                                                                                              | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/UCS/cli?api=ListManagedClusters)           |
| 集群关联权限策略         | hcloud UCS UpdateClusterRules            | 集群关联权限策略                                                                                                                                    | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/UCS/cli?api=UpdateClusterRules)            |
| 查询支持接入UCS的集群版本列表 | hcloud UCS ListRegisteredClusterVersions | 查询支持接入UCS的集群版本列表                                                                                                                            | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/UCS/cli?api=ListRegisteredClusterVersions) |
| 集群启用策略中心         | hcloud UCS EnableClusterPolicy           | 集群启用策略中心                                                                                                                                    | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/UCS/cli?api=EnableClusterPolicy)           |
| 集群关闭策略中心         | hcloud UCS DisableClusterPolicy          | 集群关闭策略中心                                                                                                                                    | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/UCS/cli?api=DisableClusterPolicy)          |
| 获取gitops启用进展     | hcloud UCS ShowGitOpsStatus              | 获取gitops启用进展                                                                                                                                | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/UCS/cli?api=ShowGitOpsStatus)              |
| 启用Gitops插件       | hcloud UCS EnableGitOps                  | 启用Gitops插件                                                                                                                                  | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/UCS/cli?api=EnableGitOps)                  |
| 卸载集群gitops插件     | hcloud UCS DisableGitOps                 | 卸载集群gitops插件                                                                                                                                | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/UCS/cli?api=DisableGitOps)                 |
| 创建集群策略实例         | hcloud UCS CreateClusterPolicyInstance   | 创建集群策略实例                                                                                                                                    | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/UCS/cli?api=CreateClusterPolicyInstance)   |
| 获取集群安装时所需的配置信息   | hcloud UCS CreateClusterConf             | 获取集群安装时所需的配置信息，当前仅本地集群使用                                                                                                                    | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/UCS/cli?api=CreateClusterConf)             |
| 获取集群kubeconfig   | hcloud UCS CreateClusterKubeconfig       | 获取集群kubeconfig                                                                                                                              | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/UCS/cli?api=CreateClusterKubeconfig)       |
   
#### 容器舰队
| API名称                   | 命令                                              | 描述                                                                                                    | 操作                                                                                                            |
|:---|:---|:---|:---|
| 获取容器舰队列表                | hcloud UCS ListClusterGroup                     | 获取所有容器舰队信息                                                                                            | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/UCS/cli?api=ListClusterGroup)                     |
| 注册容器舰队                  | hcloud UCS RegisterClusterGroup                 | 容器舰队创建API，生成容器舰队时可以选择关联的集群                                                                            | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/UCS/cli?api=RegisterClusterGroup)                 |
| 获取单个容器舰队                | hcloud UCS ShowClusterGroup                     | 获取单个容器舰队                                                                                              | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/UCS/cli?api=ShowClusterGroup)                     |
| 删除容器舰队                  | hcloud UCS DeleteClusterGroup                   | 容器舰队删除接口，只有在容器舰队为空时才可以删除该容器舰队，若需删除请先将集群移出容器舰队；传入的cluster ID必须符合k8s UUID的格式规则；同时需要用户有对应集群的操作权限，否则会鉴权失败 | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/UCS/cli?api=DeleteClusterGroup)                   |
| 向容器舰队中添加集群              | hcloud UCS UpdateClusterGroupAssociatedClusters | 向容器舰队中添加集群，同批次可以添加一个或多个集群，该接口无法清空或减少管理的集群。                                                            | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/UCS/cli?api=UpdateClusterGroupAssociatedClusters) |
| 更新容器舰队关联权限策略            | hcloud UCS UpdateClusterGroupAssociatedRules    | 更新容器舰队关联权限策略                                                                                          | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/UCS/cli?api=UpdateClusterGroupAssociatedRules)    |
| 更新容器舰队描述信息              | hcloud UCS UpdateClusterGroup                   | 更新集群所属的容器舰队description信息；需要用户对相应容器舰队有更新权限                                                             | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/UCS/cli?api=UpdateClusterGroup)                   |
| 集群加入容器舰队                | hcloud UCS JoinGroup                            | 集群加入容器舰队                                                                                              | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/UCS/cli?api=JoinGroup)                            |
| 集群移出容器舰队                | hcloud UCS LeaveGroup                           | 集群退出容器舰队                                                                                              | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/UCS/cli?api=LeaveGroup)                           |
| 查询联邦开启进度                | hcloud UCS ShowFederationProgress               | 查询联邦开启进度                                                                                              | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/UCS/cli?api=ShowFederationProgress)               |
| 启用容器舰队联邦                | hcloud UCS EnableFederation                     | 启用容器舰队联邦                                                                                              | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/UCS/cli?api=EnableFederation)                     |
| 关闭容器集群联邦                | hcloud UCS DisableFederation                    | 关闭容器舰队联邦                                                                                              | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/UCS/cli?api=DisableFederation)                    |
| 更新容器舰队的联邦对应的zone        | hcloud UCS UpdateClusterGroupAssociatedZones    | 更新容器舰队的集群联邦关联的zone                                                                                    | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/UCS/cli?api=UpdateClusterGroupAssociatedZones)    |
| 创建联邦网络连接并下载联邦kubeconfig | hcloud UCS CreateFederationCert                 | 舰队开通联邦后，调用此接口，创建vpcep终端节点，连接到联邦apiserver，并下载联邦apiserver的kubeconfig                                    | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/UCS/cli?api=CreateFederationCert)                 |
| 创建联邦网络连接                | hcloud UCS CreateFederationConnection           | 舰队开通联邦后，创建vpcep终端节点连接到联邦apiserver                                                                     | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/UCS/cli?api=CreateFederationConnection)           |
| 下载联邦kubeconfig          | hcloud UCS DownloadFederationKubeconfig         | 舰队开通联邦并且创建网络连接之后，可以使用此接口下载联邦的kubeconfig                                                               | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/UCS/cli?api=DownloadFederationKubeconfig)         |
| 查询联邦工作负载                | hcloud UCS ShowProxyUnitedWorkload              | 查询联邦工作负载                                                                                              | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/UCS/cli?api=ShowProxyUnitedWorkload)              |
| 创建联邦工作负载                | hcloud UCS CreateProxyUnitedWorkload            | 创建联邦工作负载                                                                                              | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/UCS/cli?api=CreateProxyUnitedWorkload)            |
| 更新联邦工作负载                | hcloud UCS UpdateProxyUnitedWorkload            | 更新联邦工作负载                                                                                              | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/UCS/cli?api=UpdateProxyUnitedWorkload)            |
| 删除联邦工作负载                | hcloud UCS DeleteProxyUnitedWorkload            | 删除联邦工作负载                                                                                              | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/UCS/cli?api=DeleteProxyUnitedWorkload)            |
| 舰队启用策略中心                | hcloud UCS EnableClusterGroupPolicy             | 舰队启用策略中心                                                                                              | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/UCS/cli?api=EnableClusterGroupPolicy)             |
| 舰队关闭策略中心                | hcloud UCS DisableClusterGroupPolicy            | 舰队关闭策略中心                                                                                              | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/UCS/cli?api=DisableClusterGroupPolicy)            |
| 创建舰队策略实例                | hcloud UCS CreateClusterGroupPolicyInstance     | 创建舰队策略实例                                                                                              | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/UCS/cli?api=CreateClusterGroupPolicyInstance)     |
| 升级容器舰队联邦                | hcloud UCS UpgradeFederation                    | 容器舰队联邦版本升级                                                                                            | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/UCS/cli?api=UpgradeFederation)                    |
   
#### 权限管理
| API名称    | 命令                    | 描述       | 操作                                                                                  |
|:---|:---|:---|:---|
| 获取权限策略列表 | hcloud UCS ListRule   | 获取权限策略列表 | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/UCS/cli?api=ListRule)   |
| 创建权限策略   | hcloud UCS CreateRule | 创建权限策略   | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/UCS/cli?api=CreateRule) |
| 更新权限策略   | hcloud UCS UpdateRule | 更新权限策略   | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/UCS/cli?api=UpdateRule) |
| 删除权限策略   | hcloud UCS DeleteRule | 删除权限策略   | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/UCS/cli?api=DeleteRule) |
   
#### 插件管理
| API名称    | 命令                             | 描述       | 操作                                                                                           |
|:---|:---|:---|:---|
| 获取插件实例   | hcloud UCS ShowAddonInstance   | 获取插件实例   | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/UCS/cli?api=ShowAddonInstance)   |
| 更新插件实例   | hcloud UCS UpdateAddonInstance | 更新插件实例   | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/UCS/cli?api=UpdateAddonInstance) |
| 卸载插件实例   | hcloud UCS DeleteAddonInstance | 卸载插件实例   | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/UCS/cli?api=DeleteAddonInstance) |
| 获取插件实例列表 | hcloud UCS ListAddonInstances  | 获取插件实例列表 | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/UCS/cli?api=ListAddonInstances)  |
| 安装插件实例   | hcloud UCS CreateAddonInstance | 安装插件实例   | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/UCS/cli?api=CreateAddonInstance) |
| 获取插件模板列表 | hcloud UCS ListAddonTemplates  | 获取插件模板列表 | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/UCS/cli?api=ListAddonTemplates)  |
   
#### 配置管理
| API名称             | 命令                              | 描述                 | 操作                                                                                            |
|:---|:---|:---|:---|
| 获取所有配置集合信息        | hcloud UCS ListConfigSets       | 获取所有配置集合信息         | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/UCS/cli?api=ListConfigSets)       |
| 创建配置集合            | hcloud UCS CreateConfigSet      | 创建配置集合             | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/UCS/cli?api=CreateConfigSet)      |
| 获取配置集合详细信息        | hcloud UCS ShowConfigSet        | 获取配置集合详细信息，包含仓库源信息 | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/UCS/cli?api=ShowConfigSet)        |
| 更新配置集合信息          | hcloud UCS UpdateConfigSet      | 仅更新配置集合，不更新仓库源     | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/UCS/cli?api=UpdateConfigSet)      |
| 删除配置集合            | hcloud UCS DeleteConfigSet      | 仅删除配置集合，不删除仓库源     | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/UCS/cli?api=DeleteConfigSet)      |
| 统计某个用户所有配置集合的运行状态 | hcloud UCS ShowGitopsStatistics | 统计某个用户所有配置集合的运行状态  | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/UCS/cli?api=ShowGitopsStatistics) |
| 获取仓库源列表           | hcloud UCS ListRepos            | 获取仓库源列表            | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/UCS/cli?api=ListRepos)            |
| 创建仓库源             | hcloud UCS CreateRepo           | 创建仓库源              | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/UCS/cli?api=CreateRepo)           |
| 更新仓库源信息           | hcloud UCS UpdateRepo           | 更新仓库源信息            | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/UCS/cli?api=UpdateRepo)           |
| 删除仓库源             | hcloud UCS DeleteRepo           | 删除仓库源              | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/UCS/cli?api=DeleteRepo)           |
| 查询服务配置信息          | hcloud UCS ListServerConfigs    | 获取各个类型集群的全局配置      | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/UCS/cli?api=ListServerConfigs)    |
   
#### 策略管理
| API名称        | 命令                                | 描述           | 操作                                                                                              |
|:---|:---|:---|:---|
| 获取策略实例列表     | hcloud UCS ListPolicyInstances    | 获取策略实例列表     | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/UCS/cli?api=ListPolicyInstances)    |
| 获取策略定义列表     | hcloud UCS ListPolicyDefinitions  | 获取策略定义列表     | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/UCS/cli?api=ListPolicyDefinitions)  |
| 获取策略定义       | hcloud UCS ShowPolicyDefinition   | 获取策略定义       | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/UCS/cli?api=ShowPolicyDefinition)   |
| 更新策略定义       | hcloud UCS UpdatePolicyDefination | 更新策略定义       | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/UCS/cli?api=UpdatePolicyDefination) |
| 获取指定策略实例     | hcloud UCS ShowPolicyInstance     | 获取指定策略实例     | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/UCS/cli?api=ShowPolicyInstance)     |
| 更新指定策略实例     | hcloud UCS UpdatePolicyInstance   | 更新指定策略实例     | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/UCS/cli?api=UpdatePolicyInstance)   |
| 删除指定策略实例     | hcloud UCS DeletePolicyInstance   | 删除指定策略实例     | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/UCS/cli?api=DeletePolicyInstance)   |
| 获取策略实例任务列表   | hcloud UCS ListPolicyJobs         | 获取策略实例任务列表   | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/UCS/cli?api=ListPolicyJobs)         |
| 获取指定策略实例相关任务 | hcloud UCS ShowPolicyJob          | 获取指定策略实例相关任务 | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/UCS/cli?api=ShowPolicyJob)          |
   
#### 流量管理
| API名称       | 命令                         | 描述          | 操作                                                                                       |
|:---|:---|:---|:---|
| 查询域名解析记录集列表 | hcloud UCS ListRecordSets  | 查询域名解析记录集列表 | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/UCS/cli?api=ListRecordSets)  |
| 创建域名解析记录集   | hcloud UCS CreateRecordSet | 创建域名解析记录集   | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/UCS/cli?api=CreateRecordSet) |
   
#### 配额管理
| API名称  | 命令                   | 描述        | 操作                                                                                 |
|:---|:---|:---|:---|
| 获取配额信息 | hcloud UCS ShowQuota | 获取UCS配额信息 | [去调试](https://console.huaweicloud.com/apiexplorer/#/openapi/UCS/cli?api=ShowQuota) |
   
