Просмотр исходного кода

docs: update API for features added in 1.11

Docker 1.11 added a feature to set labels on volumes,
networks and images (during build), but these changes
were not documented in the API documentation.

This adds the new features to the documentation.

Also fixes some minor formatting, and options that
were not used in the examples.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit ba353f37870fdeb8b875a79e1aec54dc3d1aedc4)
Sebastiaan van Stijn 9 лет назад
Родитель
Сommit
41130fb9bc
1 измененных файлов с 43 добавлено и 11 удалено
  1. 43 11
      docs/reference/api/docker_remote_api_v1.23.md

+ 43 - 11
docs/reference/api/docker_remote_api_v1.23.md

@@ -517,8 +517,8 @@ Return low-level information on the container `id`
 			"Tty": false,
 			"Tty": false,
 			"User": "",
 			"User": "",
 			"Volumes": {
 			"Volumes": {
-                          "/volumes/data": {}
-                        },
+				"/volumes/data": {}
+			},
 			"WorkingDir": "",
 			"WorkingDir": "",
 			"StopSignal": "SIGTERM"
 			"StopSignal": "SIGTERM"
 		},
 		},
@@ -1660,7 +1660,7 @@ Query Parameters:
         You can provide one or more `t` parameters.
         You can provide one or more `t` parameters.
 -   **remote** – A Git repository URI or HTTP/HTTPS URI build source. If the
 -   **remote** – A Git repository URI or HTTP/HTTPS URI build source. If the
         URI specifies a filename, the file's contents are placed into a file
         URI specifies a filename, the file's contents are placed into a file
-		called `Dockerfile`.
+        called `Dockerfile`.
 -   **q** – Suppress verbose build output.
 -   **q** – Suppress verbose build output.
 -   **nocache** – Do not use the cache when building the image.
 -   **nocache** – Do not use the cache when building the image.
 -   **pull** - Attempt to pull the image even if an older image exists locally.
 -   **pull** - Attempt to pull the image even if an older image exists locally.
@@ -1678,6 +1678,7 @@ Query Parameters:
         variable expansion in other Dockerfile instructions. This is not meant for
         variable expansion in other Dockerfile instructions. This is not meant for
         passing secret values. [Read more about the buildargs instruction](../../reference/builder.md#arg)
         passing secret values. [Read more about the buildargs instruction](../../reference/builder.md#arg)
 -   **shmsize** - Size of `/dev/shm` in bytes. The size must be greater than 0.  If omitted the system uses 64MB.
 -   **shmsize** - Size of `/dev/shm` in bytes. The size must be greater than 0.  If omitted the system uses 64MB.
+-   **labels** – JSON map of string pairs for labels to set on the image.
 
 
     Request Headers:
     Request Headers:
 
 
@@ -2639,7 +2640,7 @@ interactive session with the `exec` command.
 **Example response**:
 **Example response**:
 
 
     HTTP/1.1 200 OK
     HTTP/1.1 200 OK
-    Content-Type: vnd.docker.raw-stream
+    Content-Type: application/vnd.docker.raw-stream
 
 
     {{ STREAM }}
     {{ STREAM }}
 
 
@@ -2774,7 +2775,11 @@ Create a volume
     Content-Type: application/json
     Content-Type: application/json
 
 
     {
     {
-      "Name": "tardis"
+      "Name": "tardis",
+      "Labels": {
+        "com.example.some-label": "some-value",
+        "com.example.some-other-label": "some-other-value"
+      },
     }
     }
 
 
 **Example response**:
 **Example response**:
@@ -2785,7 +2790,11 @@ Create a volume
     {
     {
       "Name": "tardis",
       "Name": "tardis",
       "Driver": "local",
       "Driver": "local",
-      "Mountpoint": "/var/lib/docker/volumes/tardis"
+      "Mountpoint": "/var/lib/docker/volumes/tardis",
+      "Labels": {
+        "com.example.some-label": "some-value",
+        "com.example.some-other-label": "some-other-value"
+      },
     }
     }
 
 
 Status Codes:
 Status Codes:
@@ -2799,6 +2808,7 @@ JSON Parameters:
 - **Driver** - Name of the volume driver to use. Defaults to `local` for the name.
 - **Driver** - Name of the volume driver to use. Defaults to `local` for the name.
 - **DriverOpts** - A mapping of driver options and values. These options are
 - **DriverOpts** - A mapping of driver options and values. These options are
     passed directly to the driver and are driver specific.
     passed directly to the driver and are driver specific.
+- **Labels** - Labels to set on the volume, specified as a map: `{"key":"value" [,"key2":"value2"]}`
 
 
 ### Inspect a volume
 ### Inspect a volume
 
 
@@ -2816,9 +2826,13 @@ Return low-level information on the volume `name`
     Content-Type: application/json
     Content-Type: application/json
 
 
     {
     {
-      "Name": "tardis",
-      "Driver": "local",
-      "Mountpoint": "/var/lib/docker/volumes/tardis"
+        "Name": "tardis",
+        "Driver": "local",
+        "Mountpoint": "/var/lib/docker/volumes/tardis/_data",
+        "Labels": {
+            "com.example.some-label": "some-value",
+            "com.example.some-other-label": "some-other-value"
+        }
     }
     }
 
 
 Status Codes:
 Status Codes:
@@ -2989,6 +3003,10 @@ Content-Type: application/json
     "com.docker.network.bridge.host_binding_ipv4": "0.0.0.0",
     "com.docker.network.bridge.host_binding_ipv4": "0.0.0.0",
     "com.docker.network.bridge.name": "docker0",
     "com.docker.network.bridge.name": "docker0",
     "com.docker.network.driver.mtu": "1500"
     "com.docker.network.driver.mtu": "1500"
+  },
+  "Labels": {
+    "com.example.some-label": "some-value",
+    "com.example.some-other-label": "some-other-value"
   }
   }
 }
 }
 ```
 ```
