Skip to content
Sharmarke Aden edited this page May 17, 2014 · 7 revisions

Request Summary

URI Method Consumes HTTP Status Produces
/containers GET 200 / 400 application/json

Request Parameters

Name Type Default Description
all boolean false Show all containers
limit boolean false Show last created
since string (container id) "" Show only containers created since Id, including non-running
before string (container id) "" Show only containers created before Id, including non-running
size boolean false Show container sizes

Response Body Schema:

{
   "type": "array",
   "required": false,
   "items": {
       "type": "object",
       "required": false,
       "properties": {
           "Command": {
               "type": "string",
               "required": false
           },
           "Created": {
               "type": "number",
               "required": true
           },
           "Id": {
               "type": "string",
               "required": true
           },
           "Image": {
               "type": "string",
               "required": true
           },
           "Ports": {
               "type": "array",
               "required": false,
               "items": {
                   "type": "object",
                   "required": false,
                   "properties": {
                       "PrivatePort": {
                           "type": "number",
                           "required": true
                       },
                       "PublicPort": {
                           "type": "number",
                           "required": true
                       },
                       "Type": {
                           "type": "string",
                           "required": true
                       }
                   }
               }
           },
           "SizeRootFs": {
               "type": "number",
               "required": true
           },
           "SizeRw": {
               "type": "number",
               "required": true
           },
           "Status": {
               "type": "string",
               "required": true
           }
       }
   }
}

Sample

Good Request

Request
GET /containers
Headers
  Accept: application/json
Response
Content-Type : application/json
Status: 200 (OK)
 [
    {
        "Id": "8dfafdbc3a40",
        "Image": "base:latest",
        "Command": "echo 1",
        "Created": 1367854155,
        "Status": "Exit 0",
        "Ports": [{
                "PrivatePort": 2222,
                "PublicPort": 3333,
                "Type": "tcp"
            }],
        "SizeRw": 12288,
        "SizeRootFs": 0
    },
    {
        "Id": "9cd87474be90",
        "Image": "base:latest",
        "Command": "echo 222222",
        "Created": 1367854155,
        "Status": "Exit 0",
        "Ports": [],
        "SizeRw": 12288,
        "SizeRootFs": 0
    }
 ]

Bad Request

Request
GET /containers?all=tank
Headers
  Accept: application/json
Response
Content-Type : application/json
Status: 400 (Bad Request)
{
  "Error": "Message ...."
}

Clone this wiki locally