Browse Source

Merge pull request #2443 from tlunter/fix_remote_api_doc

Container commit doesn't use a query parameter, uses POST body
Andy Rothfusz 11 năm trước cách đây
mục cha
commit
baf23d3c3e

+ 21 - 16
docs/sources/api/docker_remote_api_v1.0.rst

@@ -970,28 +970,33 @@ Create a new image from a container's changes
 
 
 	**Example request**:
 	**Example request**:
 
 
-        .. sourcecode:: http
+    .. sourcecode:: http
 
 
-           POST /commit?container=44c004db4b17&m=message&repo=myrepo HTTP/1.1
+       POST /commit?container=44c004db4b17&m=message&repo=myrepo HTTP/1.1
+       Content-Type: application/json
+   
+       {
+           "Cmd": ["cat", "/world"],
+           "PortSpecs":["22"]
+       }
 
 
-        **Example response**:
+    **Example response**:
 
 
-        .. sourcecode:: http
+    .. sourcecode:: http
 
 
-           HTTP/1.1 201 OK
-	   Content-Type: application/vnd.docker.raw-stream
+       HTTP/1.1 201 OK
+       Content-Type: application/vnd.docker.raw-stream
 
 
-           {"Id":"596069db4bf5"}
+       {"Id":"596069db4bf5"}
 
 
-	:query container: source container
-	:query repo: repository
-	:query tag: tag
-	:query m: commit message
-	:query author: author (eg. "John Hannibal Smith <hannibal@a-team.com>")
-	:query run: config automatically applied when the image is run. (ex: {"Cmd": ["cat", "/world"], "PortSpecs":["22"]})
-        :statuscode 201: no error
-	:statuscode 404: no such container
-        :statuscode 500: server error
+    :query container: source container
+    :query repo: repository
+    :query tag: tag
+    :query m: commit message
+    :query author: author (eg. "John Hannibal Smith <hannibal@a-team.com>")
+    :statuscode 201: no error
+    :statuscode 404: no such container
+    :statuscode 500: server error
 
 
 
 
 3. Going further
 3. Going further

+ 31 - 26
docs/sources/api/docker_remote_api_v1.1.rst

@@ -977,32 +977,37 @@ Create a new image from a container's changes
 
 
 .. http:post:: /commit
 .. http:post:: /commit
 
 
-	Create a new image from a container's changes
-
-	**Example request**:
-
-        .. sourcecode:: http
-
-           POST /commit?container=44c004db4b17&m=message&repo=myrepo HTTP/1.1
-
-        **Example response**:
-
-        .. sourcecode:: http
-
-           HTTP/1.1 201 OK
-	   Content-Type: application/vnd.docker.raw-stream
-
-           {"Id":"596069db4bf5"}
-
-	:query container: source container
-	:query repo: repository
-	:query tag: tag
-	:query m: commit message
-	:query author: author (eg. "John Hannibal Smith <hannibal@a-team.com>")
-	:query run: config automatically applied when the image is run. (ex: {"Cmd": ["cat", "/world"], "PortSpecs":["22"]})
-        :statuscode 201: no error
-	:statuscode 404: no such container
-        :statuscode 500: server error
+    Create a new image from a container's changes
+
+    **Example request**:
+    
+    .. sourcecode:: http
+    
+       POST /commit?container=44c004db4b17&m=message&repo=myrepo HTTP/1.1
+       Content-Type: application/json
+   
+       {
+           "Cmd": ["cat", "/world"],
+           "PortSpecs":["22"]
+       }
+    
+    **Example response**:
+    
+    .. sourcecode:: http
+    
+        HTTP/1.1 201 OK
+        Content-Type: application/vnd.docker.raw-stream
+
+        {"Id":"596069db4bf5"}
+
+    :query container: source container
+    :query repo: repository
+    :query tag: tag
+    :query m: commit message
+    :query author: author (eg. "John Hannibal Smith <hannibal@a-team.com>")
+    :statuscode 201: no error
+    :statuscode 404: no such container
+    :statuscode 500: server error
 
 
 
 
 3. Going further
 3. Going further

+ 22 - 17
docs/sources/api/docker_remote_api_v1.2.rst

@@ -985,32 +985,37 @@ Create a new image from a container's changes
 
 
 .. http:post:: /commit
 .. http:post:: /commit
 
 
