调用SplitShard接口分裂一个指定的readwrite状态的Shard。
接口说明
Host由Project名称和日志服务Endpoint构成,您需要在Host中指定Project。
请求头
该接口使用公共请求头,无特殊请求头。请参见公共请求参数文档。
请求语法
POST /logstores/{logstore}/shards/{shard}?action=split HTTP/1.1
请求参数
名称 | 类型 | 位置 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|---|
logstore | String | Path | 是 | logstorename |
Logstore名称。 |
key | String | Query | 否 | ef000000000000000000000000000000 |
分裂位置。 |
shardCount | Integer | Query | 否 | 2 |
Shard分裂个数。 |
返回数据
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
Server | String | nginx |
服务器名称。 |
Content-Type | String | application/json |
响应内容类型。目前Log Service服务端响应类型支持application/json、application/x-protobuf两种类型。 |
Content-Length | String | 20 |
响应内容长度。 |
Connection | String | close |
是否为长链接。取值包括:
|
Date | String | Sun, 27 May 2018 08:25:04 GMT |
当前返回响应的时间。 |
x-log-requestid | String | 5B0A6B60BB6EE39764D458B5 |
服务端产生的标识,该请求的唯一ID。 |
Array of shard |
返回的Shard列表。例如Shard数量为2,则返回3个Shard元素组成的数组,第一个Shard为原Shard,后两个为分裂后的Shard。 |
示例
请求示例
POST /logstores/logstorename/shards/0?action=split&key=ef000000000000000000000000000000&shardCount=2 HTTP/1.1
Host:ali-test-project.cn-hangzhou.log.aliyuncs.com
Content-Type:application/json
正常返回示例
JSON
格式
HTTP/1.1 200 OK
Content-Type:application/json
{
"shardID" : 33,
"status" : "readonly",
"inclusiveBeginKey" : "ee000000000000000000000000000000",
"exclusiveEndKey" : "ffffffffffffffffffffffffffffffff",
"createTime" : 1453949705
}
错误码
访问错误中心查看更多错误码。
HttpStatusCode |
ErrorCode |
ErrorMessage |
错误码描述 |
---|---|---|---|
404 |
ProjectNotExist |
Project does not exist. |
Project不存在。 |
404 |
LogStoreNotExist |
Logstore does not exist. |
Logstore不存在。 |
400 |
ParameterInvalid |
invalid shard id. |
无效Shard ID。 |
400 |
ParameterInvalid |
invalid mid hash. |
无效分裂位置参数。 |
400 |
LogStoreWithoutShard |
logstore has no shard. |
Logstore没有Shard。 |
500 |
InternalServerError |
Specified Server Error Message. |
内部服务调用错误。 |
更多信息,请参见通用错误码。