Deletes one or more data shards from an ApsaraDB for Redis cluster instance.

For more information about how to delete one or more data shards in the ApsaraDB for Redis console, see Adjust the number of shards for an ApsaraDB for Redis instance.

Before you call this API operation, make sure that the ApsaraDB for Redis instance meets the following requirements:

  • The instance is a persistent memory-optimized instance in the cluster architecture. For more information about persistent memory-optimized instances, see Persistent memory-optimized instances.
  • The number of data shards in the instance is greater than 1.

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 parameters

Parameter Type Required Example Description
Action String Yes DeleteShardingNode

The operation that you want to perform. Set the value to DeleteShardingNode.

RegionId String No cn-hangzhou

The region ID of the instance.

InstanceId String Yes r-bp1zxszhcgatnx****

The ID of the instance.

NodeId String No r-bp1zxszhcgatnx****-db-0,r-bp1zxszhcgatnx****-db-1

The ID of the data shard that you want to delete. You can specify multiple IDs at a time. Separate multiple IDs with commas (,).

Note To call the DeleteShardingNode operation, you must specify at least one of the NodeId and ShardCount parameters.
ShardCount Integer No 1

The number of shards that you want to delete. Shard deletion starts from the end of the shard list.

Note For example, the instance has the following five shards: db-0, db-1, db-2, db-3, and db-4. In this case, if you set this parameter to 2, db-3 and db-4 are deleted. To call the DeleteShardingNode operation, you must specify at least one of the NodeId and ShardCount parameters.

Response parameters

Parameter Type Example Description
RequestId String 5D622714-AEDD-4609-9167-F5DDD3D1****

The ID of the request.

Examples

Sample requests

http(s)://r-kvstore.aliyuncs.com/?Action=DeleteShardingNode
&InstanceId=r-bp1zxszhcgatnx****
&ShardCount=1
&Common request parameters

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<DeleteShardingNodeResponse>
	<RequestId>5D622714-AEDD-4609-9167-F5DDD3D1****</RequestId>
</DeleteShardingNodeResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "RequestId" : "5D622714-AEDD-4609-9167-F5DDD3D1****"
}

Error codes

For a list of error codes, visit the API Error Center.