Skip to content

Commit 8196d52

Browse files
committed
refactor: introduce enum for node status
1 parent 7721136 commit 8196d52

2 files changed

Lines changed: 31 additions & 1 deletion

File tree

src/main/java/io/weaviate/client6/v1/api/cluster/Node.java

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,21 @@
66

77
public record Node(
88
@SerializedName("name") String name,
9-
@SerializedName("status") String status,
9+
@SerializedName("status") NodeStatus status,
10+
/** Commit hash of the Weaviate build the node is running. */
1011
@SerializedName("gitHash") String gitHash,
12+
/** Weaviate version the node is running. */
1113
@SerializedName("version") String version,
14+
/**
15+
* Can be {@code null} if "minimal" output is requested.
16+
*
17+
* @see NodeVerbosity#MINIMAL.
18+
*/
1219
@SerializedName("stats") CollectionStats stats,
20+
/**
21+
* Can be {@code null} if "minimal" output is requested.
22+
*
23+
* @see NodeVerbosity#MINIMAL.
24+
*/
1325
@SerializedName("shards") List<Shard> shards) {
1426
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package io.weaviate.client6.v1.api.cluster;
2+
3+
import com.google.gson.annotations.SerializedName;
4+
5+
public enum NodeStatus {
6+
/** The node is functional and operating normally. */
7+
@SerializedName("HEALTHY")
8+
HEALTHY,
9+
/** The node is down after encountering a problem. */
10+
@SerializedName("UNHEALTHY")
11+
UNHEALTHY,
12+
/** The node is not available. */
13+
@SerializedName("UNAVAILABLE")
14+
UNAVAILABLE,
15+
/** Liveness probe to a node timed out. */
16+
@SerializedName("TIMEOUT")
17+
TIMEOUT;
18+
};

0 commit comments

Comments
 (0)