Updated on 2024-03-22 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

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

cluster_id

Yes

String

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

Request Parameters

Table 2 Request body parameters

Parameter

Mandatory

Type

Description

kind

No

String

Resource type

apiVersion

No

String

API version

metadata

No

metadata object

Metadata of partitions

spec

No

spec object

Partition configurations

Table 3 metadata

Parameter

Mandatory

Type

Description

name

No

String

Partition name

Table 4 spec

Parameter

Mandatory

Type

Description

hostNetwork

No

hostNetwork object

Partition subnet

containerNetwork

No

Array of containerNetwork objects

Container subnet in the partition

publicBorderGroup

No

String

Group

category

No

String

Category

Table 5 hostNetwork

Parameter

Mandatory

Type

Description

subnetID

No

String

Subnet ID

Table 6 containerNetwork

Parameter

Mandatory

Type

Description

subnetID

No

String

Subnet ID

Response Parameters

Status code: 200

Table 7 Response body parameters

Parameter

Type

Description

kind

String

Resource type

apiVersion

String

API version

metadata

metadata object

Metadata of partitions

spec

spec object

Partition configurations

Table 8 metadata

Parameter

Type

Description

name

String

Partition name

creationTimestamp

String

Creation time

Table 9 spec

Parameter

Type

Description

hostNetwork

hostNetwork object

Partition subnet

containerNetwork

Array of containerNetwork objects

Container subnet in the partition

publicBorderGroup

String

Group

category

String

Category

Table 10 hostNetwork

Parameter

Type

Description

subnetID

String

Subnet ID

Table 11 containerNetwork

Parameter

Type

Description

subnetID

String

Subnet ID

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.