分片请求
数据库分片的 REST API 请求
Redis 企业软件 |
---|
方法 | 路径 | 描述 |
---|---|---|
获取 | /v1/shards |
获取所有分片 |
获取 | /v1/shards/{uid} |
获取特定分片 |
获取所有分片
GET /v1/shards
获取有关集群中所有分片的信息。
请求
HTTP 请求示例
GET /v1/shards?extra_info_keys=used_memory_rss&extra_info_keys=connected_clients
请求标头
钥匙 | 价值 | 描述 |
---|---|---|
主机 | cnm.cluster.fqdn 中 | 域名 |
接受 | 应用程序/JSON | 接受的媒体类型 |
查询参数
田 | 类型 | 描述 |
---|---|---|
extra_info_keys | 字符串列表 | 要获取的额外键的列表(可选) |
响应
返回分片对象的 JSON 数组。
示例 JSON 正文
[
{
"uid": "1",
"role": "master",
"assigned_slots": "0-16383",
"bdb_uid": 1,
"detailed_status": "ok",
"loading": {
"status": "idle"
},
"node_uid": "1",
"redis_info": {
"connected_clients": 14,
"used_memory_rss": 12263424
},
"report_timestamp": "2024-06-28T18:44:01Z",
"status": "active"
},
{
"uid": 2,
"role": "slave",
// additional fields...
}
]
Status codes
Code
Description
200 OK
No error.
Get shard
GET /v1/shards/{int: uid}
Gets information about a single shard.
Request
Example HTTP request
GET /v1/shards/1?extra_info_keys=used_memory_rss&extra_info_keys=connected_clients
Request headers
Key
Value
Description
Host
cnm.cluster.fqdn
Domain name
Accept
application/json
Accepted media type
URL parameters
Field
Type
Description
uid
integer
The unique ID of the requested shard.
Query parameters
Field
Type
Description
extra_info_keys
list of strings
A list of extra keys to be fetched (optional)
Response
Returns a shard object.
Example JSON body
{
"assigned_slots": "0-16383",
"bdb_uid": 1,
"detailed_status": "ok",
"loading": {
"status": "idle"
},
"node_uid": "1",
"redis_info": {
"connected_clients": 14,
"used_memory_rss": 12263424
},
"role": "master",
"report_timestamp": "2024-06-28T18:44:01Z",
"status": "active",
"uid": "1"
}
Status codes
Code
Description
200 OK
No error.
404 Not Found
Shard UID does not exist.
On this page