Skip to content

Commit 3e2c356

Browse files
committed
rename stop to cancel
1 parent e4169f4 commit 3e2c356

6 files changed

Lines changed: 14 additions & 14 deletions

File tree

coman/src/cli.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ pub enum CscsJobCommands {
4545
#[clap(short, long, trailing_var_arg = true)]
4646
command: Option<Vec<String>>,
4747
},
48-
#[clap(alias("st"))]
49-
Stop { job_id: i64 },
48+
#[clap(alias("c"))]
49+
Cancel { job_id: i64 },
5050
}
5151
#[derive(Subcommand, Debug)]
5252
pub enum CscsSystemCommands {

coman/src/cscs/api_client.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ use color_eyre::eyre::{Context, Result};
33
use firecrest_client::{
44
client::FirecrestClient,
55
compute_api::{
6-
get_compute_system_job, get_compute_system_job_metadata, get_compute_system_jobs,
7-
post_compute_system_job, stop_compute_system_job,
6+
cancel_compute_system_job, get_compute_system_job, get_compute_system_job_metadata,
7+
get_compute_system_jobs, post_compute_system_job,
88
},
99
filesystem_api::{
1010
post_filesystem_ops_mkdir, post_filesystem_ops_upload, put_filesystem_ops_chmod,
@@ -322,8 +322,8 @@ impl CscsApi {
322322
Ok(Some((job, job_metadata).into()))
323323
}
324324

325-
pub async fn delete_stop(&self, system_name: &str, job_id: i64) -> Result<()> {
326-
stop_compute_system_job(&self.client, system_name, job_id)
325+
pub async fn cancel_job(&self, system_name: &str, job_id: i64) -> Result<()> {
326+
cancel_compute_system_job(&self.client, system_name, job_id)
327327
.await
328328
.wrap_err("couldn't delete job")?;
329329
Ok(())

coman/src/cscs/cli.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use std::path::PathBuf;
55
use crate::{
66
cscs::{
77
handlers::{
8-
cscs_job_stop, cscs_job_details, cscs_job_list, cscs_start_job, cscs_system_list,
8+
cscs_job_cancel, cscs_job_details, cscs_job_list, cscs_start_job, cscs_system_list,
99
},
1010
oauth2::{CLIENT_ID_SECRET_NAME, CLIENT_SECRET_SECRET_NAME, client_credentials_login},
1111
},
@@ -97,8 +97,8 @@ pub(crate) async fn cli_cscs_job_start(
9797
cscs_start_job(script_file, image, command).await
9898
}
9999

100-
pub(crate) async fn cli_cscs_job_stop(job_id: i64) -> Result<()> {
101-
cscs_job_stop(job_id).await
100+
pub(crate) async fn cli_cscs_job_cancel(job_id: i64) -> Result<()> {
101+
cscs_job_cancel(job_id).await
102102
}
103103

104104
pub(crate) async fn cli_cscs_system_list() -> Result<()> {

coman/src/cscs/handlers.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,13 @@ pub async fn cscs_job_details(job_id: i64) -> Result<Option<JobDetail>> {
8282
}
8383
}
8484

85-
pub async fn cscs_job_stop(job_id: i64) -> Result<()> {
85+
pub async fn cscs_job_cancel(job_id: i64) -> Result<()> {
8686
match get_access_token().await {
8787
Ok(access_token) => {
8888
let api_client = CscsApi::new(access_token.0).unwrap();
8989
let config = Config::new().unwrap();
9090
api_client
91-
.delete_stop(&config.cscs.current_system, job_id)
91+
.cancel_job(&config.cscs.current_system, job_id)
9292
.await
9393
}
9494
Err(e) => Err(e),

coman/src/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ use crate::{
2222
components::{global_listener::GlobalListener, toolbar::Toolbar, workload_list::WorkloadList},
2323
cscs::{
2424
cli::{
25-
cli_cscs_job_stop, cli_cscs_job_detail, cli_cscs_job_list, cli_cscs_job_start,
25+
cli_cscs_job_cancel, cli_cscs_job_detail, cli_cscs_job_list, cli_cscs_job_start,
2626
cli_cscs_login, cli_cscs_system_list,
2727
},
2828
ports::{AsyncDeviceFlowPort, AsyncFetchWorkloadsPort},
@@ -62,7 +62,7 @@ async fn main() -> Result<()> {
6262
image,
6363
command,
6464
} => cli_cscs_job_start(script_file, image, command).await?,
65-
cli::CscsJobCommands::Stop { job_id } => cli_cscs_job_stop(job_id).await?,
65+
cli::CscsJobCommands::Cancel { job_id } => cli_cscs_job_cancel(job_id).await?,
6666
},
6767
cli::CscsCommands::System { command } => match command {
6868
cli::CscsSystemCommands::List => cli_cscs_system_list().await?,

firecrest_client/src/compute_api.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ pub async fn get_compute_system_job_metadata(
103103
Ok(model)
104104
}
105105

106-
pub async fn stop_compute_system_job(
106+
pub async fn cancel_compute_system_job(
107107
client: &FirecrestClient,
108108
system_name: &str,
109109
job_id: i64,

0 commit comments

Comments
 (0)