Struct podman_api::api::Pod
source · [−]pub struct Pod<'podman> { /* private fields */ }
Expand description
Interface for accessing and manipulating Podman Pod.
Implementations
sourceimpl<'podman> Pod<'podman>
impl<'podman> Pod<'podman>
sourcepub async fn start(&self) -> Result<PodStartReport>
pub async fn start(&self) -> Result<PodStartReport>
Start this pod.
Parameters:
- detach_keys - Override the key sequence for detaching a pod. Format is a single character [a-Z] or ctrl- where is one of: a-z, @, ^, [, , or _.
Examples:
async {
use podman_api::Podman;
let podman = Podman::unix("/run/user/1000/podman/podman.sock");
if let Err(e) = podman.pods().get("79c93f220e3e").start().await {
eprintln!("{}", e);
}
};
sourcepub async fn stop(&self) -> Result<PodStopReport>
pub async fn stop(&self) -> Result<PodStopReport>
Stop this pod.
Examples:
async {
use podman_api::Podman;
let podman = Podman::unix("/run/user/1000/podman/podman.sock");
if let Err(e) = podman.pods().get("79c93f220e3e").stop().await {
eprintln!("{}", e);
}
};
sourcepub async fn stop_with_timeout(&self, t: usize) -> Result<PodStopReport>
pub async fn stop_with_timeout(&self, t: usize) -> Result<PodStopReport>
Stop this pod with a timeout.
Examples:
async {
use podman_api::Podman;
let podman = Podman::unix("/run/user/1000/podman/podman.sock");
if let Err(e) = podman.pods().get("79c93f220e3e").stop_with_timeout(10).await {
eprintln!("{}", e);
}
};
sourcepub async fn inspect(&self) -> Result<LibpodPodInspectResponse>
pub async fn inspect(&self) -> Result<LibpodPodInspectResponse>
Return low-level information about this pod.
Examples:
async {
use podman_api::Podman;
let podman = Podman::unix("/run/user/1000/podman/podman.sock");
match podman.pods().get("79c93f220e3e").inspect().await {
Ok(info) => println!("{:?}", info),
Err(e) => eprintln!("{}", e),
}
};
sourcepub async fn send_signal(
&self,
signal: impl Into<String>
) -> Result<PodKillReport>
pub async fn send_signal(
&self,
signal: impl Into<String>
) -> Result<PodKillReport>
Send a signal to this pod.
Examples:
async {
use podman_api::Podman;
let podman = Podman::unix("/run/user/1000/podman/podman.sock");
if let Err(e) = podman.pods().get("79c93f220e3e").send_signal("SIGINT").await {
eprintln!("{}", e);
}
};
sourcepub async fn kill(&self) -> Result<PodKillReport>
pub async fn kill(&self) -> Result<PodKillReport>
Kill this pod.
Examples:
async {
use podman_api::Podman;
let podman = Podman::unix("/run/user/1000/podman/podman.sock");
if let Err(e) = podman.pods().get("79c93f220e3e").kill().await {
eprintln!("{}", e);
}
};
sourcepub async fn pause(&self) -> Result<PodPauseReport>
pub async fn pause(&self) -> Result<PodPauseReport>
Pause this pod.
Examples:
async {
use podman_api::Podman;
let podman = Podman::unix("/run/user/1000/podman/podman.sock");
if let Err(e) = podman.pods().get("79c93f220e3e").pause().await {
eprintln!("{}", e);
}
};
sourcepub async fn unpause(&self) -> Result<PodUnpauseReport>
pub async fn unpause(&self) -> Result<PodUnpauseReport>
Unpause this pod
Examples:
async {
use podman_api::Podman;
let podman = Podman::unix("/run/user/1000/podman/podman.sock");
if let Err(e) = podman.pods().get("79c93f220e3e").unpause().await {
eprintln!("{}", e);
}
};
sourcepub async fn restart(&self) -> Result<PodRestartReport>
pub async fn restart(&self) -> Result<PodRestartReport>
Restart this pod.
Examples:
async {
use podman_api::Podman;
let podman = Podman::unix("/run/user/1000/podman/podman.sock");
if let Err(e) = podman.pods().get("79c93f220e3e").restart().await {
eprintln!("{}", e);
}
};
sourcepub async fn delete(&self) -> Result<PodRmReport>
pub async fn delete(&self) -> Result<PodRmReport>
Delete this pod.
Examples:
async {
use podman_api::Podman;
let podman = Podman::unix("/run/user/1000/podman/podman.sock");
if let Err(e) = podman.pods().get("79c93f220e3e").delete().await {
eprintln!("{}", e);
}
};
sourcepub async fn remove(&self) -> Result<PodRmReport>
pub async fn remove(&self) -> Result<PodRmReport>
Force remove this pod.
Examples:
async {
use podman_api::Podman;
let podman = Podman::unix("/run/user/1000/podman/podman.sock");
if let Err(e) = podman.pods().get("79c93f220e3e").remove().await {
eprintln!("{}", e);
}
};
sourcepub async fn exists(&self) -> Result<bool>
pub async fn exists(&self) -> Result<bool>
Quick way to determine if a pod exists by name or ID.
Examples:
async {
use podman_api::Podman;
let podman = Podman::unix("/run/user/1000/podman/podman.sock");
match podman.pods().get("79c93f220e3e").exists().await {
Ok(exists) => if exists {
println!("pod exists!");
} else {
println!("pod doesn't exists!");
},
Err(e) => eprintln!("check failed: {}", e),
}
};
sourcepub async fn top(&self, opts: &PodTopOpts) -> Result<LibpodPodTopResponse>
pub async fn top(&self, opts: &PodTopOpts) -> Result<LibpodPodTopResponse>
List processes inside this pod.
Examples:
async {
use podman_api::Podman;
let podman = Podman::unix("/run/user/1000/podman/podman.sock");
match podman.pods().get("79c93f220e3e").top(&Default::default()).await {
Ok(info) => println!("{:?}", info),
Err(e) => eprintln!("{}", e),
}
};
sourcepub fn top_stream(
&self,
opts: &PodTopOpts
) -> impl Stream<Item = Result<LibpodPodTopResponse>> + Unpin + 'podman
pub fn top_stream(
&self,
opts: &PodTopOpts
) -> impl Stream<Item = Result<LibpodPodTopResponse>> + Unpin + 'podman
List processes inside this pod.
Only supported as of version > 4.0
Examples:
async {
use podman_api::Podman;
use futures_util::StreamExt;
let podman = Podman::unix("/run/user/1000/podman/podman.sock");
let mut stream = podman.pods().get("79c93f220e3e").top_stream(&Default::default());
while let Some(chunk) = stream.next().await {
match chunk{
Ok(chunk) => println!("{:?}", chunk),
Err(e) => eprintln!("{}", e),
}
}
};
sourcepub async fn generate_systemd_units(
&self,
opts: &SystemdUnitsOpts
) -> Result<Value>
pub async fn generate_systemd_units(
&self,
opts: &SystemdUnitsOpts
) -> Result<Value>
Generate Systemd Units based on this pod.
Examples:
async {
use podman_api::Podman;
let podman = Podman::unix("/run/user/1000/podman/podman.sock");
match podman
.pods()
.get("ea03584c0fd6")
.generate_systemd_units(&Default::default())
.await
{
Ok(info) => println!("{:?}", info),
Err(e) => eprintln!("{}", e),
}
};
Trait Implementations
Auto Trait Implementations
impl<'podman> !RefUnwindSafe for Pod<'podman>
impl<'podman> Send for Pod<'podman>
impl<'podman> Sync for Pod<'podman>
impl<'podman> Unpin for Pod<'podman>
impl<'podman> !UnwindSafe for Pod<'podman>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more