Updated on 2025-10-20 GMT+08:00

Deleting Shards

Function

This API is used to delete shards. Before calling this API:

Constraints

  • There must be at least one shard in a DB instance.
  • The DB instance is in the Available status.
  • The DB instance is in the distributed independent deployment.
  • Read/write permissions cannot be changed when the instance is in any of the following statuses: creating, changing instance class, frozen, or abnormal.

Debugging

You can debug this API in API Explorer.

URI

DELETE /v3/{project_id}/instances/{instance_id}/sharding

Table 1 Parameter description

Parameter

Mandatory

Type

Description

project_id

Yes

String

Definition

Project ID of a tenant in a region.

To obtain the value, see Obtaining a Project ID.

Constraints

N/A

Range

The value can contain 32 characters. Only letters and digits are allowed.

Default Value

N/A

instance_id

Yes

String

Definition

Instance ID, which uniquely identifies an instance.

Constraints

N/A

Range

The value can contain 36 characters. Only letters and digits are allowed.

Default Value

N/A

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Definition

User token.

You can obtain the token by calling the IAM API used to obtain a user token.

The value of X-Subject-Token in the response header is the token value.

Constraints

N/A

Range

N/A

Default Value

N/A

X-Language

No

String

Definition

Language.

Constraints

N/A

Range

  • zh-cn
  • en-us

Default Value

en-us

Table 3 Parameter description

Parameter

Mandatory

Type

Description

contraction_num

Yes

Integer

Definition

Number of shards to be deleted.

Constraints

The number of shards to be deleted must be greater than 0, and there must be at least one shard in a DB instance.

Range

N/A

Default Value

N/A

Response Parameters

Table 4 Parameter description

Parameter

Type

Description

job_id

String

Definition

Job ID. This parameter is returned only when your instance is billed at a pay-per-use basis.

Range

N/A

order_id

String

Definition

Order ID. This parameter is returned only when your instance is billed at a yearly/monthly basis.

Range

N/A

Example Request

Deleting a shard
DELETE https://gaussdb-opengauss.ap-southeast-1.myhuaweicloud.com/v3/0483b6b16e954cb88930a360d2c4e663/instances/dsfae23fsfdsae3435in14/sharding
{
    "contraction_num": 1
}

Example Response

  • Shard of a pay-per-use DB instance deleted.
    {
    	"job_id": "2b414788a6004883a02390e2eb0ea227"
    }
  • Shard of a yearly/monthly DB instance deleted.
    {
    	"order_id": "CS2309261009R2TI7"
    }

Status Code

Error Codes

For details, see Error Codes.