Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
138 changes: 136 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ tracing-appender = "0.2"
tracing-subscriber = { version = "0.3", features = ["json", "env-filter"] }
url = { version = "2", features = ["serde"] }
webbrowser = "1"
inquire = "0.9.4"

# The profile that 'dist' will build with
[profile.dist]
Expand Down
1 change: 1 addition & 0 deletions crates/tower-cmd/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ schemars = "1.0"
toml = { workspace = true }
toml_edit = { workspace = true }
tracing-subscriber = { workspace = true }
inquire = { workspace = true }

[dev-dependencies]
tempfile = "3.12"
Expand Down
60 changes: 60 additions & 0 deletions crates/tower-cmd/src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1010,6 +1010,17 @@ impl ResponseEntity for tower_api::apis::default_api::DescribeRunSuccess {
}
}

impl ResponseEntity for tower_api::apis::default_api::DescribeEnvironmentSuccess {
type Data = tower_api::models::DescribeEnvironmentResponse;

fn extract_data(self) -> Option<Self::Data> {
match self {
Self::Status200(resp) => Some(resp),
Self::UnknownValue(_) => None,
}
}
}

impl ResponseEntity for tower_api::apis::default_api::ListEnvironmentsSuccess {
type Data = tower_api::models::ListEnvironmentsResponse;

Expand All @@ -1021,6 +1032,17 @@ impl ResponseEntity for tower_api::apis::default_api::ListEnvironmentsSuccess {
}
}

impl ResponseEntity for tower_api::apis::default_api::DeleteEnvironmentSuccess {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this file is autogenerated, right? If not, I hate it :D

type Data = tower_api::models::DeleteEnvironmentResponse;

fn extract_data(self) -> Option<Self::Data> {
match self {
Self::Status200(resp) => Some(resp),
Self::UnknownValue(_) => None,
}
}
}

pub async fn list_environments(
config: &Config,
) -> Result<
Expand All @@ -1045,6 +1067,25 @@ pub async fn list_environments(
.await
}

pub async fn describe_environment(
config: &Config,
name: &str,
) -> Result<
tower_api::models::DescribeEnvironmentResponse,
Error<tower_api::apis::default_api::DescribeEnvironmentError>,
> {
let api_config = &config.into();

let params = tower_api::apis::default_api::DescribeEnvironmentParams {
name: name.to_string(),
};

unwrap_api_response(tower_api::apis::default_api::describe_environment(
api_config, params,
))
.await
}

pub async fn create_environment(
config: &Config,
name: &str,
Expand All @@ -1067,6 +1108,25 @@ pub async fn create_environment(
.await
}

pub async fn delete_environment(
config: &Config,
name: &str,
) -> Result<
tower_api::models::DeleteEnvironmentResponse,
Error<tower_api::apis::default_api::DeleteEnvironmentError>,
> {
let api_config = &config.into();

let params = tower_api::apis::default_api::DeleteEnvironmentParams {
name: name.to_string(),
};

unwrap_api_response(tower_api::apis::default_api::delete_environment(
api_config, params,
))
.await
}

pub async fn list_schedules(
config: &Config,
app_name: Option<&str>,
Expand Down
Loading
Loading