pub struct DockerEngineClient<C: Connect + Clone + Send + Sync + 'static> { /* private fields */ }
Expand description
DockerEngineClient is the API client that performs all operations against a docker server.
Implementations§
Source§impl<C: Connect + Clone + Send + Sync + 'static> DockerEngineClient<C>
impl<C: Connect + Clone + Send + Sync + 'static> DockerEngineClient<C>
Sourcepub async fn container_list(
&self,
options: Option<ContainerListOptions>,
) -> Result<Vec<Container>, Error>
pub async fn container_list( &self, options: Option<ContainerListOptions>, ) -> Result<Vec<Container>, Error>
container_list returns the list of containers in the docker host.
Sourcepub async fn container_create(
&self,
config: ContainerConfig,
container_name: Option<String>,
) -> Result<ContainerCreateCreatedBody, Error>
pub async fn container_create( &self, config: ContainerConfig, container_name: Option<String>, ) -> Result<ContainerCreateCreatedBody, Error>
container_create creates a new container based in the given configuration. It can be associated with a name, but it’s not mandatory.
Sourcepub async fn container_inspect(
&self,
container_id: &str,
) -> Result<Container, Error>
pub async fn container_inspect( &self, container_id: &str, ) -> Result<Container, Error>
container_inspect returns the container information.
Sourcepub async fn container_top(
&self,
container_id: &str,
arguments: Option<Vec<String>>,
) -> Result<ContainerTopOKBody, Error>
pub async fn container_top( &self, container_id: &str, arguments: Option<Vec<String>>, ) -> Result<ContainerTopOKBody, Error>
container_top shows process information from within a container.
Sourcepub async fn container_logs(
&self,
container_id: &str,
options: Option<ContainerLogsOptions>,
) -> Result<LogStream, Error>
pub async fn container_logs( &self, container_id: &str, options: Option<ContainerLogsOptions>, ) -> Result<LogStream, Error>
container_logs returns the logs generated by a container. Currently only supports TTY containers.
Sourcepub async fn container_diff(
&self,
container_id: &str,
) -> Result<Option<Vec<ContainerChangeResponseItem>>, Error>
pub async fn container_diff( &self, container_id: &str, ) -> Result<Option<Vec<ContainerChangeResponseItem>>, Error>
container_diff shows differences in a container filesystem since it was started.
Sourcepub async fn container_export(
&self,
container_id: &str,
) -> Result<Vec<u8>, Error>
pub async fn container_export( &self, container_id: &str, ) -> Result<Vec<u8>, Error>
container_export retrieves the raw contents of a container.
Sourcepub async fn container_stats(
&self,
container_id: &str,
stream: bool,
) -> Result<ContainerStats, Error>
pub async fn container_stats( &self, container_id: &str, stream: bool, ) -> Result<ContainerStats, Error>
container_stats returns near realtime stats for a given container.
Sourcepub async fn container_resize(
&self,
container_id: &str,
options: ResizeOptions,
) -> Result<(), Error>
pub async fn container_resize( &self, container_id: &str, options: ResizeOptions, ) -> Result<(), Error>
container_resize changes the size of the tty for a container.
Sourcepub async fn container_start(
&self,
container_id: &str,
options: Option<ContainerStartOptions>,
) -> Result<(), Error>
pub async fn container_start( &self, container_id: &str, options: Option<ContainerStartOptions>, ) -> Result<(), Error>
container_start sends a request to the docker daemon to start a container.
Sourcepub async fn container_stop(
&self,
container_id: &str,
timeout: Duration,
) -> Result<(), Error>
pub async fn container_stop( &self, container_id: &str, timeout: Duration, ) -> Result<(), Error>
container_stop stops a container. In case the container fails to stop gracefully within a time frame specified by the timeout argument, it is forcefully terminated (killed).
Sourcepub async fn container_restart(
&self,
container_id: &str,
timeout: Duration,
) -> Result<(), Error>
pub async fn container_restart( &self, container_id: &str, timeout: Duration, ) -> Result<(), Error>
container_restart stops and starts a container again. It makes the daemon to wait for the container to be up again for a specific amount of time, given the timeout.
Sourcepub async fn container_kill(
&self,
container_id: &str,
signal: Option<String>,
) -> Result<(), Error>
pub async fn container_kill( &self, container_id: &str, signal: Option<String>, ) -> Result<(), Error>
container_kill terminates the container process but does not remove the container from the docker host.
Sourcepub async fn container_update(
&self,
container_id: &str,
update_config: UpdateConfig,
) -> Result<ContainerUpdateOKBody, Error>
pub async fn container_update( &self, container_id: &str, update_config: UpdateConfig, ) -> Result<ContainerUpdateOKBody, Error>
container_update updates resources of a container.
Sourcepub async fn container_rename(
&self,
container_id: &str,
new_container_name: &str,
) -> Result<(), Error>
pub async fn container_rename( &self, container_id: &str, new_container_name: &str, ) -> Result<(), Error>
container_rename changes the name of a given container.
Sourcepub async fn container_pause(&self, container_id: &str) -> Result<(), Error>
pub async fn container_pause(&self, container_id: &str) -> Result<(), Error>
container_pause pauses the main process of a given container without terminating it.
Sourcepub async fn container_unpause(&self, container_id: &str) -> Result<(), Error>
pub async fn container_unpause(&self, container_id: &str) -> Result<(), Error>
container_unpause resumes the process execution within a container.
Sourcepub async fn container_wait(
&self,
container_id: &str,
condition: WaitCondition,
timeout: Duration,
) -> Result<ContainerWaitOKBody, Error>
pub async fn container_wait( &self, container_id: &str, condition: WaitCondition, timeout: Duration, ) -> Result<ContainerWaitOKBody, Error>
container_wait waits until the specified container is in a certain state indicated by the given condition, either “not-running” (default), “next-exit”, or “removed”.
Sourcepub async fn container_remove(
&self,
container_id: &str,
options: Option<ContainerRemoveOptions>,
) -> Result<(), Error>
pub async fn container_remove( &self, container_id: &str, options: Option<ContainerRemoveOptions>, ) -> Result<(), Error>
container_remove kills and removes a container from the docker host.
Sourcepub async fn container_stat_path(
&self,
container_id: &str,
path: &str,
) -> Result<ContainerPathStat, Error>
pub async fn container_stat_path( &self, container_id: &str, path: &str, ) -> Result<ContainerPathStat, Error>
container_stat_path returns Stat information about a path inside the container filesystem.
Sourcepub async fn copy_from_container(
&self,
container_id: &str,
src_path: &str,
) -> Result<(ContainerPathStat, Vec<u8>), Error>
pub async fn copy_from_container( &self, container_id: &str, src_path: &str, ) -> Result<(ContainerPathStat, Vec<u8>), Error>
copy_from_container gets the content from the container and returns it. for a TAR archive to manipulate it in the host.
Sourcepub async fn copy_to_container<S, O, E>(
&self,
container_id: &str,
dst_path: &str,
content: S,
options: Option<CopyToContainerOptions>,
) -> Result<(), Error>
pub async fn copy_to_container<S, O, E>( &self, container_id: &str, dst_path: &str, content: S, options: Option<CopyToContainerOptions>, ) -> Result<(), Error>
copy_to_container copies content into the container filesystem.
Note that content
must be a stream for a TAR archive
Sourcepub async fn containers_prune(
&self,
prune_filters: Option<Args>,
) -> Result<ContainersPruneReport, Error>
pub async fn containers_prune( &self, prune_filters: Option<Args>, ) -> Result<ContainersPruneReport, Error>
containers_prune requests the daemon to delete unused data.
Source§impl<C: Connect + Clone + Send + Sync + 'static> DockerEngineClient<C>
impl<C: Connect + Clone + Send + Sync + 'static> DockerEngineClient<C>
Sourcepub async fn network_list(
&self,
options: Option<NetworkListOptions>,
) -> Result<Vec<NetworkResource>, Error>
pub async fn network_list( &self, options: Option<NetworkListOptions>, ) -> Result<Vec<NetworkResource>, Error>
network_list returns the list of networks configured in the docker host.
Sourcepub async fn network_inspect(
&self,
network_id: &str,
options: Option<NetworkInspectOptions>,
) -> Result<NetworkResource, Error>
pub async fn network_inspect( &self, network_id: &str, options: Option<NetworkInspectOptions>, ) -> Result<NetworkResource, Error>
network_inspect returns the information for a specific network configured in the docker host.
Sourcepub async fn network_remove(&self, network_id: &str) -> Result<(), Error>
pub async fn network_remove(&self, network_id: &str) -> Result<(), Error>
network_remove removes an existent network from the docker host.
Sourcepub async fn network_create(
&self,
name: &str,
options: Option<NetworkCreate>,
) -> Result<NetworkCreateResponse, Error>
pub async fn network_create( &self, name: &str, options: Option<NetworkCreate>, ) -> Result<NetworkCreateResponse, Error>
network_create creates a new network in the docker host.
Sourcepub async fn network_connect(
&self,
network_id: &str,
container_id: &str,
config: Option<EndpointSettings>,
) -> Result<(), Error>
pub async fn network_connect( &self, network_id: &str, container_id: &str, config: Option<EndpointSettings>, ) -> Result<(), Error>
network_connect connects a container to an existent network in the docker host.
Sourcepub async fn network_disconnect(
&self,
network_id: &str,
container_id: &str,
force: bool,
) -> Result<(), Error>
pub async fn network_disconnect( &self, network_id: &str, container_id: &str, force: bool, ) -> Result<(), Error>
network_disconnect disconnects a container from an existent network in the docker host.
Sourcepub async fn networks_prune(
&self,
prune_filters: Option<Args>,
) -> Result<NetworksPruneReport, Error>
pub async fn networks_prune( &self, prune_filters: Option<Args>, ) -> Result<NetworksPruneReport, Error>
networks_prune requests the daemon to delete unused networks.
Source§impl<C: Connect + Clone + Send + Sync + 'static> DockerEngineClient<C>
impl<C: Connect + Clone + Send + Sync + 'static> DockerEngineClient<C>
Sourcepub async fn volume_list(
&self,
filter: Option<Args>,
) -> Result<VolumeListOKBody, Error>
pub async fn volume_list( &self, filter: Option<Args>, ) -> Result<VolumeListOKBody, Error>
volume_list returns the volumes configured in the docker host.
Sourcepub async fn volume_create(
&self,
options: VolumeCreateBody,
) -> Result<Volume, Error>
pub async fn volume_create( &self, options: VolumeCreateBody, ) -> Result<Volume, Error>
volume_create creates a volume in the docker host.
Sourcepub async fn volume_inspect(&self, volume_id: &str) -> Result<Volume, Error>
pub async fn volume_inspect(&self, volume_id: &str) -> Result<Volume, Error>
volume_inspect returns the information about a specific volume in the docker host.
Sourcepub async fn volume_remove(
&self,
volume_id: &str,
force: bool,
) -> Result<(), Error>
pub async fn volume_remove( &self, volume_id: &str, force: bool, ) -> Result<(), Error>
volume_remove removes a volume from the docker host.
Sourcepub async fn volumes_prune(
&self,
prune_filters: Option<Args>,
) -> Result<VolumesPruneReport, Error>
pub async fn volumes_prune( &self, prune_filters: Option<Args>, ) -> Result<VolumesPruneReport, Error>
volumes_prune requests the daemon to delete unused data.
Source§impl<C: Connect + Clone + Send + Sync + 'static> DockerEngineClient<C>
impl<C: Connect + Clone + Send + Sync + 'static> DockerEngineClient<C>
pub fn new_client_with_opts( options: Option<Vec<DockerEngineClientOption<C>>>, ) -> Result<DockerEngineClient<C>, Error>
Trait Implementations§
Source§impl<C: Clone + Connect + Clone + Send + Sync + 'static> Clone for DockerEngineClient<C>
impl<C: Clone + Connect + Clone + Send + Sync + 'static> Clone for DockerEngineClient<C>
Source§fn clone(&self) -> DockerEngineClient<C>
fn clone(&self) -> DockerEngineClient<C>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more