GetCluster - 查询集群

查询指定集群信息。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

授权信息

下表是API对应的授权信息,可以在RAM权限策略语句的Action元素中使用,用来给RAM用户或RAM角色授予调用此API的权限。具体说明如下:

  • 操作:是指具体的权限点。
  • 访问级别:是指每个操作的访问级别,取值为写入(Write)、读取(Read)或列出(List)。
  • 资源类型:是指操作中支持授权的资源类型。具体说明如下:
    • 对于必选的资源类型,用背景高亮的方式表示。
    • 对于不支持资源级授权的操作,用全部资源表示。
  • 条件关键字:是指云产品自身定义的条件关键字。
  • 关联操作:是指成功执行操作所需要的其他权限。操作者必须同时具备关联操作的权限,操作才能成功。
操作访问级别资源类型条件关键字关联操作
yundun-hsm:GetClusterget
*全部资源
*

请求参数

名称类型必填描述示例值
ClusterIdstring

集群 ID。

cluster-p94y1dud9ts****

返回参数

名称类型描述示例值
object

PlainResult

RequestIdstring

本次调用请求的 ID,是由阿里云为该请求生成的唯一标识符,可用于排查和定位问题。

4C467B38-3910-447D-87BC-AC049166F216
Clusterobject

集群信息。

ClusterIdstring

集群 ID。

cluster-p94y1dud9ts****
ClusterNamestring

集群名称。

cluster_polar_****
Statusstring

集群状态。

  • NEW:未初始化

  • INITIALIZED:已初始化

  • DELETED:已删除

  • SYNCHRONIZING:同步中

  • TO_DELETE:待删除

NEW
CreateTimelong

集群创建时间,精确到毫秒。时间戳格式。

1641275680000
RegionIdstring

集群所在地域 ID。

cn-hangzhou
VpcIdstring

集群所属 VPC ID。

vpc-8vbt0fjdm29hofvbo****
Whiteliststring

集群访问白名单列表。

130.176.XX.XX
Zonesarray<object>

集群可用区列表。

zoneobject

可用区。

VSwitchIdstring

交换机 ID。

vsw-uf61s651p69bdgmki****
ZoneIdstring

可用区 ID。

cn-hangzhou-j
DeviceTypestring

设备类型。

jnta
ClusterCsrstring

集群证书签名请求文件。

-----BEGIN CERTIFICATE REQUEST-----\nMIIC5TCCAc0CAQAwgZ8xWTAJBgNVBAYTAlVTMAkGA1UECAwCQ0EwDQYDVQQKDAZD\nYXZpdW0wDQYDVQQLDAZOM0ZJUFMwDgYDVQQHDAdTYW5Kb3NlMBMGA1UdEQwMMTk**** -----END CERTIFICATE REQUEST-----
ClusterCertificatestring

集群证书。

-----BEGIN CERTIFICATE----- MIIDfTCCAmWgAwIBAgIJAMRqQMr5if66MA0GCSqGSIb3DQEBCwUAMFUxCzAJBgNV BAYTAmNuMQswCQYDVQQIDAJ6ajELMAkGA1UEBwwCaHoxFjAUBgNVBAoMDUFsaWJh YmEgQ2xvdWQxFDA**** -----END CERTIFICATE-----
ClusterOwnerCertificatestring

集群自签名证书。

----BEGIN CERTIFICATE----- MIIDaTCCAlECAQEwDQYJKoZIhvcNAQELBQAwVTELMAkGA1UEBhMCY24xCzAJBgNV BAgMAnpqMQswCQYDVQQHDAJoejEWMBQGA1UECgwNQWxpYmFiYSBDbG91ZDEUMBIG A1UECwwLU2VjQ2xvdWRIc20wHhcNMjQwNzAzM**** -----END CERTIFICATE-----
Sizeinteger

集群内实例数量。

2
Instancesarray<object>

集群实例列表。

instanceobject

密码机实例信息。

InstanceIdstring

