redis_enterprise/
local.rs

1//! Local node operations and health checks
2//!
3//! ## Overview
4//! - Query local node status
5//! - Perform health checks
6//! - Manage local services
7
8use crate::client::RestClient;
9use crate::error::Result;
10use serde_json::Value;
11
12pub struct LocalHandler {
13    client: RestClient,
14}
15
16impl LocalHandler {
17    pub fn new(client: RestClient) -> Self {
18        LocalHandler { client }
19    }
20
21    /// Master healthcheck for local node - GET /v1/local/node/master_healthcheck
22    pub async fn master_healthcheck(&self) -> Result<Value> {
23        self.client.get("/v1/local/node/master_healthcheck").await
24    }
25
26    /// List local services - GET /v1/local/services
27    pub async fn services(&self) -> Result<Value> {
28        self.client.get("/v1/local/services").await
29    }
30
31    /// Create/update local services - POST /v1/local/services
32    pub async fn services_update(&self, body: Value) -> Result<Value> {
33        self.client.post("/v1/local/services", &body).await
34    }
35}