Struct DockerEngineClient

Source
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>

Source

pub async fn container_list( &self, options: Option<ContainerListOptions>, ) -> Result<Vec<Container>, Error>

container_list returns the list of containers in the docker host.

Source

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.

Source

pub async fn container_inspect( &self, container_id: &str, ) -> Result<Container, Error>

container_inspect returns the container information.

Source

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.

Source

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.

Source

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.

Source

pub async fn container_export( &self, container_id: &str, ) -> Result<Vec<u8>, Error>

container_export retrieves the raw contents of a container.

Source

pub async fn container_stats( &self, container_id: &str, stream: bool, ) -> Result<ContainerStats, Error>

container_stats returns near realtime stats for a given container.

Source

pub async fn container_resize( &self, container_id: &str, options: ResizeOptions, ) -> Result<(), Error>

container_resize changes the size of the tty for a container.

Source

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.

Source

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).

Source

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.

Source

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.

Source

pub async fn container_update( &self, container_id: &str, update_config: UpdateConfig, ) -> Result<ContainerUpdateOKBody, Error>

container_update updates resources of a container.

Source

pub async fn container_rename( &self, container_id: &str, new_container_name: &str, ) -> Result<(), Error>

container_rename changes the name of a given container.

Source

pub async fn container_pause(&self, container_id: &str) -> Result<(), Error>

container_pause pauses the main process of a given container without terminating it.

Source

pub async fn container_unpause(&self, container_id: &str) -> Result<(), Error>

container_unpause resumes the process execution within a container.

Source

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”.

Source

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.

Source

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.

Source

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.

Source

pub async fn copy_to_container<S, O, E>( &self, container_id: &str, dst_path: &str, content: S, options: Option<CopyToContainerOptions>, ) -> Result<(), Error>
where S: Stream<Item = Result<O, E>> + Send + Sync + 'static, O: Into<Bytes> + 'static, E: Into<Box<dyn Error + Send + Sync>> + 'static,

copy_to_container copies content into the container filesystem. Note that content must be a stream for a TAR archive

Source

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>

Source

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.

Source

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.

Source

pub async fn network_remove(&self, network_id: &str) -> Result<(), Error>

network_remove removes an existent network from the docker host.

Source

pub async fn network_create( &self, name: &str, options: Option<NetworkCreate>, ) -> Result<NetworkCreateResponse, Error>

network_create creates a new network in the docker host.

Source

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.

Source

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.

Source

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>

Source

pub async fn volume_list( &self, filter: Option<Args>, ) -> Result<VolumeListOKBody, Error>

volume_list returns the volumes configured in the docker host.

Source

pub async fn volume_create( &self, options: VolumeCreateBody, ) -> Result<Volume, Error>

volume_create creates a volume in the docker host.

Source

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.

Source

pub async fn volume_remove( &self, volume_id: &str, force: bool, ) -> Result<(), Error>

volume_remove removes a volume from the docker host.

Source

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>

Trait Implementations§

Source§

impl<C: Clone + Connect + Clone + Send + Sync + 'static> Clone for DockerEngineClient<C>

Source§

fn clone(&self) -> DockerEngineClient<C>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<C: Debug + Connect + Clone + Send + Sync + 'static> Debug for DockerEngineClient<C>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<C: Connect + Clone + Send + Sync + 'static> Default for DockerEngineClient<C>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<C> Freeze for DockerEngineClient<C>
where C: Freeze,

§

impl<C> !RefUnwindSafe for DockerEngineClient<C>

§

impl<C> Send for DockerEngineClient<C>

§

impl<C> Sync for DockerEngineClient<C>

§

impl<C> Unpin for DockerEngineClient<C>
where C: Unpin,

§

impl<C> !UnwindSafe for DockerEngineClient<C>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

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
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more