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
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
260209.0
260209.1
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 ownership;
Expand Down Expand Up @@ -39,6 +40,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 @@ -137,6 +142,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,
Command::Ownership(cmd) => ownership::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(super) 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")
}