| 1 | import type { FlaskBaseResponse } from "@/types/flask.d" |
| 2 | import type { ClusterHealth, IndexAllocation, IndexShard, IndexStats } from "@/types/indices.d" |
| 3 | import { HttpClient } from "../../httpClient" |
| 4 | |
| 5 | // TODO-FE: refactor |
| 6 | export default { |
| 7 | getAllocation() { |
| 8 | return HttpClient.get<FlaskBaseResponse & { node_allocation: IndexAllocation[] }>("/wazuh_indexer/allocation") |
| 9 | }, |
| 10 | getIndices() { |
| 11 | return HttpClient.get<FlaskBaseResponse & { indices_stats: IndexStats[] }>("/wazuh_indexer/indices") |
| 12 | }, |
| 13 | getShards() { |
| 14 | return HttpClient.get<FlaskBaseResponse & { shards: IndexShard[] }>("/wazuh_indexer/shards") |
| 15 | }, |
| 16 | getClusterHealth() { |
| 17 | return HttpClient.get<FlaskBaseResponse & { cluster_health: ClusterHealth }>("/wazuh_indexer/health") |
| 18 | }, |
| 19 | getIndicesSizePerCustomer() { |
| 20 | return HttpClient.get<{ |
| 21 | customer_sizes: { |
| 22 | customer: string |
| 23 | total_size_bytes: number |
| 24 | total_size_human: string |
| 25 | index_count: number |
| 26 | indices: string[] |
| 27 | }[] |
| 28 | message: string |
| 29 | success: boolean |
| 30 | }>(`/wazuh_indexer/indices/size-per-customer`) |
| 31 | } |
| 32 | } |