全部产品
存储与CDN 数据库 安全 应用服务 数加·人工智能 数加·大数据基础服务 互联网中间件 视频服务 开发者工具 解决方案 物联网 钉钉智能硬件
日志服务

SplitShard

更新时间:2017-06-07 13:26:11

分裂一个指定的 readwrite 状态的 shard。

请求语法

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

请求参数

参数名称 类型 是否必须 描述
logstoreName string 日志库名称
shardid int shard ID
splitkey string split 切分位置

请求头

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

响应头

Content-Type: application/json

无特有响应头。关于 API 的公共响应头,请参考 公共响应头

响应元素

3 个 shard 元素组成的数组,第一个 shard 为 split 之前的 shard,后两个为 split 的结果。

  1. [
  2. {
  3. "shardID":33
  4. status”: readonly",
  5. “inclusiveBeginKey”: "ee000000000000000000000000000000",
  6. “exclusiveEndKey”: "ffffffffffffffffffffffffffffffff",
  7. “createTime”:1453949705
  8. },
  9. {
  10. "shardID":163
  11. “status”: “readwrite",
  12. inclusiveBeginKey”: "ee000000000000000000000000000000",
  13. exclusiveEndKey”: "ef000000000000000000000000000000",
  14. createTime”:1453949705
  15. },
  16. {
  17. "shardID":164
  18. status”: readwrite",
  19. “inclusiveBeginKey”: "ef000000000000000000000000000000",
  20. “exclusiveEndKey”: "ffffffffffffffffffffffffffffffff",
  21. “createTime”:1453949705
  22. }
  23. ]

细节描述

N/A

特有错误码

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

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

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

示例

请求示例:
  1. POST /logstores/logstorename/shards/33?action=split&key=ef000000000000000000000000000000
  2. Header :
  3. {
  4. "Content-Length": 0,
  5. "x-log-signaturemethod": "hmac-sha1",
  6. "x-log-bodyrawsize": 0,
  7. "User-Agent": "log-python-sdk-v-0.6.0",
  8. "Host": "ali-test-project.cn-hangzhou.sls.aliyuncs.com",
  9. "Date": "Thu, 12 Nov 2015 03:40:31 GMT",
  10. "x-log-apiversion": "0.6.0",
  11. "Authorization": "LOG 94to3z418yupi6ikawqqd370:xEOsJ3xeidfdgRq0GbvACiO37jH0I="
  12. }
响应示例:
  1. Header:
  2. {
  3. "content-length": "57",
  4. "server": "nginx/1.6.1",
  5. "connection": "close",
  6. "date": "Thu, 12 Nov 2015 03:40:31 GMT",
  7. "content-type": "application/json",
  8. "x-log-requestid": "56440A2F99248C050600C74C"
  9. }
  10. Body :
  11. [
  12. {
  13. "shardID":33
  14. status”: readonly",
  15. “inclusiveBeginKey”: "ee000000000000000000000000000000",
  16. “exclusiveEndKey”: "ffffffffffffffffffffffffffffffff",
  17. “createTime”:1453949705
  18. },
  19. {
  20. "shardID":163
  21. “status”: “readwrite",
  22. inclusiveBeginKey”: "ee000000000000000000000000000000",
  23. exclusiveEndKey”: "ef000000000000000000000000000000",
  24. createTime”:1453949705
  25. },
  26. {
  27. "shardID":164
  28. status”: readwrite",
  29. “inclusiveBeginKey”: "ef000000000000000000000000000000",
  30. “exclusiveEndKey”: "ffffffffffffffffffffffffffffffff",
  31. “createTime”:1453949705
  32. }
  33. ]
本文导读目录