summaryrefslogtreecommitdiffstats
path: root/examples/serviceinspect.rs
diff options
context:
space:
mode:
authorWojciech Kępka <46892771+wojciechkepka@users.noreply.github.com>2021-02-09 01:22:26 +0100
committerGitHub <noreply@github.com>2021-02-08 19:22:26 -0500
commit5af822c5691a772cad36bd9a69e94419b03d4511 (patch)
tree761ebc2ac10608a8772d8f7085596ee2ee838b37 /examples/serviceinspect.rs
parent4e3f69c34a177697af940849fced1a284fc09449 (diff)
Add services api (#263)
* Add initial Services models * Add initial Services controllers * Add ServicesListOptions * Rename ServicesList -> ServiceList * Fix some optional fields on ServiceRep * Add Service::inspect * Add Service::delete * Add Service::logs * Rename example logs -> containerlogs * Add ServiceOptions, ServiceCreateInfo, fix typo * Add a way to pass headers to request, add Payload and Headers for easier types * Add Service::create * Add examples * Fix fmt * Fix example
Diffstat (limited to 'examples/serviceinspect.rs')
-rw-r--r--examples/serviceinspect.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/examples/serviceinspect.rs b/examples/serviceinspect.rs
new file mode 100644
index 0000000..c281632
--- /dev/null
+++ b/examples/serviceinspect.rs
@@ -0,0 +1,15 @@
+use shiplift::Docker;
+use std::env;
+
+#[tokio::main]
+async fn main() {
+ let docker = Docker::new();
+ let id = env::args()
+ .nth(1)
+ .expect("Usage: cargo run --example serviceinspect -- <service>");
+
+ match docker.services().get(&id).inspect().await {
+ Ok(service) => println!("{:#?}", service),
+ Err(e) => eprintln!("Error: {}", e),
+ }
+}