Browse code

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>

Sebastiaan van Stijn authored on 2016/04/14 22:04:33
Showing 2 changed files
... ...
@@ -517,8 +517,8 @@ Return low-level information on the container `id`
517 517
 			"Tty": false,
518 518
 			"User": "",
519 519
 			"Volumes": {
520
-                          "/volumes/data": {}
521
-                        },
520
+				"/volumes/data": {}
521
+			},
522 522
 			"WorkingDir": "",
523 523
 			"StopSignal": "SIGTERM"
524 524
 		},
... ...
@@ -1660,7 +1660,7 @@ Query Parameters:
1660 1660
         You can provide one or more `t` parameters.
1661 1661
 -   **remote** – A Git repository URI or HTTP/HTTPS URI build source. If the
1662 1662
         URI specifies a filename, the file's contents are placed into a file
1663
-		called `Dockerfile`.
1663
+        called `Dockerfile`.
1664 1664
 -   **q** – Suppress verbose build output.
1665 1665
 -   **nocache** – Do not use the cache when building the image.
1666 1666
 -   **pull** - Attempt to pull the image even if an older image exists locally.
... ...
@@ -1678,6 +1678,7 @@ Query Parameters:
1678 1678
         variable expansion in other Dockerfile instructions. This is not meant for
1679 1679
         passing secret values. [Read more about the buildargs instruction](../../reference/builder.md#arg)
1680 1680
 -   **shmsize** - Size of `/dev/shm` in bytes. The size must be greater than 0.  If omitted the system uses 64MB.
1681
+-   **labels** – JSON map of string pairs for labels to set on the image.
1681 1682
 
1682 1683
     Request Headers:
1683 1684
 
... ...
@@ -2639,7 +2640,7 @@ interactive session with the `exec` command.
2639 2639
 **Example response**:
2640 2640
 
2641 2641
     HTTP/1.1 200 OK
2642
-    Content-Type: vnd.docker.raw-stream
2642
+    Content-Type: application/vnd.docker.raw-stream
2643 2643
 
2644 2644
     {{ STREAM }}
2645 2645
 
... ...
@@ -2774,7 +2775,11 @@ Create a volume
2774 2774
     Content-Type: application/json
2775 2775
 
2776 2776
     {
2777
-      "Name": "tardis"
2777
+      "Name": "tardis",
2778
+      "Labels": {
2779
+        "com.example.some-label": "some-value",
2780
+        "com.example.some-other-label": "some-other-value"
2781
+      },
2778 2782
     }
2779 2783
 
2780 2784
 **Example response**:
... ...
@@ -2785,7 +2790,11 @@ Create a volume
2785 2785
     {
2786 2786
       "Name": "tardis",
2787 2787
       "Driver": "local",
2788
-      "Mountpoint": "/var/lib/docker/volumes/tardis"
2788
+      "Mountpoint": "/var/lib/docker/volumes/tardis",
2789
+      "Labels": {
2790
+        "com.example.some-label": "some-value",
2791
+        "com.example.some-other-label": "some-other-value"
2792
+      },
2789 2793
     }
2790 2794
 
2791 2795
 Status Codes:
... ...
@@ -2799,6 +2808,7 @@ JSON Parameters:
2799 2799
 - **Driver** - Name of the volume driver to use. Defaults to `local` for the name.
2800 2800
 - **DriverOpts** - A mapping of driver options and values. These options are
2801 2801
     passed directly to the driver and are driver specific.
2802
+- **Labels** - Labels to set on the volume, specified as a map: `{"key":"value" [,"key2":"value2"]}`
2802 2803
 
2803 2804
 ### Inspect a volume
2804 2805
 
... ...
@@ -2816,9 +2826,13 @@ Return low-level information on the volume `name`
2816 2816
     Content-Type: application/json
2817 2817
 
2818 2818
     {
2819
-      "Name": "tardis",
2820
-      "Driver": "local",
2821
-      "Mountpoint": "/var/lib/docker/volumes/tardis"
2819
+        "Name": "tardis",
2820
+        "Driver": "local",
2821
+        "Mountpoint": "/var/lib/docker/volumes/tardis/_data",
2822
+        "Labels": {
2823
+            "com.example.some-label": "some-value",
2824
+            "com.example.some-other-label": "some-other-value"
2825
+        }
2822 2826
     }
2823 2827
 
2824 2828
 Status Codes:
... ...
@@ -2989,6 +3003,10 @@ Content-Type: application/json
2989 2989
     "com.docker.network.bridge.host_binding_ipv4": "0.0.0.0",
2990 2990
     "com.docker.network.bridge.name": "docker0",
2991 2991
     "com.docker.network.driver.mtu": "1500"
2992
+  },
2993
+  "Labels": {
2994
+    "com.example.some-label": "some-value",
2995
+    "com.example.some-other-label": "some-other-value"
2992 2996
   }
