summaryrefslogtreecommitdiffstats
path: root/src/lib.rs
diff options
context:
space:
mode:
authorsoftprops <d.tangren@gmail.com>2015-06-26 00:45:16 -0400
committersoftprops <d.tangren@gmail.com>2015-06-26 00:45:16 -0400
commit4fa13e9be6d3e12b9551047b5f62220ed37db110 (patch)
tree276822831df03703f20a2fe90cb4bdfac2f36b11 /src/lib.rs
parente5189c99089bcafdf7f7d6b42f6df3d5d42c11e2 (diff)
container list builder
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 31d2972..cc1148e 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -24,14 +24,13 @@ pub mod builder;
pub mod rep;
pub mod transport;
-use builder::{ ContainerBuilder, Events };
+use builder::{ ContainerBuilder, ContainerListBuilder, Events };
use hyper::{ Client, Url };
use hyper::method::Method;
use openssl::x509::X509FileType;
use rep::Image as ImageRep;
-use rep::Container as ContainerRep;
use rep::{
- Change, ContainerDetails, Event, Exit, History,
+ Change, ContainerDetails, Exit, History,
ImageDetails, Info, SearchResult, Stats, Status,
Top, Version
};
@@ -135,6 +134,10 @@ impl<'a> Images<'a> {
.connect("&");
self.docker.stream_get(&format!("/images/get?{}", query)[..])
}
+
+ //pub fn import(self, tarball: Box<Read>) -> Result<()> {
+ // self.docker.post
+ //}
}
/// Interface for accessing and manipulating a docker container
@@ -200,7 +203,6 @@ impl<'a, 'b> Container<'a, 'b> {
self.docker.post(&format!("/containers/{}/stop", self.id)[..], None).map(|_| ())
}
-
/// Restart the container instance
pub fn restart(self) -> Result<()> {
self.docker.post(&format!("/containers/{}/restart", self.id)[..], None).map(|_| ())
@@ -252,9 +254,8 @@ impl<'a> Containers<'a> {
}
/// Lists the container instances on the docker host
- pub fn list(self) -> Result<Vec<ContainerRep>> {
- let raw = try!(self.docker.get("/containers/json"));
- Ok(json::decode::<Vec<ContainerRep>>(&raw).unwrap())
+ pub fn list(self) -> ContainerListBuilder<'a> {
+ ContainerListBuilder::new(self.docker)
}
/// Returns a reference to a set of operations available to a specific container instance