Lists all available shards of a Logstore.

Request syntax

GET /logstores/<logstorename>/shards 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 ListShards 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 sls-test-logstore The name of the Logstore.

Response parameters

  • Response headers

    The ListShards 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 the shards is returned. The following example shows the array:
    [
        {
            "shardID": 0,
            "status": "readwrite",
            "inclusiveBeginKey": "00000000000000000000000000000000",
            "exclusiveEndKey": "8000000000000000000000000000000",
            "createTime": 1453949705
        },
        {
            ...
        },
        {
            ...
        }
    ]

Examples

  • Sample requests
    GET /logstores/sls-test-logstore/shards
    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-devcommon-intranet.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": 1,
            "status": "readwrite",
            "inclusiveBeginKey": "00000000000000000000000000000000",
            "exclusiveEndKey": "8000000000000000000000000000000",
            "createTime": 1453949705
        },
        {
            "shardID": 2,
            "status": "readwrite",
            "inclusiveBeginKey": "80000000000000000000000000000000",
            "exclusiveEndKey": "ffffffffffffffffffffffffffffffff",
            "createTime": 1453949705
        },
        {
            "shardID": 0,
            "status": "readonly",
            "inclusiveBeginKey": "00000000000000000000000000000000",
            "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.
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.