2024-04-21 21:00:32 -07:00
|
|
|
use anyhow::Result;
|
|
|
|
use clap::Parser;
|
|
|
|
use krata::v1::control::{control_service_client::ControlServiceClient, IdentifyHostRequest};
|
|
|
|
|
|
|
|
use tonic::{transport::Channel, Request};
|
|
|
|
|
|
|
|
#[derive(Parser)]
|
|
|
|
#[command(about = "Identify information about the host")]
|
2024-07-18 23:13:29 -07:00
|
|
|
pub struct HostIdentifyCommand {}
|
2024-04-21 21:00:32 -07:00
|
|
|
|
2024-07-18 23:13:29 -07:00
|
|
|
impl HostIdentifyCommand {
|
2024-04-21 21:00:32 -07:00
|
|
|
pub async fn run(self, mut client: ControlServiceClient<Channel>) -> Result<()> {
|
|
|
|
let response = client
|
|
|
|
.identify_host(Request::new(IdentifyHostRequest {}))
|
|
|
|
.await?
|
|
|
|
.into_inner();
|
|
|
|
println!("Host UUID: {}", response.host_uuid);
|
|
|
|
println!("Host Domain: {}", response.host_domid);
|
|
|
|
println!("Krata Version: {}", response.krata_version);
|
|
|
|
Ok(())
|
|
|
|
}
|
|
|
|
}
|