Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
260113.0
260120.0
6 changes: 6 additions & 0 deletions crates/admin_cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use {
};

mod deploy;
mod maintenance;
mod migration;
mod operator;
mod settings;
Expand Down Expand Up @@ -38,6 +39,10 @@ enum Command {
#[command(subcommand)]
Migration(migration::Command),

/// Maintenance scheduling
#[command(subcommand)]
Maintenance(maintenance::Command),

/// Cluster settings management
#[command(subcommand)]
Settings(settings::Command),
Expand Down Expand Up @@ -97,6 +102,7 @@ async fn main() -> anyhow::Result<()> {
Command::View(args) => view::execute(args).await,
Command::Operator(cmd) => operator::execute(cmd).await,
Command::Migration(cmd) => migration::execute(cmd).await,
Command::Maintenance(cmd) => maintenance::execute(cmd).await,
Command::Settings(cmd) => settings::execute(cmd).await,
}
}
Expand Down
33 changes: 33 additions & 0 deletions crates/admin_cli/src/maintenance.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
use {crate::ClusterArgs, anyhow::Context, clap::Subcommand};

#[derive(Debug, Subcommand)]
pub enum Command {
/// Start maintenance
Start(ClusterArgs),

/// Finish maintenance
Finish(ClusterArgs),
}

pub(super) async fn execute(cmd: Command) -> anyhow::Result<()> {
match cmd {
Command::Start(args) => start_maintenance(args).await,
Command::Finish(args) => finish_maintenance(args).await,
}
}

async fn start_maintenance(args: ClusterArgs) -> anyhow::Result<()> {
args.connect()
.await?
.start_maintenance()
.await
.context("Cluster::start_maintenance")
}

async fn finish_maintenance(args: ClusterArgs) -> anyhow::Result<()> {
args.connect()
.await?
.finish_maintenance()
.await
.context("Cluster::finish_maintenance")
}
Loading