diff --git a/cargo-shuttle/src/args.rs b/cargo-shuttle/src/args.rs index aeaa148ea..9ee958fb2 100644 --- a/cargo-shuttle/src/args.rs +++ b/cargo-shuttle/src/args.rs @@ -176,11 +176,7 @@ pub enum ProjectCommand { idle_minutes: u64, }, /// List all projects belonging to the calling account - List { - #[arg(long)] - /// Return projects filtered by a given project status - filter: Option, - }, + List, } #[derive(Parser, Clone, Debug)] diff --git a/cargo-shuttle/src/client.rs b/cargo-shuttle/src/client.rs index 38084b8ab..e22e82bde 100644 --- a/cargo-shuttle/src/client.rs +++ b/cargo-shuttle/src/client.rs @@ -134,15 +134,6 @@ impl Client { self.get(path).await } - pub async fn get_projects_list_filtered( - &self, - filter: String, - ) -> Result> { - let path = format!("/projects/{filter}"); - - self.get(path).await - } - pub async fn delete_project(&self, project: &ProjectName) -> Result { let path = format!("/projects/{}", project.as_str()); diff --git a/cargo-shuttle/src/lib.rs b/cargo-shuttle/src/lib.rs index e3e31ac77..358d81266 100644 --- a/cargo-shuttle/src/lib.rs +++ b/cargo-shuttle/src/lib.rs @@ -7,7 +7,7 @@ mod provisioner_server; use indicatif::ProgressBar; use shuttle_common::claims::{ClaimService, InjectPropagation}; use shuttle_common::models::deployment::get_deployments_table; -use shuttle_common::models::project::{State, IDLE_MINUTES}; +use shuttle_common::models::project::IDLE_MINUTES; use shuttle_common::models::resource::get_resources_table; use shuttle_common::project::ProjectName; use shuttle_common::resource; @@ -127,9 +127,7 @@ impl Shuttle { Command::Project(ProjectCommand::Status { follow }) => { self.project_status(&self.client()?, follow).await } - Command::Project(ProjectCommand::List { filter }) => { - self.projects_list(&self.client()?, filter).await - } + Command::Project(ProjectCommand::List) => self.projects_list(&self.client()?).await, Command::Project(ProjectCommand::Stop) => self.project_delete(&self.client()?).await, } .map(|_| CommandOutcome::Ok) @@ -986,20 +984,8 @@ impl Shuttle { Ok(()) } - async fn projects_list(&self, client: &Client, filter: Option) -> Result<()> { - let projects = match filter { - Some(filter) => { - if let Ok(filter) = State::from_str(filter.trim()) { - client - .get_projects_list_filtered(filter.to_string()) - .await? - } else { - bail!("That's not a valid project status!"); - } - } - None => client.get_projects_list().await?, - }; - + async fn projects_list(&self, client: &Client) -> Result<()> { + let projects = client.get_projects_list().await?; let projects_table = project::get_table(&projects); println!("{projects_table}"); diff --git a/gateway/src/api/latest.rs b/gateway/src/api/latest.rs index 1118e4077..42dbe550e 100644 --- a/gateway/src/api/latest.rs +++ b/gateway/src/api/latest.rs @@ -133,24 +133,6 @@ async fn get_projects_list( Ok(AxumJson(projects)) } -// async fn get_projects_list_with_filter( -// State(RouterState { service, .. }): State, -// User { name, .. }: User, -// Path(project_status): Path, -// ) -> Result>, Error> { -// let projects = service -// .iter_user_projects_detailed_filtered(name.clone(), project_status) -// .await? -// .into_iter() -// .map(|project| project::Response { -// name: project.0.to_string(), -// state: project.1.into(), -// }) -// .collect(); - -// Ok(AxumJson(projects)) -// } - #[instrument(skip_all, fields(%project))] #[utoipa::path( post,