From c4dd7c5813078acbe871aae37644bfff3163d160 Mon Sep 17 00:00:00 2001 From: baude Date: Wed, 24 Apr 2019 15:57:37 -0500 Subject: enable podman remote top add the ability for the remote client to display a container's running processes. Signed-off-by: baude --- pkg/varlinkapi/containers.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'pkg/varlinkapi/containers.go') 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) +} -- cgit v1.2.3-54-g00ecf