xianyun_cli/commands/
down.rs1use anyhow::Context as _;
6use clap::Args;
7use xianyun_core::config::caproni::load_from_context;
8use xianyun_core::config::global::Context;
9
10#[derive(Args, Debug)]
11pub struct DownArgs {}
12
13pub fn run(_args: &DownArgs, ctx: &Context) -> anyhow::Result<()> {
14 run_stop(ctx)
15}
16
17pub fn run_stop(ctx: &Context) -> anyhow::Result<()> {
20 crate::drivers::ensure_registered();
21
22 let container = load_from_context(ctx).context("loading configuration")?;
23
24 let manager = xianyun_cluster::registry::new_manager(
25 container.caproni.cluster.clone(),
26 container.global.profile_name.clone(),
27 )
28 .context("creating cluster manager")?;
29
30 manager.stop().context("stopping cluster")?;
31
32 Ok(())
33}