Updated on 2025-12-30 GMT+08:00

Creating a Partition

Function

This API is used to create a partition.

URI

POST /api/v3/projects/{project_id}/clusters/{cluster_id}/partitions

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Details:

Project ID. For details about how to obtain the value, see How to Obtain Parameters in the API URI.

Constraints:

None

Options:

Project IDs of the account

Default value:

N/A

cluster_id

Yes

String

Details:

Cluster ID. For details about how to obtain the value, see How to Obtain Parameters in the API URI.

Constraints:

None

Options:

Cluster IDs

Default value:

N/A

Request Parameters

Table 2 Request body parameters

Parameter

Mandatory

Type

Description

kind

No

String

Definition

API type

Constraints

The value is fixed and cannot be changed.

Range

N/A

Default Value

Partition

apiVersion

No

String

Definition

API version

Constraints

The value is fixed and cannot be changed.

Range

N/A

Default Value

v3

metadata

No

metadata object

Definition

Partition metadata

Constraints

N/A

spec

No

spec object

Definition

Partition configurations

Constraints

N/A

Range

N/A

Default Value

N/A

Table 3 metadata

Parameter

Mandatory

Type

Description

name

No

String

Definition

Partition name

Constraints

N/A

Range

N/A

Default Value

N/A

Table 4 spec

Parameter

Mandatory

Type

Description

hostNetwork

No

hostNetwork object

Definition

Partition subnet

Constraints

N/A

Range

N/A

Default Value

N/A

containerNetwork

No

Array of containerNetwork objects

Definition

Container subnet in a partition

Constraints

The maximum list length is 20.

Range

N/A

Default Value

N/A

publicBorderGroup

No

String

Definition

Group. In the CloudPond scenario, the value is the AZ ID. In the central region, the value is center.

Constraints

N/A

Range

N/A

Default Value

N/A

category

No

String

Definition

AZ type.

Constraints

N/A

Range

  • Default: central AZ

  • IES: dedicated cloud AZ

  • HomeZone: intelligent edge cloud AZ

Default Value

N/A

Table 5 hostNetwork

Parameter

Mandatory

Type

Description

subnetID

No

String

Definition

Subnet ID.

To obtain the value:

  • Method 1: Log in to the VPC console and click the target subnet on the Subnets page. You can view the IPv4 subnet ID on the displayed page.

  • Method 2: Use the VPC APIs.

Constraints

N/A

Range

N/A

Default Value

N/A

Table 6 containerNetwork

Parameter

Mandatory

Type

Description

subnetID

No

String

Definition

Subnet ID.

To obtain the value:

  • Method 1: Log in to the VPC console and click the target subnet on the Subnets page. You can view the IPv4 subnet ID on the displayed page.

  • Method 2: Use the VPC APIs.

Constraints

N/A

Range

N/A

Default Value

N/A

Response Parameters

Status code: 200

Table 7 Response body parameters

Parameter

Type

Description

kind

String

Definition

API type

Constraints

The value cannot be changed.

Range

N/A

Default Value

Partition

apiVersion

String

Definition

API version

Constraints

The value cannot be changed.

Range

N/A

Default Value

v3

metadata

metadata object

Definition

Partition metadata

Constraints

N/A

spec

spec object

Definition

Partition configurations

Constraints

N/A

Range

N/A

Default Value

N/A

Table 8 metadata

Parameter

Type

Description

name

String

Definition

Partition name

Constraints

N/A

Range

N/A

Default Value

N/A

creationTimestamp

String

Definition

Creation time

Constraints

N/A

Range

N/A

Default Value

N/A

Table 9 spec

Parameter

Type

Description

hostNetwork

hostNetwork object

Definition

Partition subnet

Constraints

N/A

Range

N/A

Default Value

N/A

containerNetwork

Array of containerNetwork objects

Definition

Container subnet in a partition

Constraints

N/A

Range

N/A

Default Value

N/A

publicBorderGroup

String

Definition

Group. In the CloudPond scenario, the value is the AZ ID. In the central region, the value is center.

Constraints

N/A

Range

N/A

Default Value

N/A

category

String

Definition

AZ type.

Constraints

N/A

Range

  • Default: central AZ

  • IES: dedicated cloud AZ

  • HomeZone: intelligent edge cloud AZ

Default Value

N/A

Table 10 hostNetwork

Parameter

Type

Description

subnetID

String

Definition

Subnet ID

Constraints

N/A

Range

N/A

Default Value

N/A

Table 11 containerNetwork

Parameter

Type

Description

subnetID

String

Definition

Subnet ID

Constraints

N/A

Range

N/A

Default Value

N/A

Example Requests

POST /api/v3/projects/{project_id}/clusters/{cluster_id}/partitions

{
  "kind" : "Partition",
  "apiVersion" : "v3",
  "metadata" : {
    "name" : "partitionName"
  },
  "spec" : {
    "hostNetwork" : {
      "subnetID" : "subnetID"
    },
    "containerNetwork" : [ {
      "subnetID" : "subnetID"
    } ],
    "publicBorderGroup" : "publicBorderGroup",
    "category" : "category"
  }
}

Example Responses

Status code: 200

OK

{
  "kind" : "Partition",
  "apiVersion" : "v3",
  "metadata" : {
    "name" : "partitionName",
    "creationTimestamp" : "2000-1-1 00:00:35.451967 +0000 UTC"
  },
  "spec" : {
    "hostNetwork" : {
      "subnetID" : "subnetID"
    },
    "containerNetwork" : [ {
      "subnetID" : "subnetID"
    } ],
    "publicBorderGroup" : "publicBorderGroup",
    "category" : "category"
  }
}

Status Codes

Status Code

Description

200

OK

Error Codes

See Error Codes.