閱讀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_日誌服務-阿裏雲