2993 2997
 }
2994 2998
 ```
... ...
@@ -3012,6 +3030,7 @@ Content-Type: application/json
3012 3012
 
3013 3013
 {
3014 3014
   "Name":"isolated_nw",
3015
+  "CheckDuplicate":false,
3015 3016
   "Driver":"bridge",
3016 3017
   "EnableIPv6": true,
3017 3018
   "IPAM":{
... ...
@@ -3030,7 +3049,19 @@ Content-Type: application/json
3030 3030
         "foo": "bar"
3031 3031
     }
3032 3032
   },
3033
-  "Internal":true
3033
+  "Internal":true,
3034
+  "Options": {
3035
+    "com.docker.network.bridge.default_bridge": "true",
3036
+    "com.docker.network.bridge.enable_icc": "true",
3037
+    "com.docker.network.bridge.enable_ip_masquerade": "true",
3038
+    "com.docker.network.bridge.host_binding_ipv4": "0.0.0.0",
3039
+    "com.docker.network.bridge.name": "docker0",
3040
+    "com.docker.network.driver.mtu": "1500"
3041
+  },
3042
+  "Labels": {
3043
+    "com.example.some-label": "some-value",
3044
+    "com.example.some-other-label": "some-other-value"
3045
+  }
3034 3046
 }
3035 3047
 ```
3036 3048
 
... ...
@@ -3055,12 +3086,13 @@ Status Codes:
3055 3055
 JSON Parameters:
3056 3056
 
3057 3057
 - **Name** - The new network's name. this is a mandatory field
3058
+- **CheckDuplicate** - Requests daemon to check for networks with same name
3058 3059
 - **Driver** - Name of the network driver plugin to use. Defaults to `bridge` driver
3059 3060
 - **Internal** - Restrict external access to the network
3060 3061
 - **IPAM** - Optional custom IP scheme for the network
3061 3062
 - **EnableIPv6** - Enable IPv6 on the network
3062 3063
 - **Options** - Network specific options to be used by the drivers
3063
-- **CheckDuplicate** - Requests daemon to check for networks with same name
3064
+- **Labels** - Labels to set on the network, specified as a map: `{"key":"value" [,"key2":"value2"]}`
3064 3065
 
3065 3066
 ### Connect a container to a network
3066 3067
 
... ...
@@ -522,8 +522,8 @@ Return low-level information on the container `id`
522 522
 			"Tty": false,
523 523
 			"User": "",
524 524
 			"Volumes": {
525
-                          "/volumes/data": {}
526
-                        },
525
+				"/volumes/data": {}
526
+			},
527 527
 			"WorkingDir": "",
528 528
 			"StopSignal": "SIGTERM"
529 529
 		},
... ...
@@ -1667,7 +1667,7 @@ Query Parameters:
1667 1667
         You can provide one or more `t` parameters.
1668 1668
 -   **remote** – A Git repository URI or HTTP/HTTPS URI build source. If the
1669 1669
         URI specifies a filename, the file's contents are placed into a file
1670
-		called `Dockerfile`.
1670
+        called `Dockerfile`.
1671 1671
 -   **q** – Suppress verbose build output.
1672 1672
 -   **nocache** – Do not use the cache when building the image.
1673 1673
 -   **pull** - Attempt to pull the image even if an older image exists locally.
... ...
@@ -1685,6 +1685,7 @@ Query Parameters:
1685 1685
         variable expansion in other Dockerfile instructions. This is not meant for
1686 1686
         passing secret values. [Read more about the buildargs instruction](../../reference/builder.md#arg)
1687 1687
 -   **shmsize** - Size of `/dev/shm` in bytes. The size must be greater than 0.  If omitted the system uses 64MB.
1688
+-   **labels** – JSON map of string pairs for labels to set on the image.
1688 1689
 
1689 1690
     Request Headers:
1690 1691
 
... ...
@@ -2789,7 +2790,11 @@ Create a volume
2789 2789
     Content-Type: application/json
2790 2790
 
2791 2791
     {
2792
-      "Name": "tardis"
2792
+      "Name": "tardis",
2793
+      "Labels": {
2794
+        "com.example.some-label": "some-value",
2795
+        "com.example.some-other-label": "some-other-value"
2796
+      },
2793 2797
     }
2794 2798
 
2795 2799
 **Example response**:
... ...
@@ -2801,7 +2806,11 @@ Create a volume
2801 2801
       "Name": "tardis",
2802 2802
       "Driver": "local",
2803 2803
       "Mountpoint": "/var/lib/docker/volumes/tardis",
2804
-      "Status": null
2804
+      "Status": null,
2805
+      "Labels": {
2806
+        "com.example.some-label": "some-value",
2807
+        "com.example.some-other-label": "some-other-value"
2808
+      },
2805 2809
     }
