summaryrefslogtreecommitdiff
path: root/pkg/varlinkapi
diff options
context:
space:
mode:
authorbaude <bbaude@redhat.com>2019-04-24 15:57:37 -0500
committerbaude <bbaude@redhat.com>2019-04-25 14:44:14 -0500
commitc4dd7c5813078acbe871aae37644bfff3163d160 (patch)
tree779caad2670afddd36621cbee9198a913d4b7c3f /pkg/varlinkapi
parenta01c62fcbde1afdc77aa05b71c3c84ddacf7fc55 (diff)
downloadpodman-c4dd7c5813078acbe871aae37644bfff3163d160.tar.gz
podman-c4dd7c5813078acbe871aae37644bfff3163d160.tar.bz2
podman-c4dd7c5813078acbe871aae37644bfff3163d160.zip
enable podman remote top
add the ability for the remote client to display a container's running processes. Signed-off-by: baude <bbaude@redhat.com>
Diffstat (limited to 'pkg/varlinkapi')
-rw-r--r--pkg/varlinkapi/containers.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/pkg/varlinkapi/containers.go b/pkg/varlinkapi/containers.go
index 237407050..872c7bc26 100644
--- a/pkg/varlinkapi/containers.go
+++ b/pkg/varlinkapi/containers.go
@@ -733,3 +733,16 @@ func newPodmanLogLine(line *libpod.LogLine) iopodman.LogLine {
Cid: line.CID,
}
}
+
+// Top displays information about a container's running processes
+func (i *LibpodAPI) Top(call iopodman.VarlinkCall, nameOrID string, descriptors []string) error {
+ ctr, err := i.Runtime.LookupContainer(nameOrID)
+ if err != nil {
+ return call.ReplyContainerNotFound(ctr.ID(), err.Error())
+ }
+ topInfo, err := ctr.Top(descriptors)
+ if err != nil {
+ return call.ReplyErrorOccurred(err.Error())
+ }
+ return call.ReplyTop(topInfo)
+}