Skip to content

Commit

Permalink
..
Browse files Browse the repository at this point in the history
  • Loading branch information
infiniteregrets committed Sep 27, 2024
1 parent 6f8fd93 commit bff795b
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 50 deletions.
108 changes: 61 additions & 47 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ dirs = "5.0.1"
serde = { version = "1.0.210", features = ["derive"] }
thiserror = "1.0.63"
toml = "0.8.19"
s2 = { git = "ssh://[email protected]/s2-streamstore/s2.rs.git", branch = "main" }
s2 = { git = "ssh://[email protected]/s2-streamstore/s2.rs.git", branch = "basinstate-disp" }
tokio = { version = "*", features = ["full"] }
humantime = "2.1.0"
miette = { version = "7.2.0", features = ["fancy"] }
Expand Down
11 changes: 9 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use config::{config_path, create_config};
use error::S2CliError;
use s2::{
client::{Client, ClientConfig, HostCloud},
types::StorageClass,
types::{BasinMetadata, StorageClass},
};

mod account;
Expand Down Expand Up @@ -169,7 +169,14 @@ async fn run() -> Result<(), S2CliError> {
.await?;

for basin_metadata in response.basins {
println!("{}", basin_metadata.name);
let BasinMetadata { name, state, .. } = basin_metadata;

let state = match state {
s2::types::BasinState::Active => state.to_string().green(),
s2::types::BasinState::Deleting => state.to_string().red(),
_ => state.to_string().yellow(),
};
println!("{} {}", name, state);
}
}

Expand Down

0 comments on commit bff795b

Please sign in to comment.