Struct podman_api::api::Secrets
source · pub struct Secrets { /* private fields */ }
Expand description
Handle for Podman Secrets.
Implementations§
source§impl Secrets
impl Secrets
sourcepub async fn list(&self) -> Result<Vec<SecretInfoReport>>
pub async fn list(&self) -> Result<Vec<SecretInfoReport>>
List available secrets.
Examples:
async {
use podman_api::Podman;
let podman = Podman::unix("/run/user/1000/podman/podman.sock");
match podman.secrets().list().await {
Ok(info) => println!("{:?}", info),
Err(e) => eprintln!("{}", e),
}
};
sourcepub async fn create(
&self,
opts: &SecretCreateOpts,
secret: impl Into<String>
) -> Result<Secret>
pub async fn create(
&self,
opts: &SecretCreateOpts,
secret: impl Into<String>
) -> Result<Secret>
Create a new secret.
Examples:
async {
use podman_api::Podman;
use podman_api::opts::SecretCreateOpts;
let podman = Podman::unix("/run/user/1000/podman/podman.sock");
match podman.secrets().create(
&SecretCreateOpts::builder("my-secret").build(),
"secret-value"
).await {
Ok(info) => println!("{:?}", info),
Err(e) => eprintln!("{}", e),
}
};