Phase 5a: approval queue (request_apply_commit, pending/approve/deny)
This commit is contained in:
parent
4a73340150
commit
f12837fe32
7 changed files with 270 additions and 0 deletions
|
|
@ -6,6 +6,7 @@ use clap::{Parser, Subcommand};
|
|||
use hive_sh4re::{HostRequest, HostResponse};
|
||||
|
||||
mod agent_server;
|
||||
mod approvals;
|
||||
mod broker;
|
||||
mod client;
|
||||
mod coordinator;
|
||||
|
|
@ -45,6 +46,12 @@ enum Cmd {
|
|||
Rebuild { name: String },
|
||||
/// List managed containers.
|
||||
List,
|
||||
/// List pending approval requests submitted by the manager.
|
||||
Pending,
|
||||
/// Approve a pending request by id; the action runs immediately.
|
||||
Approve { id: i64 },
|
||||
/// Deny a pending request by id.
|
||||
Deny { id: i64 },
|
||||
}
|
||||
|
||||
#[tokio::main]
|
||||
|
|
@ -73,6 +80,9 @@ async fn main() -> Result<()> {
|
|||
render(client::request(&cli.socket, HostRequest::Rebuild { name }).await?)
|
||||
}
|
||||
Cmd::List => render(client::request(&cli.socket, HostRequest::List).await?),
|
||||
Cmd::Pending => render(client::request(&cli.socket, HostRequest::Pending).await?),
|
||||
Cmd::Approve { id } => render(client::request(&cli.socket, HostRequest::Approve { id }).await?),
|
||||
Cmd::Deny { id } => render(client::request(&cli.socket, HostRequest::Deny { id }).await?),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue