阅读57 返回首页    go 阿里云


ListShards__日志库相关接口_API-Reference_日志服务-阿里云

列出logstore下当前所有可用shard

请求语法

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

请求参数

参数名称 类型 是否必须 描述
logstoreName string 日志库名称

请求头

无特有请求头,关于API的公共请求头请参考公共请求头

响应头

  • Content-Type: application/json 无特有响应头,关于API的公共响应头请参考公共响应头

响应元素

shard元素组成的数组。

[
        {
            "shardID":0
            “status”: “readwrite",
            “inclusiveBeginKey”: "00000000000000000000000000000000",
               “exclusiveEndKey”: "8000000000000000000000000000000",
               “createTime”:1453949705
        },
        {
            ...
        },
        {
            ...
        }
]

细节描述

N/A

特有错误码

除了返回API的通用错误码,还可能返回如下特有错误码::

HTTP状态码 ErrorCode ErrorMessage
404 LogStoreNotExist logstore {logstoreName} not exist
500 InternalServerError Specified Server Error Message
400 LogStoreWithoutShard logstore has no shard

上表错误消息中{name}表示该部分会被具体的LogstoreName来替换。

示例

请求示例:
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 94to3z418yupi6ikawqqd370:xEOsJ3xeivcRq0GbvACiO37jH0I="
}
响应示例:
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
    }

]

最后更新:2016-11-23 16:04:02

  上一篇:go ListLogstore__日志库相关接口_API-Reference_日志服务-阿里云
  下一篇:go SplitShard__日志库相关接口_API-Reference_日志服务-阿里云