You can call this operation to query a cluster.
Debugging
Request headers
This operation only uses common request headers. For more information, see the Common request parameters topic.
Request syntax
GET /pop/v5/resource/cluster HTTP/1.1
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
ClusterId | String | Yes | 5439271a-015b-433d-befb-d76db49xxxxx | The ID of the cluster that you want to query. |
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
Cluster | The returned information about the cluster. | ||
ClusterId | String | 5439271a-015b-433d-befb-d76db49xxxxx | The ID of the cluster that was queried. |
ClusterName | String | ClusterTest |
The name of the cluster that was queried. |
ClusterType | Integer | 2 | The type of the cluster that was queried. Valid values: 1: Swarm cluster. 2: ECS cluster. 3: Kubernetes cluster. |
Cpu | Integer | 4 | The total number of CPUs in the cluster. |
CpuUsed | Integer | 2 | The number of used CPUs in the cluster. |
CreateTime | Long | 1570708232145 | The time when the cluster was created. |
Description | String | test | The description of the cluster. |
IaasProvider | String | ALIYUN | The provider of Infrastructure as a Service (IaaS) resources used in the cluster. |
Mem | Integer | 2048 |
The total amount of memory in the cluster. Unit: MB |
MemUsed | Integer | 1024 |
The amount of used memory in the cluster. Unit: MB |
NetworkMode | Integer | 2 | The type of the network where the cluster is located. Valid values: 1: classic network. 2: VPC. |
NodeNum | Integer | 4 | The number of Elastic Compute Service (ECS) instances deployed to the cluster. |
OversoldFactor | Integer | 2 | The CPU overselling factor of the cluster where Docker is installed. Valid values:
|
RegionId | String | cn-hangzhou | The ID of the logical zone where the cluster is located. |
UpdateTime | Long | 1570708232145 | The time when the cluster was last updated. |
VpcId | String | vpc-xxxxz1mlwpbjx3e**** | The ID of the virtual private cloud (VPC) where the cluster is located. |
Code | Integer | 200 | The returned code. |
Message | String | success | The returned message. |
RequestId | String | d76db491 | The ID of the request. |
Examples
Sample requests
GET /pop/v5/resource/cluster HTTP/1.1
Common request headers
{
"ClusterId": "5439271a-015b-433d-befb-d76db49xxxxx"
}
Sample success responses
XML
format
<Message>success</Message>
<Code>200</Code>
<Cluster>
<MemUsed>2048</MemUsed>
<Mem>2048</Mem>
<NetworkMode>2</NetworkMode>
<UpdateTime>1570708232145</UpdateTime>
<NodeNum>2</NodeNum>
<VpcId>vpc-bp19z1mlwpbjx3e9m****</VpcId>
<OversoldFactor>1</OversoldFactor>
<Cpu>2</Cpu>
<ClusterId>5439271a-015b-433d-befb-d76db491****</ClusterId>
<ClusterName>GTSDemoTesting</ClusterName>
<CreateTime>1561444573420</CreateTime>
<RegionId>cn-hangzhou</RegionId>
<CpuUsed>2</CpuUsed>
<ClusterType>2</ClusterType>
<IaasProvider>ALIYUN</IaasProvider>
</Cluster>
JSON
format
{
"Message":"success",
"Cluster":{
"MemUsed":2048,
"Mem":2048,
"NetworkMode":2,
"UpdateTime":1570708232145,
"NodeNum":2,
"VpcId":"vpc-xxxxz1mlwxxxx3e9mxxxx",
"OversoldFactor":1,
"Cpu":2,
"ClusterId":"xxxxxxa-015b-xxxx-befb-xxxxxxxxx",
"ClusterName":"xxxDemoTesting",
"CreateTime":1561444573420,
"RegionId":"cn-hangzhou",
"CpuUsed":2,
"ClusterType":2,
"IaasProvider":"ALIYUN"
},
"Code":200
}
Error codes
For a list of error codes, visit the API Error Center.