Which shard of a sharded deployment owns which hash slots, the cluster's state, and any slots left open by a move that didn't finish
curl --request GET \
--url http://localhost:3001/api/clusters/{clusterName}/slots \
--cookie token=import requests
url = "http://localhost:3001/api/clusters/{clusterName}/slots"
headers = {"cookie": "token="}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {cookie: 'token='}};
fetch('http://localhost:3001/api/clusters/{clusterName}/slots', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "3001",
CURLOPT_URL => "http://localhost:3001/api/clusters/{clusterName}/slots",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_COOKIE => "token=",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "http://localhost:3001/api/clusters/{clusterName}/slots"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("cookie", "token=")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("http://localhost:3001/api/clusters/{clusterName}/slots")
.header("cookie", "token=")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:3001/api/clusters/{clusterName}/slots")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["cookie"] = 'token='
response = http.request(request)
puts response.read_body{
"state": "<string>",
"readAt": "2023-11-07T05:31:56Z",
"shards": [
{
"name": "<string>",
"ranges": [
[
"<unknown>"
]
],
"count": 123,
"primary": {
"pod": "<string>",
"nodeId": "<string>"
}
}
],
"otherPrimaries": [
{
"nodeId": "<string>",
"address": "<string>",
"ranges": [
[
"<unknown>"
]
],
"count": 123
}
],
"unassigned": [
[
"<unknown>"
]
],
"openSlots": [
{
"slot": 123,
"direction": "migrating",
"shard": "<string>",
"peerShard": "<string>"
}
]
}{
"error": "<string>",
"statusCode": 123,
"message": "<string>"
}{
"error": "<string>",
"statusCode": 123,
"message": "<string>"
}{
"error": "<string>",
"statusCode": 123,
"message": "<string>"
}{
"error": "<string>",
"statusCode": 123,
"message": "<string>"
}Cluster Operations
Which shard of a sharded deployment owns which hash slots, the cluster's state, and any slots left open by a move that didn't finish
Which shard of a sharded deployment owns which hash slots, the cluster’s state, and any slots left open by a move that didn’t finish. Read by a short read-only Job in the deployment’s namespace, so a read takes a few seconds; a read from the last 10 seconds is reused.
GET
/
api
/
clusters
/
{clusterName}
/
slots
Which shard of a sharded deployment owns which hash slots, the cluster's state, and any slots left open by a move that didn't finish
curl --request GET \
--url http://localhost:3001/api/clusters/{clusterName}/slots \
--cookie token=import requests
url = "http://localhost:3001/api/clusters/{clusterName}/slots"
headers = {"cookie": "token="}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {cookie: 'token='}};
fetch('http://localhost:3001/api/clusters/{clusterName}/slots', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "3001",
CURLOPT_URL => "http://localhost:3001/api/clusters/{clusterName}/slots",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_COOKIE => "token=",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "http://localhost:3001/api/clusters/{clusterName}/slots"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("cookie", "token=")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("http://localhost:3001/api/clusters/{clusterName}/slots")
.header("cookie", "token=")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:3001/api/clusters/{clusterName}/slots")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["cookie"] = 'token='
response = http.request(request)
puts response.read_body{
"state": "<string>",
"readAt": "2023-11-07T05:31:56Z",
"shards": [
{
"name": "<string>",
"ranges": [
[
"<unknown>"
]
],
"count": 123,
"primary": {
"pod": "<string>",
"nodeId": "<string>"
}
}
],
"otherPrimaries": [
{
"nodeId": "<string>",
"address": "<string>",
"ranges": [
[
"<unknown>"
]
],
"count": 123
}
],
"unassigned": [
[
"<unknown>"
]
],
"openSlots": [
{
"slot": 123,
"direction": "migrating",
"shard": "<string>",
"peerShard": "<string>"
}
]
}{
"error": "<string>",
"statusCode": 123,
"message": "<string>"
}{
"error": "<string>",
"statusCode": 123,
"message": "<string>"
}{
"error": "<string>",
"statusCode": 123,
"message": "<string>"
}{
"error": "<string>",
"statusCode": 123,
"message": "<string>"
}Authorizations
JWT token stored in HTTP-only cookie
Path Parameters
Query Parameters
namespace is required
Minimum string length:
1Response
Default Response
Show child attributes
Show child attributes
Show child attributes
Show child attributes
An inclusive range of hash slots, [start, end].
Required array length:
2 elementsShow child attributes
Show child attributes
Was this page helpful?