podman_client/containers/
pause.rs

1use http_body_util::Empty;
2use hyper::body::Bytes;
3
4use crate::{
5    client::Client,
6    models::{
7        connection::SendRequestOptions, lib::Error,
8        podman::containers::pause::ContainerPauseOptions,
9    },
10};
11
12impl Client {
13    pub async fn container_pause(&self, options: ContainerPauseOptions<'_>) -> Result<(), Error> {
14        let (_, data) = self
15            .send_request::<_, (), _>(SendRequestOptions {
16                method: "POST",
17                path: &["/libpod/containers/", options.name, "/pause"].concat(),
18                header: None,
19                body: Empty::<Bytes>::new(),
20            })
21            .await?;
22
23        Ok(data)
24    }
25}