mirror of
https://github.com/edera-dev/krata.git
synced 2025-08-06 06:31:31 +00:00
23 lines
740 B
Rust
23 lines
740 B
Rust
![]() |
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")]
|
||
|
pub struct IdentifyHostCommand {}
|
||
|
|
||
|
impl IdentifyHostCommand {
|
||
|
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(())
|
||
|
}
|
||
|
}
|