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 only the common request header. For more information, see Common request 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) cluster
  • 3: self-managed Kubernetes cluster in Enterprise Distributed Application Service (EDAS)
  • 5: Kubernetes cluster
NetworkMode Integer Query Yes 2

The network type of the cluster. Valid values:

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

The ID of the custom namespace.

The ID is in the physical region ID:custom namespace identifier format. An example is cn-hangzhou:test.

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 obsolete.

The overcommit ratio supported by a Docker cluster. Valid values:

  • 2: 1:2, which means that resources are overcommitted by 1:2.
  • 4: 1:4, which means that resources are overcommitted by 1:4.
  • 8: 1:8, which means that resources are overcommitted by 1:8.
IaasProvider String Query No ALIYUN

The provider of Infrastructure as a Service (IaaS) resources that are used in the cluster.

<note> When you use Alibaba Cloud, set the value to ALIYUN. The value is case-sensitive. </note>

Response parameters

Parameter Type Example Description
Cluster Struct

The information about 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 cluster
  • 3: self-managed Kubernetes cluster in EDAS
  • 5: Kubernetes cluster
IaasProvider String ALIYUN

The provider of the IaaS resources that are used in the cluster.

NetworkMode Integer 2

The network type of the cluster. Valid values:

  • 1: classic network
  • 2. VPC
OversoldFactor Integer 1

This parameter is obsolete.

The overcommit ratio supported by a Docker cluster. Valid values:

  • 2: 1:2, which means that resources are overcommitted by 1:2.
  • 4: 1:4, which means that resources are overcommitted by 1:4.
  • 8: 1:8, which means that resources are overcommitted by 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.

Message String success

The returned message.

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

The ID of the request.

Examples

Sample requests

POST /pop/v5/resource/cluster HTTP/1.1
Common request header
{
"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.