Wait for a container Run in API Explorer

POST /containers/{id}/wait

Block until a container stops, then returns the exit code.

Path parameters

  • id string Required

    ID or name of the container

Query parameters

  • condition string

    Wait until a container state reaches the given condition.

    Defaults to not-running if omitted or empty.

    Values are not-running, next-exit, or removed. Default value is not-running.

Responses

  • 200 application/json

    The container has exit.

    Hide response attributes Show response attributes object
    • StatusCode integer(int64) Required

      Exit code of the container

    • Error object

      container waiting error, if any

      Hide Error attribute Show Error attribute object
      • Message string

        Details of an error

  • 400 application/json

    bad parameter

    Hide response attribute Show response attribute object
    • message string Required

      The error message.

  • 404 application/json

    no such container

    Hide response attribute Show response attribute object
    • message string Required

      The error message.

  • 500 application/json

    server error

    Hide response attribute Show response attribute object
    • message string Required

      The error message.

POST /containers/{id}/wait
curl \
 --request POST 'http://api.example.com/v1.44/containers/{id}/wait'
Response examples (200)
{
  "StatusCode": 42,
  "Error": {
    "Message": "string"
  }
}
Response examples (400)
{
  "message": "Something went wrong."
}
Response examples (400)
{
  "message": "Something went wrong."
}
Response examples (404)
{
  "message": "No such container: c2ada9df5af8"
}
Response examples (404)
{
  "message": "Something went wrong."
}
Response examples (500)
{
  "message": "Something went wrong."
}
Response examples (500)
{
  "message": "Something went wrong."
}