let store = required_string_param(¶m, "store")?;
- let mut client = connect_to_localhost()?;
+ let client = connect_to_localhost()?;
let path = format!("api2/json/admin/datastore/{}/gc", store);
let result = client.post(&path, None).await?;
- view_task_result(&mut client, result, &output_format).await?;
+ view_task_result(&client, result, &output_format).await?;
Ok(Value::Null)
}
let upid = required_string_param(¶m, "upid")?;
- let mut client = connect_to_localhost()?;
+ let client = connect_to_localhost()?;
- display_task_log(&mut client, upid, true).await?;
+ display_task_log(&client, upid, true).await?;
Ok(Value::Null)
}
let upid_str = required_string_param(¶m, "upid")?;
- let mut client = connect_to_localhost()?;
+ let client = connect_to_localhost()?;
let path = format!("api2/json/nodes/localhost/tasks/{}", percent_encode_component(upid_str));
let _ = client.delete(&path, None).await?;
let output_format = get_output_format(¶m);
- let mut client = connect_to_localhost()?;
+ let client = connect_to_localhost()?;
let mut args = json!({
"store": local_store,
let result = client.post("api2/json/pull", Some(args)).await?;
- view_task_result(&mut client, result, &output_format).await?;
+ view_task_result(&client, result, &output_format).await?;
Ok(Value::Null)
}
let output_format = extract_output_format(&mut param);
- let mut client = connect_to_localhost()?;
+ let client = connect_to_localhost()?;
let args = json!(param);
let result = client.post(&path, Some(args)).await?;
- view_task_result(&mut client, result, &output_format).await?;
+ view_task_result(&client, result, &output_format).await?;
Ok(Value::Null)
}
let drive = extract_drive_name(&mut param, &config)?;
- let mut client = connect_to_localhost()?;
+ let client = connect_to_localhost()?;
let path = format!("api2/json/tape/drive/{}/format-media", drive);
let result = client.post(&path, Some(param)).await?;
- view_task_result(&mut client, result, &output_format).await?;
+ view_task_result(&client, result, &output_format).await?;
Ok(())
}
let drive = extract_drive_name(&mut param, &config)?;
- let mut client = connect_to_localhost()?;
+ let client = connect_to_localhost()?;
let path = format!("api2/json/tape/drive/{}/rewind", drive);
let result = client.post(&path, Some(param)).await?;
- view_task_result(&mut client, result, &output_format).await?;
+ view_task_result(&client, result, &output_format).await?;
Ok(())
}
let drive = extract_drive_name(&mut param, &config)?;
- let mut client = connect_to_localhost()?;
+ let client = connect_to_localhost()?;
let path = format!("api2/json/tape/drive/{}/eject-media", drive);
let result = client.post(&path, Some(param)).await?;
- view_task_result(&mut client, result, &output_format).await?;
+ view_task_result(&client, result, &output_format).await?;
Ok(())
}
let drive = extract_drive_name(&mut param, &config)?;
- let mut client = connect_to_localhost()?;
+ let client = connect_to_localhost()?;
let path = format!("api2/json/tape/drive/{}/load-media", drive);
let result = client.post(&path, Some(param)).await?;
- view_task_result(&mut client, result, &output_format).await?;
+ view_task_result(&client, result, &output_format).await?;
Ok(())
}
let drive = extract_drive_name(&mut param, &config)?;
- let mut client = connect_to_localhost()?;
+ let client = connect_to_localhost()?;
let path = format!("api2/json/tape/drive/{}/export-media", drive);
client.put(&path, Some(param)).await?;
let drive = extract_drive_name(&mut param, &config)?;
- let mut client = connect_to_localhost()?;
+ let client = connect_to_localhost()?;
let path = format!("api2/json/tape/drive/{}/load-slot", drive);
client.put(&path, Some(param)).await?;
let drive = extract_drive_name(&mut param, &config)?;
- let mut client = connect_to_localhost()?;
+ let client = connect_to_localhost()?;
let path = format!("api2/json/tape/drive/{}/unload", drive);
let result = client.post(&path, Some(param)).await?;
- view_task_result(&mut client, result, &output_format).await?;
+ view_task_result(&client, result, &output_format).await?;
Ok(())
}
let drive = extract_drive_name(&mut param, &config)?;
- let mut client = connect_to_localhost()?;
+ let client = connect_to_localhost()?;
let path = format!("api2/json/tape/drive/{}/label-media", drive);
let result = client.post(&path, Some(param)).await?;
- view_task_result(&mut client, result, &output_format).await?;
+ view_task_result(&client, result, &output_format).await?;
Ok(())
}
let do_read = read_labels.unwrap_or(false) || read_all_labels.unwrap_or(false);
- let mut client = connect_to_localhost()?;
+ let client = connect_to_localhost()?;
let path = format!("api2/json/tape/drive/{}/inventory", drive);
}
let result = client.put(&path, Some(param)).await?; // update inventory
- view_task_result(&mut client, result, &output_format).await?;
+ view_task_result(&client, result, &output_format).await?;
}
let mut result = client.get(&path, None).await?;
let drive = extract_drive_name(&mut param, &config)?;
- let mut client = connect_to_localhost()?;
+ let client = connect_to_localhost()?;
let path = format!("api2/json/tape/drive/{}/barcode-label-media", drive);
let result = client.post(&path, Some(param)).await?;
- view_task_result(&mut client, result, &output_format).await?;
+ view_task_result(&client, result, &output_format).await?;
Ok(())
}
let drive = extract_drive_name(&mut param, &config)?;
- let mut client = connect_to_localhost()?;
+ let client = connect_to_localhost()?;
let path = format!("api2/json/tape/drive/{}/clean", drive);
let result = client.put(&path, Some(param)).await?;
- view_task_result(&mut client, result, &output_format).await?;
+ view_task_result(&client, result, &output_format).await?;
Ok(())
}
param["drive"] = extract_drive_name(&mut param, &config)?.into();
- let mut client = connect_to_localhost()?;
+ let client = connect_to_localhost()?;
let result = client.post("api2/json/tape/backup", Some(param)).await?;
- view_task_result(&mut client, result, &output_format).await?;
+ view_task_result(&client, result, &output_format).await?;
Ok(())
}
param["drive"] = extract_drive_name(&mut param, &config)?.into();
- let mut client = connect_to_localhost()?;
+ let client = connect_to_localhost()?;
let result = client.post("api2/json/tape/restore", Some(param)).await?;
- view_task_result(&mut client, result, &output_format).await?;
+ view_task_result(&client, result, &output_format).await?;
Ok(())
}
let drive = extract_drive_name(&mut param, &config)?;
- let mut client = connect_to_localhost()?;
+ let client = connect_to_localhost()?;
let path = format!("api2/json/tape/drive/{}/catalog", drive);
let result = client.post(&path, Some(param)).await?;
- view_task_result(&mut client, result, &output_format).await?;
+ view_task_result(&client, result, &output_format).await?;
Ok(())
}