Browse code

Merge pull request #25530 from thaJeztah/docs-update-image-load-response

docs: add missing "quiet" parameter for image/load and update response
(cherry picked from commit 06e3ea141707bc3a1d31a18c4768ed6bbf3976d4)

Conflicts:
docs/reference/api/docker_remote_api_v1.25.md

Sebastiaan van Stijn authored on 2016/08/09 22:26:16
Showing 3 changed files
... ...
@@ -163,6 +163,7 @@ This section lists each version from latest to oldest.  Each listing includes a
163 163
 * `POST /containers/create` with both `Hostname` and `Domainname` fields specified will result in the container's hostname being set to `Hostname`, rather than `Hostname.Domainname`.
164 164
 * `GET /volumes` now supports more filters, new added filters are `name` and `driver`.
165 165
 * `GET /containers/(id or name)/logs` now accepts a `details` query parameter to stream the extra attributes that were provided to the containers `LogOpts`, such as environment variables and labels, with the logs.
166
+* `POST /images/load` now returns progress information as a JSON stream, and has a `quiet` query parameter to suppress progress details.
166 167
 
167 168
 ### v1.22 API changes
168 169
 
... ...
@@ -2660,6 +2660,32 @@ See the [image tarball format](#image-tarball-format) for more details.
2660 2660
 **Example response**:
2661 2661
 
2662 2662
     HTTP/1.1 200 OK
2663
+    Content-Type: application/json
2664
+    Transfer-Encoding: chunked
2665
+
2666
+    {"status":"Loading layer","progressDetail":{"current":32768,"total":1292800},"progress":"[=                                                 ] 32.77 kB/1.293 MB","id":"8ac8bfaff55a"}
2667
+    {"status":"Loading layer","progressDetail":{"current":65536,"total":1292800},"progress":"[==                                                ] 65.54 kB/1.293 MB","id":"8ac8bfaff55a"}
2668
+    {"status":"Loading layer","progressDetail":{"current":98304,"total":1292800},"progress":"[===                                               ]  98.3 kB/1.293 MB","id":"8ac8bfaff55a"}
2669
+    {"status":"Loading layer","progressDetail":{"current":131072,"total":1292800},"progress":"[=====                                             ] 131.1 kB/1.293 MB","id":"8ac8bfaff55a"}
2670
+    ...
2671
+    {"stream":"Loaded image: busybox:latest\n"}
2672
+
2673
+**Example response**:
2674
+
2675
+If the "quiet" query parameter is set to `true` / `1` (`?quiet=1`), progress 
2676
+details are suppressed, and only a confirmation message is returned as plain text
2677
+once the action completes.
2678
+
2679
+    HTTP/1.1 200 OK
2680
+    Content-Length: 29
2681
+    Content-Type: text/plain; charset=utf-8
2682
+
2683
+    Loaded image: busybox:latest
2684
+
2685
+**Query parameters**:
2686
+
2687
+-   **quiet** – Boolean value, suppress progress details during load. Defaults
2688
+      to `0` / `false` if omitted.
2663 2689
 
2664 2690
 **Status codes**:
2665 2691
 
... ...
@@ -2673,6 +2673,32 @@ See the [image tarball format](#image-tarball-format) for more details.
2673 2673
 **Example response**:
2674 2674
 
2675 2675
     HTTP/1.1 200 OK
2676
+    Content-Type: application/json
2677
+    Transfer-Encoding: chunked
2678
+
2679
+    {"status":"Loading layer","progressDetail":{"current":32768,"total":1292800},"progress":"[=                                                 ] 32.77 kB/1.293 MB","id":"8ac8bfaff55a"}
2680
+    {"status":"Loading layer","progressDetail":{"current":65536,"total":1292800},"progress":"[==                                                ] 65.54 kB/1.293 MB","id":"8ac8bfaff55a"}
2681
+    {"status":"Loading layer","progressDetail":{"current":98304,"total":1292800},"progress":"[===                                               ]  98.3 kB/1.293 MB","id":"8ac8bfaff55a"}
2682
+    {"status":"Loading layer","progressDetail":{"current":131072,"total":1292800},"progress":"[=====                                             ] 131.1 kB/1.293 MB","id":"8ac8bfaff55a"}
2683
+    ...
2684
+    {"stream":"Loaded image: busybox:latest\n"}
2685
+
2686
+**Example response**:
2687
+
2688
+If the "quiet" query parameter is set to `true` / `1` (`?quiet=1`), progress 
2689
+details are suppressed, and only a confirmation message is returned as plain text
2690
+once the action completes.
2691
+
2692
+    HTTP/1.1 200 OK
2693
+    Content-Length: 29
2694
+    Content-Type: text/plain; charset=utf-8
2695
+
2696
+    Loaded image: busybox:latest
2697
+
2698
+**Query parameters**:
2699
+
2700
+-   **quiet** – Boolean value, suppress progress details during load. Defaults
2701
+      to `0` / `false` if omitted.
2676 2702
 
2677 2703
 **Status codes**:
2678 2704