summaryrefslogtreecommitdiff
path: root/pkg/api/server/register_containers.go
diff options
context:
space:
mode:
authorBrent Baude <bbaude@redhat.com>2020-02-27 10:59:53 -0600
committerBrent Baude <bbaude@redhat.com>2020-02-28 09:36:53 -0600
commit09048731000e73b44a0243a0339d8c122eb8a165 (patch)
treedb939805cbb41f4ddd2db610256ba2186a8367db /pkg/api/server/register_containers.go
parentbaf27fa25eed668b5a73a1d7d4fe16214f1c260f (diff)
downloadpodman-09048731000e73b44a0243a0339d8c122eb8a165.tar.gz
podman-09048731000e73b44a0243a0339d8c122eb8a165.tar.bz2
podman-09048731000e73b44a0243a0339d8c122eb8a165.zip
rework apiv2 wait endpoint|binding
added the ability to wait on a condition (stopped, running, paused...) for a container. if a condition is not provided, wait will default to the stopped condition which uses the original wait code paths. if the condition is stopped, the container exit code will be returned. also, correct a mux issue we discovered. Signed-off-by: Brent Baude <bbaude@redhat.com>
Diffstat (limited to 'pkg/api/server/register_containers.go')
-rw-r--r--pkg/api/server/register_containers.go31
1 files changed, 25 insertions, 6 deletions
diff --git a/pkg/api/server/register_containers.go b/pkg/api/server/register_containers.go
index 6a2ba4b1e..6aad7ff88 100644
--- a/pkg/api/server/register_containers.go
+++ b/pkg/api/server/register_containers.go
@@ -436,8 +436,8 @@ func (s *APIServer) registerContainersHandlers(r *mux.Router) error {
// ---
// tags:
// - containers (compat)
- // summary: Wait on a container to exit
- // description: Block until a container stops, then returns the exit code.
+ // summary: Wait on a container
+ // description: Block until a container stops or given condition is met.
// parameters:
// - in: path
// name: name
@@ -447,7 +447,14 @@ func (s *APIServer) registerContainersHandlers(r *mux.Router) error {
// - in: query
// name: condition
// type: string
- // description: not supported
+ // description: |
+ // wait until container is to a given condition. default is stopped. valid conditions are:
+ // - configured
+ // - created
+ // - exited
+ // - paused
+ // - running
+ // - stopped
// produces:
// - application/json
// responses:
@@ -1030,18 +1037,30 @@ func (s *APIServer) registerContainersHandlers(r *mux.Router) error {
// ---
// tags:
// - containers
- // summary: Wait on a container to exit
+ // summary: Wait on a container
+ // description: Wait on a container to met a given condition
// parameters:
// - in: path
// name: name
// type: string
// required: true
// description: the name or ID of the container
+ // - in: query
+ // name: condition
+ // type: string
+ // description: |
+ // wait until container is to a given condition. default is stopped. valid conditions are:
+ // - configured
+ // - created
+ // - exited
+ // - paused
+ // - running
+ // - stopped
// produces:
// - application/json
// responses:
- // 204:
- // description: no error
+ // 200:
+ // $ref: "#/responses/ContainerWaitResponse"
// 404:
// $ref: "#/responses/NoSuchContainer"
// 500: