use anyhow::Error;
use crate::common::app_context::AppContext;
use crate::http_client::MantaClient;
use crate::output::action_result;
use manta_shared::types::params::redfish_endpoints::UpdateRedfishEndpointParams;
pub async fn exec(
ctx: &AppContext<'_>,
token: &str,
params: UpdateRedfishEndpointParams,
output_opt: Option<&str>,
) -> Result<(), Error> {
let id = params.id.clone();
MantaClient::from_app_ctx(ctx)?
.update_redfish_endpoint(token, ¶ms)
.await?;
action_result::print(
&format!("Redfish endpoint '{id}' updated"),
output_opt,
)?;
Ok(())
}