From 10d56e307bbb61372f11ab435b790270cd589fee Mon Sep 17 00:00:00 2001 From: Noor Date: Mon, 14 Apr 2025 15:49:46 +0530 Subject: [PATCH] feat: app node report contract admin can report app node --- src/bin/detee-cli.rs | 2 -- src/sgx/cli_handler.rs | 12 +++++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/bin/detee-cli.rs b/src/bin/detee-cli.rs index ae625d9..9b598cd 100644 --- a/src/bin/detee-cli.rs +++ b/src/bin/detee-cli.rs @@ -282,7 +282,6 @@ fn clap_cmd() -> Command { .required(true) ) ) - /* .subcommand(Command::new("report").about("report a node for poor performance") .arg( Arg::new("pubkey") @@ -302,7 +301,6 @@ fn clap_cmd() -> Command { .help("detail the performance issue you experienced") ) ) - */ ) .subcommand(Command::new("vm") .about("virtual machines that run on AMD SEV-SNP nodes") diff --git a/src/sgx/cli_handler.rs b/src/sgx/cli_handler.rs index d23bbfc..a898ed0 100644 --- a/src/sgx/cli_handler.rs +++ b/src/sgx/cli_handler.rs @@ -39,11 +39,13 @@ pub fn handle_app_nodes(matches: &ArgMatches) { let ip: String = subcom_args.get_one::("ip").unwrap().clone(); cli_print(inspect_node(ip).map_err(Into::into)); } - Some(("report", _)) => { - // let node_pubkey: String = path_subcommand.get_one::("pubkey").unwrap().clone(); - // let contract_uuid: String = path_subcommand.get_one::("contract").unwrap().clone(); - // let reason: String = path_subcommand.get_one::("reason").unwrap().clone(); - todo!() + Some(("report", subcom_args)) => { + let node_pubkey: String = subcom_args.get_one::("pubkey").unwrap().clone(); + let contract_uuid: String = subcom_args.get_one::("contract").unwrap().clone(); + let reason: String = subcom_args.get_one::("reason").unwrap().clone(); + cli_print( + crate::general::report_node(node_pubkey, contract_uuid, reason).map_err(Into::into), + ) } _ => { eprintln!("Available commands are search, inspec and report. Use --help for more information.")