# Adding Shards

#### Function

This API is used to add shards.

- Before calling an API, you need to understand the API in Using APIs.
- Before calling this API, obtain the required region and endpoint.

Intermittent disconnection occurs when shards are being added. Exercise caution when performing this operation.

#### Constraints

- The shard growth increment ranges from 1 to 9.
- The maximum number of shards is 256.

#### URI

- URI format

  POST https://{Endpoint}/opengauss/v3/{project_id}/instances/{instance_id}/action

- Example

  https://gaussdb.eu-de.otc.t-systems.com/opengauss/v3/0483b6b16e954cb88930a360d2c4e663/instances/dsfae23fsfdsae3435in01/action

  - Parameter description

    Table 1 Parameter description
    Name | Mandatory | Type | Description
    --- | --- | --- | ---
    expand_cluster | Yes | Object | For details, see Table 2.

    Table 2 expand_cluster field data structure description
    Name | Mandatory | Type | Description
    --- | --- | --- | ---
    shard | Yes | Object | For details, see Table 3.

    Table 3 count field data structure description
    Name | Mandatory | Type | Description
    --- | --- | --- | ---
    count | Yes | Integer | Specifies the number of shards to be added.

- Request example

      {
      	"expand_cluster": {
                      "shard":{
                             "count":"1"
                      }
      	}
      }

#### Response

- Normal response

  Table 4 Parameter description
  Name | Type | Description
  --- | --- | ---
  job_id | String | Specifies the task ID.

- Example normal response

      {
      	"job_id": "2b414788a6004883a02390e2eb0ea227"
      }

- Abnormal response

  For details, see Abnormal Request Results.

#### Status Codes

For details, see Status Codes.

#### Error Codes

For details, see Error Codes.

Parent topic: DB Instance Management