Giter Club home page Giter Club logo

docker-rust's People

Contributors

abh1nav avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

docker-rust's Issues

Inspect a container

Example request:

GET /containers/4fa6e0f0c678/json HTTP/1.1

Example response:

HTTP/1.1 200 OK
Content-Type: application/json

{
             "Id": "4fa6e0f0c6786287e131c3852c58a2e01cc697a68231826813597e4994f1d6e2",
             "Created": "2013-05-07T14:51:42.041847+02:00",
             "Path": "date",
             "Args": [],
             "Config": {
                     "Hostname": "4fa6e0f0c678",
                     "User": "",
                     "Memory": 0,
                     "MemorySwap": 0,
                     "AttachStdin": false,
                     "AttachStdout": true,
                     "AttachStderr": true,
                     "PortSpecs": null,
                     "Tty": false,
                     "OpenStdin": false,
                     "StdinOnce": false,
                     "Env": null,
                     "Cmd": [
                             "date"
                     ],
                     "Dns": null,
                     "Image": "base",
                     "Volumes": {},
                     "VolumesFrom": "",
                     "WorkingDir":""

             },
             "State": {
                     "Running": false,
                     "Pid": 0,
                     "ExitCode": 0,
                     "StartedAt": "2013-05-07T14:51:42.087658+02:01360",
                     "Ghost": false
             },
             "Image": "b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc",
             "NetworkSettings": {
                     "IpAddress": "",
                     "IpPrefixLen": 0,
                     "Gateway": "",
                     "Bridge": "",
                     "PortMapping": null
             },
             "SysInitPath": "/home/kitty/go/src/github.com/dotcloud/docker/bin/docker",
             "ResolvConfPath": "/etc/resolv.conf",
             "Volumes": {},
             "HostConfig": {
                 "Binds": null,
                 "ContainerIDFile": "",
                 "LxcConf": [],
                 "Privileged": false,
                 "PortBindings": {
                    "80/tcp": [
                        {
                            "HostIp": "0.0.0.0",
                            "HostPort": "49153"
                        }
                    ]
                 },
                 "Links": null,
                 "PublishAllPorts": false
             }
}

Status Codes:

  • 200 – no error
  • 404 – no such container
  • 500 – server error

Get system-wide info

Example request:

GET /info HTTP/1.1

Example response:

HTTP/1.1 200 OK
Content-Type: application/json

{
     "Containers":11,
     "Images":16,
     "Debug":false,
     "NFd": 11,
     "NGoroutines":21,
     "MemoryLimit":true,
     "SwapLimit":false,
     "IPv4Forwarding":true
}

Status Codes:

  • 200 – no error
  • 500 – server error

Wait for (i.e. block until) a container to stop

Example request:

POST /containers/16253994b7c4/wait HTTP/1.1

Example response:

HTTP/1.1 200 OK
Content-Type: application/json

{"StatusCode":0}

Status Codes:

  • 200 – no error
  • 404 – no such container
  • 500 – server error

Start an existing container

Example request:

POST /containers/(id)/start HTTP/1.1
Content-Type: application/json

{
     "Binds":["/tmp:/tmp"],
     "LxcConf":{"lxc.utsname":"docker"},
     "PortBindings":{ "22/tcp": [{ "HostPort": "11022" }] },
     "PublishAllPorts":false,
     "Privileged":false,
     "Dns": ["8.8.8.8"],
     "VolumesFrom": ["parent", "other:ro"]
}

Example response:

HTTP/1.1 204 No Content
Content-Type: text/plain

Json Parameters:

  • hostConfig – the container's host configuration (optional)

Status Codes:

  • 204 – no error
  • 404 – no such container
  • 500 – server error

List all images

GET /images/json?all=0 HTTP/1.1

Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json

    [
      {
         "RepoTags": [
           "ubuntu:12.04",
           "ubuntu:precise",
           "ubuntu:latest"
         ],
         "Id": "8dbd9e392a964056420e5d58ca5cc376ef18e2de93b5cc90e868a1bbc8318c1c",
         "Created": 1365714795,
         "Size": 131506275,
         "VirtualSize": 131506275
      },
      {
         "RepoTags": [
           "ubuntu:12.10",
           "ubuntu:quantal"
         ],
         "ParentId": "27cf784147099545",
         "Id": "b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc",
         "Created": 1364102658,
         "Size": 24653,
         "VirtualSize": 180116135
      }
    ]

Query Parameters:

  • all – 1/True/true or 0/False/false, default false
  • filters – a json encoded value of the filters (a map[string][]string) to process on the images list.

Get all containers

Example request:

GET /containers/json?all=1&before=8dfafdbc3a40&size=1 HTTP/1.1