密码机实例 ID。

hsm-cn-g6z3v0uf****
NodeIdinteger

密码机实例在集群中的编号。

1
Masterboolean

是否为主密码机。

  • true:是

  • false:否

true
ClusterModeinteger

集群模式。

  • 0: 手动同步集群
  • 1: 自动同步集群(中国内地密码机集群)
  • 2: 自动同步集群(非中国内地密码机集群)
2

示例

正常返回示例

JSON格式

{
  "RequestId": "4C467B38-3910-447D-87BC-AC049166F216",
  "Cluster": {
    "ClusterId": "cluster-p94y1dud9ts****",
    "ClusterName": "cluster_polar_****",
    "Status": "NEW",
    "CreateTime": 1641275680000,
    "RegionId": "cn-hangzhou",
    "VpcId": "vpc-8vbt0fjdm29hofvbo****",
    "Whitelist": "130.176.XX.XX",
    "Zones": [
      {
        "VSwitchId": "vsw-uf61s651p69bdgmki****",
        "ZoneId": "cn-hangzhou-j"
      }
    ],
    "DeviceType": "jnta",
    "ClusterCsr": "-----BEGIN CERTIFICATE REQUEST-----\\nMIIC5TCCAc0CAQAwgZ8xWTAJBgNVBAYTAlVTMAkGA1UECAwCQ0EwDQYDVQQKDAZD\\nYXZpdW0wDQYDVQQLDAZOM0ZJUFMwDgYDVQQHDAdTYW5Kb3NlMBMGA1UdEQwMMTk****\n-----END CERTIFICATE REQUEST-----",
    "ClusterCertificate": "-----BEGIN CERTIFICATE-----\nMIIDfTCCAmWgAwIBAgIJAMRqQMr5if66MA0GCSqGSIb3DQEBCwUAMFUxCzAJBgNV\nBAYTAmNuMQswCQYDVQQIDAJ6ajELMAkGA1UEBwwCaHoxFjAUBgNVBAoMDUFsaWJh\nYmEgQ2xvdWQxFDA****\n-----END CERTIFICATE-----",
    "ClusterOwnerCertificate": "----BEGIN CERTIFICATE-----\nMIIDaTCCAlECAQEwDQYJKoZIhvcNAQELBQAwVTELMAkGA1UEBhMCY24xCzAJBgNV\nBAgMAnpqMQswCQYDVQQHDAJoejEWMBQGA1UECgwNQWxpYmFiYSBDbG91ZDEUMBIG\nA1UECwwLU2VjQ2xvdWRIc20wHhcNMjQwNzAzM****\n-----END CERTIFICATE-----",
    "Size": 2,
    "Instances": [
      {
        "InstanceId": "hsm-cn-g6z3v0uf****",
        "NodeId": 1,
        "Master": true
      }
    ],
    "ClusterMode": 2
  }
}

错误码

