diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2019-04-25 15:01:39 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-25 15:01:39 -0700 |
commit | e2d7e325f42b58290275b6bc25f1b0c64378aff4 (patch) | |
tree | 779caad2670afddd36621cbee9198a913d4b7c3f /pkg/varlinkapi/containers.go | |
parent | a01c62fcbde1afdc77aa05b71c3c84ddacf7fc55 (diff) | |
parent | c4dd7c5813078acbe871aae37644bfff3163d160 (diff) | |
download | podman-e2d7e325f42b58290275b6bc25f1b0c64378aff4.tar.gz podman-e2d7e325f42b58290275b6bc25f1b0c64378aff4.tar.bz2 podman-e2d7e325f42b58290275b6bc25f1b0c64378aff4.zip |
Merge pull request #3014 from baude/remotetop
enable podman remote top
Diffstat (limited to 'pkg/varlinkapi/containers.go')
-rw-r--r-- | pkg/varlinkapi/containers.go | 13 |
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) +} |