Struct rust_docker::client::DockerClient [−][src]
pub struct DockerClient { /* fields omitted */ }
A structure defining a Client to interact with the docker API
- unix_socket: UnixStream connection for docker socket.
- protocol: Underlying protocol we are using(UNIX by default.)
Methods
impl DockerClient
[src]
impl DockerClient
pub fn new(
connection_addr: &'static str
) -> Result<DockerClient, DockerClientError>
[src]
pub fn new(
connection_addr: &'static str
) -> Result<DockerClient, DockerClientError>
Creates a new DockerClient object connected to docker's unix domain socket.
Trait Implementations
impl Clone for DockerClient
[src]
impl Clone for DockerClient
Implement clone for the DockerClient structure. The clone here is not true clone, the unix_socket cloned still refers to the stream and change to one of the two will propogate the changes to other.
fn clone(&self) -> DockerClient
[src]
fn clone(&self) -> DockerClient
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl DockerApiClient for DockerClient
[src]
impl DockerApiClient for DockerClient
impl Version for DockerClient
[src]
impl Version for DockerClient
fn get_version_info(&self) -> Result<String, String>
[src]
fn get_version_info(&self) -> Result<String, String>
Get version info for Docker Returns a JSON serialized string containing this information Read more
impl Containers for DockerClient
[src]
impl Containers for DockerClient
fn get_response_from_api(
&self,
api_endpoint: &str,
method: &str,
body: &str
) -> Result<Response, String>
[src]
fn get_response_from_api(
&self,
api_endpoint: &str,
method: &str,
body: &str
) -> Result<Response, String>
Just a helper function for the Containers DockerApiClient. It formats the API request using the given parameters, and using this request the docker daemon and sends back the response of the request if the request was successful else an err. Read more
fn get_containers(
&self,
api_endpoint: &str,
method: &str,
query_param: &str
) -> Result<Vec<Container>, String>
[src]
fn get_containers(
&self,
api_endpoint: &str,
method: &str,
query_param: &str
) -> Result<Vec<Container>, String>
Get Containers from the API endpoint with the method and query_param. Helper function for Container trait. Read more
fn list_running_containers(
&self,
limit: Option<u32>
) -> Result<Vec<Container>, String>
[src]
fn list_running_containers(
&self,
limit: Option<u32>
) -> Result<Vec<Container>, String>
List all the running containers Return an instance of Vector of container Read more
fn list_all_containers(
&self,
limit: Option<u32>
) -> Result<Vec<Container>, String>
[src]
fn list_all_containers(
&self,
limit: Option<u32>
) -> Result<Vec<Container>, String>
List all containers whether running or stopped.
fn get_container_details_with_filter(
&self,
filter: &str,
limit: Option<u32>
) -> Result<Vec<Container>, String>
[src]
fn get_container_details_with_filter(
&self,
filter: &str,
limit: Option<u32>
) -> Result<Vec<Container>, String>
List container with the filter provided, the filter can be looked from Docker engine official API documentation. https://docs.docker.com/engine/api/v1.37/#operation/ContainerList Read more
fn create_container(
&self,
name: &str,
config: ContainerConfig
) -> Result<CreateContainerResponse, String>
[src]
fn create_container(
&self,
name: &str,
config: ContainerConfig
) -> Result<CreateContainerResponse, String>
Create a container from the ContainerConfig structure with the provided name
. The response for the request is the CreateContaierResponse struct which contains the ID for the container which we created. Read more
fn create_container_minimal(
&self,
name: &str,
image: &str,
cmd: Vec<String>
) -> Result<CreateContainerResponse, String>
[src]
fn create_container_minimal(
&self,
name: &str,
image: &str,
cmd: Vec<String>
) -> Result<CreateContainerResponse, String>
Creates/Spawn docker container from the configuration provided. It only Read more
fn inspect_container(&self, id: &str) -> Result<ContainerDetails, String>
[src]
fn inspect_container(&self, id: &str) -> Result<ContainerDetails, String>
Inspects the container with the provided ID Returns Low level information about the container. Read more
fn get_container_filesystem_changes(
&self,
id: &str
) -> Result<Vec<ContainerFsChange>, String>
[src]
fn get_container_filesystem_changes(
&self,
id: &str
) -> Result<Vec<ContainerFsChange>, String>
Gives the changes done to somewhere in the filesystem in the docker container as a list of files with the kind of changes. Read more
fn manipulate_container_status(
&self,
action: &str,
id: &str,
params: &str
) -> Result<String, String>
[src]
fn manipulate_container_status(
&self,
action: &str,
id: &str,
params: &str
) -> Result<String, String>
Function to manipulate container status It is a parent function for all the commands which result in a status change of the container. Read more
fn start_container(&self, id: &str) -> Result<String, String>
[src]
fn start_container(&self, id: &str) -> Result<String, String>
fn stop_container(
&self,
id: &str,
delay: Option<&str>
) -> Result<String, String>
[src]
fn stop_container(
&self,
id: &str,
delay: Option<&str>
) -> Result<String, String>
fn pause_container(&self, id: &str) -> Result<String, String>
[src]
fn pause_container(&self, id: &str) -> Result<String, String>
fn unpause_container(&self, id: &str) -> Result<String, String>
[src]
fn unpause_container(&self, id: &str) -> Result<String, String>
fn restart_container(
&self,
id: &str,
delay: Option<&str>
) -> Result<String, String>
[src]
fn restart_container(
&self,
id: &str,
delay: Option<&str>
) -> Result<String, String>
fn kill_container(
&self,
id: &str,
signal: Option<&str>
) -> Result<String, String>
[src]
fn kill_container(
&self,
id: &str,
signal: Option<&str>
) -> Result<String, String>
fn rename_container(&self, id: &str, name: &str) -> Result<String, String>
[src]
fn rename_container(&self, id: &str, name: &str) -> Result<String, String>
Auto Trait Implementations
impl Send for DockerClient
impl Send for DockerClient
impl Sync for DockerClient
impl Sync for DockerClient