@cryptotaxi247 / CoPilot / commits / ac7d6ed2

made some node and shard fields optional

Taylor committed Oct 6, 2023 at 15:33 UTC ac7d6ed2bbebee9dae2e2be87c7fa40075d51fd6
1 file changed +7 -6
backend/app/connectors/wazuh_indexer/schema/monitoring.py
+7 -6
@@ -3,6 +3,7 @@ from typing import Optional
3 from typing import Union
4
5 from pydantic import BaseModel
6 +from pydantic import Field
7
8
9 class ClusterHealth(BaseModel):
@@ -32,10 +33,10 @@ class ClusterHealthResponse(BaseModel):
33
34
35 class NodeAllocation(BaseModel):
35 - disk_available: str
36 - disk_percent: str
37 - disk_total: str
38 - disk_used: str
36 + disk_available: Optional[str] = Field(None, description="Disk available in bytes")
37 + disk_percent: Optional[str] = Field(None, description="Disk percent")
38 + disk_total: Optional[str] = Field(None, description="Disk total in bytes")
39 + disk_used: Optional[str] = Field(None, description="Disk used in bytes")
40 node: str
41
42
@@ -61,10 +62,10 @@ class IndicesStatsResponse(BaseModel):
62
63 class Shards(BaseModel):
64 index: str
64 - node: str
65 + node: Optional[str] = Field(None, description="Node name")
66 shard: int
67 state: str
67 - size: str
68 + size: Optional[str] = Field(None, description="Shard size in bytes")
69
70
71 class ShardsResponse(BaseModel):