2806 2810
 
2807 2811
 Status Codes:
... ...
@@ -2815,6 +2824,7 @@ JSON Parameters:
2815 2815
 - **Driver** - Name of the volume driver to use. Defaults to `local` for the name.
2816 2816
 - **DriverOpts** - A mapping of driver options and values. These options are
2817 2817
     passed directly to the driver and are driver specific.
2818
+- **Labels** - Labels to set on the volume, specified as a map: `{"key":"value" [,"key2":"value2"]}`
2818 2819
 
2819 2820
 ### Inspect a volume
2820 2821
 
... ...
@@ -2832,9 +2842,13 @@ Return low-level information on the volume `name`
2832 2832
     Content-Type: application/json
2833 2833
 
2834 2834
     {
2835
-      "Name": "tardis",
2836
-      "Driver": "local",
2837
-      "Mountpoint": "/var/lib/docker/volumes/tardis"
2835
+        "Name": "tardis",
2836
+        "Driver": "local",
2837
+        "Mountpoint": "/var/lib/docker/volumes/tardis/_data",
2838
+        "Labels": {
2839
+            "com.example.some-label": "some-value",
2840
+            "com.example.some-other-label": "some-other-value"
2841
+        }
2838 2842
     }
2839 2843
 
2840 2844
 Status Codes:
... ...
@@ -3005,6 +3019,10 @@ Content-Type: application/json
3005 3005
     "com.docker.network.bridge.host_binding_ipv4": "0.0.0.0",
3006 3006
     "com.docker.network.bridge.name": "docker0",
3007 3007
     "com.docker.network.driver.mtu": "1500"
3008
+  },
3009
+  "Labels": {
3010
+    "com.example.some-label": "some-value",
3011
+    "com.example.some-other-label": "some-other-value"
3008 3012
   }
3009 3013
 }
3010 3014
 ```
... ...
@@ -3028,6 +3046,7 @@ Content-Type: application/json
3028 3028
 
3029 3029
 {
3030 3030
   "Name":"isolated_nw",
3031
+  "CheckDuplicate":false,
3031 3032
   "Driver":"bridge",
3032 3033
   "EnableIPv6": true,
3033 3034
   "IPAM":{
... ...
@@ -3046,7 +3065,19 @@ Content-Type: application/json
3046 3046
         "foo": "bar"
3047 3047
     }
3048 3048
   },
3049
-  "Internal":true
3049
+  "Internal":true,
3050
+  "Options": {
3051
+    "com.docker.network.bridge.default_bridge": "true",
3052
+    "com.docker.network.bridge.enable_icc": "true",
3053
+    "com.docker.network.bridge.enable_ip_masquerade": "true",
3054
+    "com.docker.network.bridge.host_binding_ipv4": "0.0.0.0",
3055
+    "com.docker.network.bridge.name": "docker0",
3056
+    "com.docker.network.driver.mtu": "1500"
3057
+  },
3058
+  "Labels": {
3059
+    "com.example.some-label": "some-value",
3060
+    "com.example.some-other-label": "some-other-value"
3061
+  }
3050 3062
 }
3051 3063
 ```
3052 3064
 
... ...
@@ -3071,12 +3102,13 @@ Status Codes:
3071 3071
 JSON Parameters:
3072 3072
 
3073 3073
 - **Name** - The new network's name. this is a mandatory field
3074
+- **CheckDuplicate** - Requests daemon to check for networks with same name
3074 3075
 - **Driver** - Name of the network driver plugin to use. Defaults to `bridge` driver
3075 3076
 - **Internal** - Restrict external access to the network
3076 3077
 - **IPAM** - Optional custom IP scheme for the network
3077 3078
 - **EnableIPv6** - Enable IPv6 on the network
3078 3079
 - **Options** - Network specific options to be used by the drivers
3079
-- **CheckDuplicate** - Requests daemon to check for networks with same name
3080
+- **Labels** - Labels to set on the network, specified as a map: `{"key":"value" [,"key2":"value2"]}`
3080 3081
 
3081 3082
 ### Connect a container to a network
3082 3083