podman_client/manifests/
add_image.rs1use http_body_util::Full;
2use hyper::body::Bytes;
3
4use crate::{
5 client::Client,
6 models::{
7 connection::SendRequestOptions,
8 lib::Error,
9 podman::manifests::add_image::{ManifestAddImage, ManifestAddImageOptions},
10 },
11};
12
13impl Client {
14 pub async fn manifest_add_image(
15 &self,
16 options: ManifestAddImageOptions<'_>,
17 ) -> Result<ManifestAddImage, Error> {
18 let (_, data) = self
19 .send_request::<_, (), _>(SendRequestOptions {
20 method: "POST",
21 path: &["/libpod/manifests/", options.name, "/add"].concat(),
22 header: None,
23 body: Full::new(Bytes::from(serde_json::to_string(&options.request)?)),
24 })
25 .await?;
26
27 Ok(data)
28 }
29}