summaryrefslogtreecommitdiff
path: root/pkg/api/server
diff options
context:
space:
mode:
authorValentin Rothberg <rothberg@redhat.com>2020-01-14 13:58:03 +0100
committerValentin Rothberg <rothberg@redhat.com>2020-01-15 17:08:16 +0100
commit63d8ba64e4fd1ed1bef910b313029ca6535f43cf (patch)
tree10cd42fb53e7960a4f129d72fd5da09ab6cc803f /pkg/api/server
parente025b43060e7d9841dfdc7c9bfca93c7d99241b4 (diff)
downloadpodman-63d8ba64e4fd1ed1bef910b313029ca6535f43cf.tar.gz
podman-63d8ba64e4fd1ed1bef910b313029ca6535f43cf.tar.bz2
podman-63d8ba64e4fd1ed1bef910b313029ca6535f43cf.zip
v2 api: top improvements
* Use `pkg/adapter` to increase code reuse and reduce code redundancy. * Extend swagger docs to mention AIX descriptors. * Document the libpod endpoint which shares the same handler. Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
Diffstat (limited to 'pkg/api/server')
-rw-r--r--pkg/api/server/register_containers.go30
1 files changed, 29 insertions, 1 deletions
diff --git a/pkg/api/server/register_containers.go b/pkg/api/server/register_containers.go
index 95b986170..ad7b2b0ca 100644
--- a/pkg/api/server/register_containers.go
+++ b/pkg/api/server/register_containers.go
@@ -345,7 +345,7 @@ func (s *APIServer) RegisterContainersHandlers(r *mux.Router) error {
// - in: query
// name: ps_args
// type: string
- // description: arguments to pass to ps such as aux
+ // description: arguments to pass to ps such as aux. Requires ps(1) to be installed in the container if no ps(1) compatible AIX descriptors are used.
// produces:
// - application/json
// responses:
@@ -653,6 +653,34 @@ func (s *APIServer) RegisterContainersHandlers(r *mux.Router) error {
// '500':
// "$ref": "#/responses/InternalError"
r.HandleFunc(VersionedPath("/libpod/containers/{name:..*}/stats"), APIHandler(s.Context, generic.StatsContainer)).Methods(http.MethodGet)
+ // swagger:operation GET /libpod/containers/{nameOrID}/top containers topContainer
+ //
+ // List processes running inside a container. Note
+ //
+ // ---
+ // parameters:
+ // - in: path
+ // name: nameOrID
+ // required: true
+ // description: the name or ID of the container
+ // - in: query
+ // name: stream
+ // type: bool
+ // default: true
+ // description: Stream the output
+ // name: ps_args
+ // type: string
+ // description: arguments to pass to ps such as aux. Requires ps(1) to be installed in the container if no ps(1) compatible AIX descriptors are used.
+ // produces:
+ // - application/json
+ // responses:
+ // '200':
+ // description: no error
+ // "ref": "#/responses/DockerTopResponse"
+ // '404':
+ // "$ref": "#/responses/NoSuchContainer"
+ // '500':
+ // "$ref": "#/responses/InternalError"
r.HandleFunc(VersionedPath("/libpod/containers/{name:..*}/top"), APIHandler(s.Context, handlers.TopContainer)).Methods(http.MethodGet)
// swagger:operation POST /libpod/containers/{nameOrID}/unpause containers libpodUnpauseContainer
// ---