-	Create a new image from a container's changes
+    Create a new image from a container's changes
 
 
-	**Example request**:
+    **Example request**:
 
 
-        .. sourcecode:: http
+    .. sourcecode:: http
 
 
-           POST /commit?container=44c004db4b17&m=message&repo=myrepo HTTP/1.1
+       POST /commit?container=44c004db4b17&m=message&repo=myrepo HTTP/1.1
+       Content-Type: application/json
+   
+       {
+           "Cmd": ["cat", "/world"],
+           "PortSpecs":["22"]
+       }
 
 
-        **Example response**:
+    **Example response**:
 
 
-        .. sourcecode:: http
+    .. sourcecode:: http
 
 
-           HTTP/1.1 201 OK
+       HTTP/1.1 201 OK
 	   Content-Type: application/vnd.docker.raw-stream
 	   Content-Type: application/vnd.docker.raw-stream
 
 
-           {"Id":"596069db4bf5"}
+       {"Id":"596069db4bf5"}
 
 
-	:query container: source container
-	:query repo: repository
-	:query tag: tag
-	:query m: commit message
-	:query author: author (eg. "John Hannibal Smith <hannibal@a-team.com>")
-	:query run: config automatically applied when the image is run. (ex: {"Cmd": ["cat", "/world"], "PortSpecs":["22"]})
-        :statuscode 201: no error
-	:statuscode 404: no such container
-        :statuscode 500: server error
+    :query container: source container
+    :query repo: repository
+    :query tag: tag
+    :query m: commit message
+    :query author: author (eg. "John Hannibal Smith <hannibal@a-team.com>")
+    :statuscode 201: no error
+    :statuscode 404: no such container
+    :statuscode 500: server error
 
 
 
 
 3. Going further
 3. Going further

+ 22 - 17
docs/sources/api/docker_remote_api_v1.3.rst

@@ -1034,32 +1034,37 @@ Create a new image from a container's changes
 
 
 .. http:post:: /commit
 .. http:post:: /commit
 
 
-	Create a new image from a container's changes
+    Create a new image from a container's changes
 
 
-	**Example request**:
+    **Example request**:
 
 
-        .. sourcecode:: http
+    .. sourcecode:: http
 
 
-           POST /commit?container=44c004db4b17&m=message&repo=myrepo HTTP/1.1
+       POST /commit?container=44c004db4b17&m=message&repo=myrepo HTTP/1.1
+       Content-Type: application/json
+   
+       {
+           "Cmd": ["cat", "/world"],
+           "PortSpecs":["22"]
+       }
 
 
-        **Example response**:
+    **Example response**:
 
 
-        .. sourcecode:: http
+    .. sourcecode:: http
 
 
-           HTTP/1.1 201 OK
+       HTTP/1.1 201 OK
 	   Content-Type: application/vnd.docker.raw-stream
 	   Content-Type: application/vnd.docker.raw-stream
 
 
-           {"Id":"596069db4bf5"}
+       {"Id":"596069db4bf5"}
 
 
-	:query container: source container
-	:query repo: repository
-	:query tag: tag
-	:query m: commit message
-	:query author: author (eg. "John Hannibal Smith <hannibal@a-team.com>")
-	:query run: config automatically applied when the image is run. (ex: {"Cmd": ["cat", "/world"], "PortSpecs":["22"]})
-        :statuscode 201: no error
-	:statuscode 404: no such container
-        :statuscode 500: server error
+    :query container: source container
+    :query repo: repository
+    :query tag: tag
+    :query m: commit message
+    :query author: author (eg. "John Hannibal Smith <hannibal@a-team.com>")
+    :statuscode 201: no error
+    :statuscode 404: no such container
+    :statuscode 500: server error
 
 
 
 
 Monitor Docker's events
 Monitor Docker's events

+ 10 - 5
docs/sources/api/docker_remote_api_v1.4.rst

@@ -1084,23 +1084,28 @@ Create a new image from a container's changes
 
 
     .. sourcecode:: http
     .. sourcecode:: http
 
 
-        POST /commit?container=44c004db4b17&m=message&repo=myrepo HTTP/1.1
+       POST /commit?container=44c004db4b17&m=message&repo=myrepo HTTP/1.1
+       Content-Type: application/json
+   
+       {
+           "Cmd": ["cat", "/world"],
+           "PortSpecs":["22"]
+       }
 
 
     **Example response**:
     **Example response**:
 
 
     .. sourcecode:: http
     .. sourcecode:: http
 
 
