summaryrefslogtreecommitdiff
path: root/cmd/podman/varlink
diff options
context:
space:
mode:
authorhaircommander <pehunt@redhat.com>2018-08-21 16:32:21 -0400
committerAtomic Bot <atomic-devel@projectatomic.io>2018-08-23 15:58:08 +0000
commit3df6332a65b203b8fab106e9856a263f24b956a0 (patch)
treec59bb7045c27043061c8fcf27dfdc87e802df48f /cmd/podman/varlink
parent7310697b73ff5ea8f58f24672c802f1e5e9dda3c (diff)
downloadpodman-3df6332a65b203b8fab106e9856a263f24b956a0.tar.gz
podman-3df6332a65b203b8fab106e9856a263f24b956a0.tar.bz2
podman-3df6332a65b203b8fab106e9856a263f24b956a0.zip
Add GetPodStats to varlink
Signed-off-by: haircommander <pehunt@redhat.com> Closes: #1319 Approved by: baude
Diffstat (limited to 'cmd/podman/varlink')
-rw-r--r--cmd/podman/varlink/io.podman.varlink30
1 files changed, 28 insertions, 2 deletions
diff --git a/cmd/podman/varlink/io.podman.varlink b/cmd/podman/varlink/io.podman.varlink
index 3d4a8fa84..2fc53b43e 100644
--- a/cmd/podman/varlink/io.podman.varlink
+++ b/cmd/podman/varlink/io.podman.varlink
@@ -757,8 +757,34 @@ method WaitPod() -> (notimplemented: NotImplemented)
# This method has not been implemented yet.
method TopPod() -> (notimplemented: NotImplemented)
-# This method has not been implemented yet.
-method StatsPod() -> (notimplemented: NotImplemented)
+# GetPodStats takes the name or ID of a pod and returns a pod name and slice of ContainerStats structure which
+# contains attributes like memory and cpu usage. If the pod cannot be found, a [PodNotFound](#PodNotFound)
+# error will be returned.
+# #### Example
+# ~~~
+# $ varlink call unix:/run/podman/io.podman/io.podman.GetPodStats '{"name": "7f62b508b6f12b11d8fe02e"}'
+# {
+# "containers": [
+# {
+# "block_input": 0,
+# "block_output": 0,
+# "cpu": 2.833470544016107524276e-08,
+# "cpu_nano": 54363072,
+# "id": "a64b51f805121fe2c5a3dc5112eb61d6ed139e3d1c99110360d08b58d48e4a93",
+# "mem_limit": 12276146176,
+# "mem_perc": 7.974359265237864966003e-03,
+# "mem_usage": 978944,
+# "name": "quirky_heisenberg",
+# "net_input": 866,
+# "net_output": 7388,
+# "pids": 1,
+# "system_nano": 20000000
+# }
+# ],
+# "pod": "7f62b508b6f12b11d8fe02e0db4de6b9e43a7d7699b33a4fc0d574f6e82b4ebd"
+# }
+# ~~~
+method GetPodStats(name: string) -> (pod: string, containers: []ContainerStats)
# ImageNotFound means the image could not be found by the provided name or ID in local storage.
error ImageNotFound (name: string)