Example response:

HTTP/1.1 200 OK
Content-Type: application/json

[
     {
             "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
     },
     {
             "Id": "3176a2479c92",
             "Image": "base:latest",
             "Command": "echo 3333333333333333",
             "Created": 1367854154,
             "Status": "Exit 0",
             "Ports":[],
             "SizeRw":12288,
             "SizeRootFs":0
     },
     {
             "Id": "4cb07b47f9fb",
             "Image": "base:latest",
             "Command": "echo 444444444444444444444444444444444",
             "Created": 1367854152,
             "Status": "Exit 0",
             "Ports":[],
             "SizeRw":12288,
             "SizeRootFs":0
     }
]

Query Parameters:

  • all – 1/True/true or 0/False/false, Show all containers.
    Only running containers are shown by default
  • limit – Show limit last created
    containers, include non-running ones.
  • since – Show only containers created since Id, include
    non-running ones.
  • before – Show only containers created before Id, include
    non-running ones.
  • size – 1/True/true or 0/False/false, Show the containers
    sizes

Status Codes:

  • 200 – no error
  • 400 – bad parameter
  • 500 – server error

Stop a running container

Example request:

POST /containers/e90e34656806/stop?t=5 HTTP/1.1

Example response:

HTTP/1.1 204 OK

Query Parameters:

  • t – number of seconds to wait before killing the container

Status Codes:

  • 204 – no error
  • 404 – no such container
  • 500 – server error

Kill a container

Example request:

POST /containers/e90e34656806/kill HTTP/1.1

Example response:

HTTP/1.1 204 OK

Query Parameters

  • signal - Signal to send to the container: integer or string like "SIGINT".
    When not set, SIGKILL is assumed and the call will waits for the container to exit.

Status Codes:

  • 204 – no error
  • 404 – no such container
  • 500 – server error

Remove (delete) a container

Example request:
DELETE /containers/16253994b7c4?v=1 HTTP/1.1

Example response:
HTTP/1.1 204 OK

Query Parameters:

  • v – 1/True/true or 0/False/false, Remove the volumes
    associated to the container. Default false
  • force – 1/True/true or 0/False/false, Removes the container
    even if it was running. Default false

Status Codes:

  • 204 – no error
  • 400 – bad parameter
  • 404 – no such container
  • 500 – server error

Inspect an Image

Example request:

GET /images/base/json HTTP/1.1

Example response:

HTTP/1.1 200 OK
Content-Type: application/json

{
     "Created":"2013-03-23T22:24:18.818426-07:00",
     "Container":"3d67245a8d72ecf13f33dffac9f79dcdf70f75acb84d308770391510e0c23ad0",
     "ContainerConfig":
             {
                     "Hostname":"",
                     "User":"",
                     "Memory":0,
                     "MemorySwap":0,
                     "AttachStdin":false,
                     "AttachStdout":false,
                     "AttachStderr":false,
                     "PortSpecs":null,
                     "Tty":true,
                     "OpenStdin":true,
                     "StdinOnce":false,
                     "Env":null,
                     "Cmd": ["/bin/bash"]
                     ,"Dns":null,
                     "Image":"base",
                     "Volumes":null,
                     "VolumesFrom":"",
                     "WorkingDir":""
             },
     "Id":"b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc",
     "Parent":"27cf784147099545",
     "Size": 6824592
}

Status Codes:

  • 200 – no error
  • 404 – no such image
  • 500 – server error

Delete an Image

Example request:

DELETE /images/test HTTP/1.1

Example response:

HTTP/1.1 200 OK
Content-type: application/json

[
 {"Untagged":"3e2f21a89f"},
 {"Deleted":"3e2f21a89f"},
 {"Deleted":"53b4f83ac9"}
]

Query Parameters:

  • force – 1/True/true or 0/False/false, default false
  • noprune – 1/True/true or 0/False/false, default false

Status Codes:

  • 200 – no error
  • 404 – no such image
  • 409 – conflict
  • 500 – server error

Version endpoint

Example request:

GET /version HTTP/1.1

Example response:

HTTP/1.1 200 OK
Content-Type: application/json

{
     "Version":"0.2.2",
     "GitCommit":"5a2a5cc+CHANGES",
     "GoVersion":"go1.0.3"
}

Status Codes:

  • 200 – no error
  • 500 – server error

Restart a running container

Example request:

POST /containers/e90e34656806/restart?t=5 HTTP/1.1

Example response:

HTTP/1.1 204 OK

Query Parameters:

  • t – number of seconds to wait before killing the container

Status Codes:

  • 204 – no error
  • 404 – no such container
  • 500 – server error

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.