wasmer_cli/commands/app/deployments/
get.rs

1//! Get deployments for an app.
2
3use crate::{commands::AsyncCliCommand, config::WasmerEnv, opts::ItemFormatOpts};
4
5/// Get the volumes of an app.
6#[derive(clap::Parser, Debug)]
7pub struct CmdAppDeploymentGet {
8    #[clap(flatten)]
9    fmt: ItemFormatOpts,
10
11    #[clap(flatten)]
12    env: WasmerEnv,
13
14    /// ID of the deployment.
15    id: String,
16}
17
18#[async_trait::async_trait]
19impl AsyncCliCommand for CmdAppDeploymentGet {
20    type Output = ();
21
22    async fn run_async(mut self) -> Result<(), anyhow::Error> {
23        let client = self.env.client()?;
24        let item = wasmer_backend_api::query::app_deployment(&client, self.id).await?;
25
26        println!("{}", self.fmt.get().render(&item));
27        Ok(())
28    }
29}