vectorizer_sdk/client/core.rs
1//! Server-status surface: `health_check`.
2//!
3//! Lives in its own module because it doesn't fit any of the
4//! domain-specific surfaces (collections / vectors / search / ...)
5//! and likely grows to include `/metrics`, `/stats`, and similar
6//! observability endpoints in future releases.
7
8use super::VectorizerClient;
9use crate::error::{Result, VectorizerError};
10use crate::models::*;
11
12impl VectorizerClient {
13 /// Check server health.
14 pub async fn health_check(&self) -> Result<HealthStatus> {
15 let response = self.make_request("GET", "/health", None).await?;
16 let health: HealthStatus = serde_json::from_str(&response).map_err(|e| {
17 VectorizerError::server(format!("Failed to parse health check response: {e}"))
18 })?;
19 Ok(health)
20 }
21}