Creates a cluster.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request headers

This operation uses common request headers, but does not use special request headers. For more information, see Common parameters.

Request syntax

POST /pop/v5/resource/cluster HTTP/1.1

Request parameters

Parameter Type Position Required Example Description
ClusterName String Query Yes ****_product_test2

The name of the cluster.

ClusterType Integer Query Yes 2

The type of the cluster. Valid values:

  • 2: Elastic Compute Service (ECS) clusters
  • 3: user-created Kubernetes clusters in Enterprise Distributed Application Service (EDAS)
  • 5: Container Service for Kubernetes (ACK) clusters
NetworkMode Integer Query Yes 2

The network type of the cluster. Valid values:

  • 1: the classic network
  • 2: a virtual private cloud (VPC)
LogicalRegionId String Query No cn-beijing:td****

The region ID of the custom namespace.

The region ID is in the format of physical region:custom namespace identifier.

VpcId String Query No vpc-2zef6ob8mrlzv8x3q****

The ID of the VPC. This parameter is required when NetworkMode is set to 2.

OversoldFactor Integer Query No 2

(This parameter is no longer applicable.)

The CPU overcommitment ratio supported by Docker clusters. Valid values:

  • 2: 1:2
  • 4: 1:4
  • 8: 1:8
IaasProvider String Query No aliyun

The Infrastructure as a Service (IaaS) resource provider.

Response parameters

Parameter Type Example Description
Cluster Struct

The information of the cluster that was created.

ClusterId String 8705ad13-5d86-47fc-b68f-257b59ed****

The ID of the cluster.

ClusterName String ****_product_test2

The name of the cluster.

ClusterType Integer 2

The type of the cluster. Valid values:

  • 2: ECS clusters
  • 3: Kubernetes clusters in EDAS
  • 5: ACK clusters
IaasProvider String ALIYUN

The IaaS resource provider.

NetworkMode Integer 2

The network type of the cluster. Valid values:

  • 1: the classic network
  • 2: a VPC
OversoldFactor Integer 1

(This parameter is no longer applicable.)

The CPU overcommitment ratio supported by Docker clusters. Valid values:

  • 2: 1:2
  • 4: 1:4
  • 8: 1:8
RegionId String cn-beijing

The ID of the region where the cluster is located.

VpcId String vpc-2zef6ob8mrlzv8x3q****

The ID of the VPC.

Code Integer 200

The HTTP status code returned for the request.

Message String success

The additional information.

RequestId String b197-40ab-9155-****

The ID of the request.

Examples

Sample requests

POST /pop/v5/resource/cluster HTTP/1.1
Common request headers
{
"ClusterName": "****_product_test2",
"ClusterType": "2",
"NetworkMode": "2"
}

Sample success responses

XML format

<InsertClusterResponse>
  <Message>success</Message>
  <RequestId>b197-40ab-9155-****</RequestId>
  <Cluster>
        <OversoldFactor>1</OversoldFactor>
        <VpcId>vpc-2zef6ob8mrlzv8x3q****</VpcId>
        <ClusterId>8705ad13-5d86-47fc-b68f-257b59ed****</ClusterId>
        <ClusterName>****_product_test2</ClusterName>
        <RegionId>cn-beijing</RegionId>
        <ClusterType>2</ClusterType>
        <NetworkMode>2</NetworkMode>
        <IaasProvider>ALIYUN</IaasProvider>
  </Cluster>
  <Code>200</Code>
</InsertClusterResponse>

JSON format

{
    "Message": "success",
    "RequestId": "b197-40ab-9155-****",
    "Cluster": {
        "OversoldFactor": 1,
        "VpcId": "vpc-2zef6ob8mrlzv8x3q****",
        "ClusterId": "8705ad13-5d86-47fc-b68f-257b59ed****",
        "ClusterName": "****_product_test2",
        "RegionId": "cn-beijing",
        "ClusterType": 2,
        "NetworkMode": 2,
        "IaasProvider": "ALIYUN"
    },
    "Code": 200
}

Error codes

For a list of error codes, visit the API Error Center.