REST - /v1/nodes
Usage
The nodes endpoint accepts a GET
request:
GET /v1/nodes
And it returns a nodes
field containing array of nodes with the following fields:
name
: Name of the node.status
: Status of the node (one of: HEALTHY, UNHEALTHY, UNAVAILABLE, INDEXING).version
: Version of Weaviate running on the node.gitHash
: Short git hash of latest commit of Weaviate running on the node.stats
: Statistics of the node with the following fields:shardCount
: Total number of shards on the node.objectCount
Total number of indexed objects on the node.
shards
: Array of shards with the following fields:name
: Name of the shard.class
: Name of the objects' class stored on the shard.objectCount
: Number of indexed objects on the shard.vectorQueueLength
: Number of objects waiting to be indexed on the shard. (Available in Weaviate1.22
and higher, ifASYNC_INDEXING
is enabled.)
Example
The following command will retrieve summary information about all nodes in the cluster:
- Python
- JavaScript/TypeScript
- Go
- Java
- Curl
import weaviate
client = weaviate.Client("http://localhost:8080")
nodes_status = client.cluster.get_nodes_status()
print(nodes_status)
import weaviate from 'weaviate-ts-client';
const client = weaviate.client({
scheme: 'http',
host: 'localhost:8080',
});
const response = await client.cluster
.nodesStatusGetter()
.do();
console.log(response);
package main
import (
"context"
"fmt"
"github.com/weaviate/weaviate-go-client/v4/weaviate"
)
func main() {
cfg := weaviate.Config{
Host: "localhost:8080",
Scheme: "http",
}
client, err := weaviate.NewClient(cfg)
if err != nil {
panic(err)
}
nodesStatus, err := client.Cluster().
NodesStatusGetter().
Do(context.Background())
if err != nil {
panic(err)
}
fmt.Printf("%v", nodesStatus)
}
package io.weaviate;
import io.weaviate.client.Config;
import io.weaviate.client.WeaviateClient;
import io.weaviate.client.base.Result;
import io.weaviate.client.v1.cluster.model.NodesStatusResponse;
public class App {
public static void main(String[] args) {
Config config = new Config("http", "localhost:8080");
WeaviateClient client = new WeaviateClient(config);
Result<NodesStatusResponse> result = client.cluster()
.nodesStatusGetter()
.run();
if (result.hasErrors()) {
System.out.println(result.getError());
return;
}
System.out.println(result.getResult());
}
}
curl http://localhost:8080/v1/nodes
Example output (format may slightly vary depending on the client used):
{
"nodes": [
{
"batchStats": {
"ratePerSecond": 0
},
"gitHash": "e6b37ce",
"name": "weaviate-0",
"shards": [
{
"class": "TestArticle",
"name": "nq1Bg9Q5lxxP",
"objectCount": 0,
"vectorIndexingStatus": "READY",
"vectorQueueLength": 0
},
{
"class": "TestAuthor",
"name": "MINLtCghkdG8",
"objectCount": 0,
"vectorIndexingStatus": "READY",
"vectorQueueLength": 0
}
],
"stats": {
"objectCount": 0,
"shardCount": 2
},
"status": "HEALTHY",
"version": "1.22.1"
},
{
"batchStats": {
"ratePerSecond": 0
},
"gitHash": "e6b37ce",
"name": "weaviate-1",
"shards": [
{
"class": "TestArticle",
"name": "HuPocHE5w2LP",
"objectCount": 1,
"vectorIndexingStatus": "READY",
"vectorQueueLength": 0
},
{
"class": "TestAuthor",
"name": "PeQjZRmK0xNB",
"objectCount": 0,
"vectorIndexingStatus": "READY",
"vectorQueueLength": 0
}
],
"stats": {
"objectCount": 1,
"shardCount": 2
},
"status": "HEALTHY",
"version": "1.22.1"
},
{
"batchStats": {
"ratePerSecond": 0
},
"gitHash": "e6b37ce",
"name": "weaviate-2",
"shards": [
{
"class": "TestArticle",
"name": "JTg39c7ZlFUX",
"objectCount": 0,
"vectorIndexingStatus": "READY",
"vectorQueueLength": 0
},
{
"class": "TestAuthor",
"name": "W5ulmuJGDTxj",
"objectCount": 1,
"vectorIndexingStatus": "READY",
"vectorQueueLength": 0
}
],
"stats": {
"objectCount": 1,
"shardCount": 2
},
"status": "HEALTHY",
"version": "1.22.1"
}
]
}