Module service_client

Source
Expand description

HTTP client for the aranet-service REST API.

This module provides a client for interacting with the aranet-service background service. It allows checking service status, controlling the collector, and managing monitored devices.

§Example

use aranet_core::service_client::ServiceClient;

let client = ServiceClient::new("http://localhost:8080")?;

// Check if service is running
let status = client.status().await?;
println!("Collector running: {}", status.collector.running);

// Start the collector
client.start_collector().await?;

Ok(())

Structs§

CollectorActionResponse
Response from collector control actions.
CollectorStatus
Collector status.
DeviceCollectionStats
Collection statistics for a single device.
DeviceConfig
Device configuration for monitoring.
HealthResponse
Health check response.
ServerConfig
Server configuration.
ServiceClient
HTTP client for the aranet-service API.
ServiceConfig
Service configuration.
ServiceStatus
Service status response.

Enums§

ServiceClientError
Error type for service client operations.

Type Aliases§

Result
Result type for service client operations.