feat(#2017): add hivectl agents list verb showing agent status + technical state
This commit is contained in:
parent
4407967a2f
commit
70d1cdc859
5 changed files with 186 additions and 0 deletions
|
|
@ -139,6 +139,22 @@ async fn dispatch(req: &HostRequest, coord: Arc<Coordinator>) -> HostResponse {
|
|||
}
|
||||
HostRequest::Rebuild { name } => handle_rebuild(&coord, name).await?,
|
||||
HostRequest::List => HostResponse::list(lifecycle::list().await?),
|
||||
HostRequest::AgentStatus => {
|
||||
let rows = crate::container_view::build_all(&coord)
|
||||
.await
|
||||
.into_iter()
|
||||
.map(|v| hive_sh4re::AgentStatusRow {
|
||||
name: v.name,
|
||||
running: v.running,
|
||||
needs_update: v.needs_update,
|
||||
needs_login: v.needs_login,
|
||||
deployed_sha: v.deployed_sha,
|
||||
pending_reminders: v.pending_reminders,
|
||||
parent: v.parent,
|
||||
})
|
||||
.collect();
|
||||
HostResponse::agent_statuses(rows)
|
||||
}
|
||||
// The hive domain is injected into c0re's service env by
|
||||
// hive-c0re.nix (`HYPERHIVE_HIVE_DOMAIN`); surface it so the
|
||||
// operator CLI can fill in this hive's own identity.
|
||||
|
|
@ -246,6 +262,7 @@ async fn handle_restart_all() -> Result<HostResponse> {
|
|||
agents: Some(ok_agents),
|
||||
approvals: None,
|
||||
domain: None,
|
||||
agent_statuses: None,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
@ -414,6 +431,7 @@ fn finish_lifecycle(ok_items: Vec<String>, errors: &[String]) -> HostResponse {
|
|||
agents: Some(ok_items),
|
||||
approvals: None,
|
||||
domain: None,
|
||||
agent_statuses: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue