Splits a shard in the Readwrite state.

Request syntax

POST /logstores/<logstorename>/shards/<shardid>? action=split&key=<splitkey> HTTP/1.1
Authorization: <AuthorizationString>
Date: <GMT Date>
Host: <Project Endpoint>
x-log-apiversion: 0.6.0
x-log-signaturemethod: hmac-sha1

Request parameters

  • Request headers

    The SplitShard operation does not have operation-specific request headers. For information about the common request headers of Log Service API operations, see Common request headers.

  • Parameters
    Parameter Type Required Example Description
    logstoreName string Yes logstorename The name of the Logstore.
    shardid int Yes 33 The ID of the shard.
    splitkey string Yes ef000000000000000000000000000000 The location where the shard is split.

Response parameters

  • Response headers

    The SplitShard operation does not have operation-specific response headers. For information about the common response headers of Log Service API operations, see Common response headers.

  • Response elements
    An array that consists of the parameters of three shards is returned. The first one is the original shard. The other two are the new shards that are generated after the split. The following example shows the array:
    [
        {
            "shardID": 33,
            "status": "readonly",
            "inclusiveBeginKey": "ee000000000000000000000000000000",
            "exclusiveEndKey": "ffffffffffffffffffffffffffffffff",
            "createTime": 1453949705
        },
        {
            "shardID": 163,
            "status": "readwrite",
            "inclusiveBeginKey": "ee000000000000000000000000000000",
            "exclusiveEndKey": "ef000000000000000000000000000000",
            "createTime": 1453949705
        },
        {
            "shardID": 164,
            "status": "readwrite",
            "inclusiveBeginKey": "ef000000000000000000000000000000",
            "exclusiveEndKey": "ffffffffffffffffffffffffffffffff",
            "createTime": 1453949705
        }
    ]

Examples

  • Sample requests
    POST /logstores/logstorename/shards/33? action=split&key=ef000000000000000000000000000000
    Header :
    {
        "Content-Length": 0, 
        "x-log-signaturemethod": "hmac-sha1", 
        "x-log-bodyrawsize": 0, 
        "User-Agent": "log-python-sdk-v-0.6.0", 
        "Host": "ali-test-project.cn-hangzhou.sls.aliyuncs.com", 
        "Date": "Thu, 12 Nov 2015 03:40:31 GMT", 
        "x-log-apiversion": "0.6.0", 
        "Authorization": "LOG <yourAccessKeyId>:<yourSignature>"
    }
  • Sample success responses
    Header:
    {
        "content-length": "57", 
        "server": "nginx/1.6.1", 
        "connection": "close", 
        "date": "Thu, 12 Nov 2015 03:40:31 GMT", 
        "content-type": "application/json", 
        "x-log-requestid": "56440A2F99248C050600C74C"
    }
    Body :
    [
        {
            "shardID": 33,
            "status": "readonly",
            "inclusiveBeginKey": "ee000000000000000000000000000000",
            "exclusiveEndKey": "ffffffffffffffffffffffffffffffff",
            "createTime": 1453949705
        },
        {
            "shardID": 163,
            "status": "readwrite",
            "inclusiveBeginKey": "ee000000000000000000000000000000",
            "exclusiveEndKey": "ef000000000000000000000000000000",
            "createTime": 1453949705
        },
        {
            "shardID": 164,
            "status": "readwrite",
            "inclusiveBeginKey": "ef000000000000000000000000000000",
            "exclusiveEndKey": "ffffffffffffffffffffffffffffffff",
            "createTime": 1453949705
        }
    ]

Error codes

HTTP status code Error code Error message Description
404 LogStoreNotExist logstore {logstoreName} does not exist. The error message returned because the specified Logstore does not exist.
400 ParameterInvalid invalid shard id. The error message returned because a parameter value is invalid.
400 ParameterInvalid invalid mid hash. The error message returned because a parameter value is invalid.
500 InternalServerError Specified Server Error Message. The error message returned because an internal server error has occurred.
400 LogStoreWithoutShard logstore has no shard. The error message returned because no shards exist in the Logstore.

For more information about the error codes, see Common error codes.