hive-c0re: annotate remaining dashboard routes with utoipa

This commit is contained in:
damocles 2026-07-31 23:00:12 +02:00 committed by mara
commit 582ebe5eee
21 changed files with 738 additions and 45 deletions

View file

@ -26,6 +26,7 @@ use std::time::Duration;
use serde::Serialize;
use tokio::time::sleep;
use utoipa::ToSchema;
use crate::coordinator::Coordinator;
@ -36,7 +37,7 @@ const CPU_SAMPLE: Duration = Duration::from_millis(200);
const MACHINE_SLICE: &str = "/sys/fs/cgroup/machine.slice";
#[derive(Debug, Serialize)]
#[derive(Debug, Serialize, ToSchema)]
pub struct ContainerResource {
/// Agent name (without the `h-` machine prefix).
pub name: String,

View file

@ -22,6 +22,7 @@ use std::time::Duration;
use rusqlite::{Connection, OpenFlags};
use serde::{Deserialize, Serialize};
use utoipa::ToSchema;
use crate::coordinator::Coordinator;
use hive_sh4re::wire_time::now_unix;
@ -168,13 +169,13 @@ fn resolve_prices(model: &str, table: &PriceTable) -> Prices {
}
}
#[derive(Debug, Serialize)]
#[derive(Debug, Serialize, ToSchema)]
pub struct KeyCount {
pub key: String,
pub count: u64,
}
#[derive(Debug, Serialize)]
#[derive(Debug, Serialize, ToSchema)]
pub struct AgentRollup {
pub name: String,
pub turns: u64,
@ -186,7 +187,7 @@ pub struct AgentRollup {
pub est_cost_usd: f64,
}
#[derive(Debug, Serialize)]
#[derive(Debug, Serialize, ToSchema)]
pub struct HiveStats {
pub window: &'static str,
pub from: i64,