HTTP status code错误码错误信息描述
400SwitchMaster.InstanceInvalidInstance not in the cluster.-
400LeaveCluster.MasterLastMaster instance can not leave a cluster until all other instances are left.-
400Certificate.ChainInvalidCertificate chain invalid. Please make sure issuer certificate is the trust anchor and cluster certificate is signed by issuer certificate.-
400Certificate.FormatInvalidCertificate format invalid. Cluster/Issuer certificate must be in PEM format.-
400ConfigClusterSubnet.DuplicateZoneVSwitches should not contain duplicate zones.-
400InvalidApiParam.Errorapi param is invalid-
400InvalidClusterNameInvalid parameter clusterName.-
400InvalidPageSizeInvalid parameter pageSize.-
400InvalidCurrentPageInvalid parameter currentPage.-
400InvalidRegionIdInvalid parameter regionId.-
400InvalidVSwitchInvalid parameter vSwitch.-
400InvalidVpcInvalid parameter vpcId.-
400InvalidIpInvalid parameter IP.-
400InvalidAliuidInvalid parameter aliuid.-
400InvalidClusterIdInvalid parameter clusterId.-
400InvalidInstanceIdInvalid parameter instanceId.-
400InvalidBackupIdInvalid parameter backupId.-
400InvalidImageIdInvalid parameter imageId.-
400HsmInstanceNotExist.Errorhsm instance not exist-
400HSMIntanceNotActived.Errorhsm intance is not actived-
400WhiteListMaxCount.Errorwhilte list is more than max count-
400ClusterIdIsNotExists.Errorcluster ID non-exists-
400InstanceListIsEmpty.Errorinstance list is empty-
400InstanceIdIsEmpty.Errorinstance id is empty-
400InstanceIsNotExistsInCluster.Errorcluster has no such instance-
400InstanceIsExistsInCluster.Errorinstance already in the cluster-
400RegionNoEmpty.Errorregion no. is empty-
400ClusterNameEmpty.Errorempty cluster name not allowed-
400ClusterNameIsExists.Errorthe cluster name is already taken-
400IpNotValid.Errorip not valid-
400ClusterIsEmpty.Errorcluster is empty-
400NoMasterFoundInCluster.Errorcluster has no master instance-
400HsmInstanceIdNotFound.Errorno such instance-
400NoInstanceFoundInCluster.Errorcluster is empty-
400Whitelist.InvalidWhitelist blocks not in CIDR format.-
400Whitelist.TooLongWhitelist too long, exceeds 10 CIDR blocks.-
403NoPermissionCaller has no permission on the resource.-
403InstanceNotPausedPlease pause the instance before reset.-
403InstanceNotActiveInstance is not active.-
403ConfigIp.IncorrectStateInstance not in pending or active state, can not config IP address.-
403SwitchMaster.IncorrectStateCluster not initialized, please initialize the cluster first.-
403SyncCluster.IncorrectStateCluster not initialized, please initialize the cluster first.-
403LeaveCluster.InstanceInvalidThe instance is not in the cluster.-
403DeleteCluster.IncorrectStateCluster not empty, please remove all instances first.-
403JoinCluster.InstanceVSwitchNotInClusterInstance's vSwitch is not in cluster config, please change instance's vSwitch first.-
403JoinCluster.InstanceInitializedInitialized instance can not join a cluster.-
403JoinCluster.IncorrectStateCluster not initialized, please initialize the cluster first.-
403InitializeCluster.InstanceNotInitializedCluster master instance not initialized, please initialize cluster master instance first.-
403InitializeCluster.IncorrectConfigCluster subnet not configured, please config cluster subnet first.-
403InitializeCluster.IncorrectStateCluster initialized, do not re-initialize.-
403Cluster.CN.ActionForbiddenThis API is forbidden for non-international site cluster.-
403Cluster.INTL.ActionForbiddenThis API is forbidden for international site cluster.-
403ConfigClusterCertificate.IncorrectStateCluster initialized or certificates already configured.-
403ConfigClusterSubnet.InvalidVpcIdVPC Id invalid. Cluster VPC is the same as cluster master's VPC.-
403ConfigClusterSubnet.InvalidVSwitchIdVSwitch Id invalid. VSwitches should contain all current cluster vSwitches.-
403ConfigClusterSubnet.IncorrectStateCluster not in NEW state, can not config cluster subnet.-
403ClusterName.ExistCluster name already exists, please use another name.-
403Whitelist.InstanceInClusterWhitelist.InstanceInCluster-
404Resource.NotFoundResource not found.-
405ClusterAPI.NotSupportedClusterAPI not supported in this region.-
409ConflictResource is being updated by a previous request. Current request is redundant.-
409Cluster.ConflictThe cluster is being updated by a previous request. Please try again later.-
500ConfigWhitelistFailed.Errorconfig white list error-
500ActionFailed.Errorinternal error, please try again-
500InternalErrorThe request processing has failed due to some unknown error.未知错误导致请求处理失败。

访问错误中心查看更多错误码。