added indices types
Davide Di Modica committed
Aug 16, 2023 at 22:10 UTC
6081ec3f5dcd1af6384d4fba947bc35f9ebcc04a
1 file changed
+55
src/types/indices.d.ts
new
+55
@@ -0,0 +1,55 @@
1
+export interface Index {
2
+ docs_count: string
3
+ health: IndexHealth
4
+ index: string
5
+ replica_count: string
6
+ store_size: string
7
+}
8
+
9
+// TODO: Better to use a status instead of a color
10
+export enum IndexHealth {
11
+ GREEN = "green",
12
+ YELLOW = "yellow",
13
+ RED = "red"
14
+}
15
+
16
+export interface IndexAllocation {
17
+ disk_available: null | string
18
+ disk_percent: null | string
19
+ disk_total: null | string
20
+ disk_used: null | string
21
+ node: string | "UNASSIGNED"
22
+}
23
+
24
+export interface IndexShard {
25
+ index: string
26
+ node: null | string
27
+ shard: string
28
+ size: null | string
29
+ state: IndexShardState
30
+}
31
+
32
+export enum IndexShardState {
33
+ STARTED = "STARTED",
34
+ UNASSIGNED = "UNASSIGNED"
35
+}
36
+
37
+export interface ClusterHealth {
38
+ active_primary_shards: number
39
+ active_shards: number
40
+ active_shards_percent_as_number: number
41
+ cluster_name: string
42
+ delayed_unassigned_shards: number
43
+ discovered_cluster_manager: boolean
44
+ discovered_master: boolean
45
+ initializing_shards: number
46
+ number_of_data_nodes: number
47
+ number_of_in_flight_fetch: number
48
+ number_of_nodes: number
49
+ number_of_pending_tasks: number
50
+ relocating_shards: number
51
+ status: string
52
+ task_max_waiting_in_queue_millis: number
53
+ timed_out: boolean
54
+ unassigned_shards: number
55
+}