-        HTTP/1.1 201 OK
-	    Content-Type: application/vnd.docker.raw-stream
+       HTTP/1.1 201 OK
+	   Content-Type: application/vnd.docker.raw-stream
 
 
-        {"Id":"596069db4bf5"}
+       {"Id":"596069db4bf5"}
 
 
     :query container: source container
     :query container: source container
     :query repo: repository
     :query repo: repository
     :query tag: tag
     :query tag: tag
     :query m: commit message
     :query m: commit message
     :query author: author (eg. "John Hannibal Smith <hannibal@a-team.com>")
     :query author: author (eg. "John Hannibal Smith <hannibal@a-team.com>")
-    :query run: config automatically applied when the image is run. (ex: {"Cmd": ["cat", "/world"], "PortSpecs":["22"]})
     :statuscode 201: no error
     :statuscode 201: no error
     :statuscode 404: no such container
     :statuscode 404: no such container
     :statuscode 500: server error
     :statuscode 500: server error

+ 23 - 18
docs/sources/api/docker_remote_api_v1.5.rst

@@ -1050,32 +1050,37 @@ Create a new image from a container's changes
 
 
 .. http:post:: /commit
 .. http:post:: /commit
 
 
-  Create a new image from a container's changes
+    Create a new image from a container's changes
 
 
-  **Example request**:
+    **Example request**:
 
 
-  .. sourcecode:: http
+    .. sourcecode:: http
 
 
-    POST /commit?container=44c004db4b17&m=message&repo=myrepo HTTP/1.1
+       POST /commit?container=44c004db4b17&m=message&repo=myrepo HTTP/1.1
+       Content-Type: application/json
+   
+       {
+           "Cmd": ["cat", "/world"],
+           "PortSpecs":["22"]
+       }
 
 
-  **Example response**:
+    **Example response**:
 
 
-  .. sourcecode:: http
+    .. sourcecode:: http
 
 
-    HTTP/1.1 201 OK
-    Content-Type: application/vnd.docker.raw-stream
+       HTTP/1.1 201 OK
+	   Content-Type: application/vnd.docker.raw-stream
 
 
-    {"Id":"596069db4bf5"}
+       {"Id":"596069db4bf5"}
 
 
-  :query container: source container
-  :query repo: repository
-  :query tag: tag
-  :query m: commit message
-  :query author: author (eg. "John Hannibal Smith <hannibal@a-team.com>")
-  :query run: config automatically applied when the image is run. (ex: {"Cmd": ["cat", "/world"], "PortSpecs":["22"]})
-  :statuscode 201: no error
-  :statuscode 404: no such container
-  :statuscode 500: server error
+    :query container: source container
+    :query repo: repository
+    :query tag: tag
+    :query m: commit message
+    :query author: author (eg. "John Hannibal Smith <hannibal@a-team.com>")
+    :statuscode 201: no error
+    :statuscode 404: no such container
+    :statuscode 500: server error
 
 
 Monitor Docker's events
 Monitor Docker's events
 ***********************
 ***********************

+ 7 - 2
docs/sources/api/docker_remote_api_v1.6.rst

@@ -1136,7 +1136,13 @@ Create a new image from a container's changes
 
 
     .. sourcecode:: http
     .. sourcecode:: http
 
 
-        POST /commit?container=44c004db4b17&m=message&repo=myrepo HTTP/1.1
+       POST /commit?container=44c004db4b17&m=message&repo=myrepo HTTP/1.1
+       Content-Type: application/json
+       
+       {
+           "Cmd": ["cat", "/world"],
+           "PortSpecs":["22"]
+       }
 
 
     **Example response**:
     **Example response**:
 
 
@@ -1152,7 +1158,6 @@ Create a new image from a container's changes
     :query tag: tag
     :query tag: tag
     :query m: commit message
     :query m: commit message
     :query author: author (eg. "John Hannibal Smith <hannibal@a-team.com>")
     :query author: author (eg. "John Hannibal Smith <hannibal@a-team.com>")
-    :query run: config automatically applied when the image is run. (ex: {"Cmd": ["cat", "/world"], "PortSpecs":["22"]})
     :statuscode 201: no error
     :statuscode 201: no error
     :statuscode 404: no such container
     :statuscode 404: no such container
     :statuscode 500: server error
     :statuscode 500: server error