Checks whether a task to convert a table shard or shard a table is valid.

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 ValidateShardTask

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

DrdsInstanceId String Yes drds23ds****

The ID of the PolarDB-X 1.0 instance.

DbName String Yes test

The name of the database.

SourceTableName String Yes buyer

The name of the table or table shard on which you want to perform the task.

TargetTableName String Yes buyer_new

The name of the table or table shard on which you perform the task.

TaskType String Yes SINGLE_TO_SHARD

The type of the task. Valid values:

  • SINGLE_TO_SHARD: converts a single table to a table shard.
  • SHARD_TO_SINGLE: converts a table shard to a single table.
  • SHARD_TO_SHARD: converts a table shard to another table shard.
RegionId String No cn-hangzhou

The ID of the region where the PolarDB-X 1.0 instance is created.

Response parameters

Parameter Type Example Description
List Array of List

Indicates the check results.

Item String same_schema

Indicates the name of a check item.

Result Integer 0

Indicates the result of the check item. Valid values:

  • 0: indicates the task is valid.
  • 1: indicates the task is invalid.
RequestId String 0B6B7BDC-575D-4A77-A4F8-24B7EFAS45FG

Indicates the ID of the request.

Success Boolean true

Indicates whether the request is successful.

Examples

Sample requests

http(s)://[Endpoint]/?Action=ValidateShardTask
&DrdsInstanceId=drds23ds****
&DbName=test
&SourceTableName=buyer
&TargetTableName=buyer_new
&TaskType=SINGLE_TO_SHARD
&<Common request parameters>

Sample success responses

XML format

<RequestId>0B6B7BDC-575D-4A77-A4F8-24B7EFAS45FG</RequestId>
<List>
    <Item>same_schema</Item>
    <Result>0</Result>
</List>
<Success>true</Success>

JSON format

{"RequestId":"0B6B7BDC-575D-4A77-A4F8-24B7EFAS45FG","List":[{"Item":"same_schema","Result":"0"}],"Success":"true"}

Error codes

HttpCode Error code Error message Description
500 InternalError The request processing has failed due to some unknown error. The error message returned because an internal error has occurred.

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