Skip to content
This repository has been archived by the owner on Jul 25, 2022. It is now read-only.

Add 'iml debugapi' to iml cli #2132

Merged
merged 11 commits into from
Aug 7, 2020
6 changes: 3 additions & 3 deletions iml-manager-cli/src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ pub struct ApiCommand {

path: String,

/// Object to PUT
object: Option<String>,
/// Object to PUT or POST
utopiabound marked this conversation as resolved.
Show resolved Hide resolved
body: Option<String>,
}

pub async fn api_cli(command: ApiCommand) -> Result<(), ImlManagerCliError> {
let term = Term::stdout();
let client = iml_manager_client::get_client()?;
let uri = iml_manager_client::create_api_url(command.path)?;
let body = command.object.unwrap_or("{}".to_string());
let body = command.body.unwrap_or("{}".to_string());

if let Some(resp) = match command.call {
ApiType::Delete => Some(client.delete(uri).send().await?),
Expand Down