@@ -3012,6 +3030,7 @@ Content-Type: application/json
 
 
 {
 {
   "Name":"isolated_nw",
   "Name":"isolated_nw",
+  "CheckDuplicate":false,
   "Driver":"bridge",
   "Driver":"bridge",
   "EnableIPv6": true,
   "EnableIPv6": true,
   "IPAM":{
   "IPAM":{
@@ -3030,7 +3049,19 @@ Content-Type: application/json
         "foo": "bar"
         "foo": "bar"
     }
     }
   },
   },
-  "Internal":true
+  "Internal":true,
+  "Options": {
+    "com.docker.network.bridge.default_bridge": "true",
+    "com.docker.network.bridge.enable_icc": "true",
+    "com.docker.network.bridge.enable_ip_masquerade": "true",
+    "com.docker.network.bridge.host_binding_ipv4": "0.0.0.0",
+    "com.docker.network.bridge.name": "docker0",
+    "com.docker.network.driver.mtu": "1500"
+  },
+  "Labels": {
+    "com.example.some-label": "some-value",
+    "com.example.some-other-label": "some-other-value"
+  }
 }
 }
 ```
 ```
 
 
@@ -3055,12 +3086,13 @@ Status Codes:
 JSON Parameters:
 JSON Parameters:
 
 
 - **Name** - The new network's name. this is a mandatory field
 - **Name** - The new network's name. this is a mandatory field
+- **CheckDuplicate** - Requests daemon to check for networks with same name
 - **Driver** - Name of the network driver plugin to use. Defaults to `bridge` driver
 - **Driver** - Name of the network driver plugin to use. Defaults to `bridge` driver
 - **Internal** - Restrict external access to the network
 - **Internal** - Restrict external access to the network
 - **IPAM** - Optional custom IP scheme for the network
 - **IPAM** - Optional custom IP scheme for the network
 - **EnableIPv6** - Enable IPv6 on the network
 - **EnableIPv6** - Enable IPv6 on the network
 - **Options** - Network specific options to be used by the drivers
 - **Options** - Network specific options to be used by the drivers
-- **CheckDuplicate** - Requests daemon to check for networks with same name
+- **Labels** - Labels to set on the network, specified as a map: `{"key":"value" [,"key2":"value2"]}`
 
 
 ### Connect a container to a network
 ### Connect a container to a network