Signed-off-by: allencloud <allen.sun@daocloud.io>
| ... | ... |
@@ -2906,7 +2906,9 @@ Return low-level information about the `exec` command `id`. |
| 2906 | 2906 |
{
|
| 2907 | 2907 |
"Name": "tardis", |
| 2908 | 2908 |
"Driver": "local", |
| 2909 |
- "Mountpoint": "/var/lib/docker/volumes/tardis" |
|
| 2909 |
+ "Mountpoint": "/var/lib/docker/volumes/tardis", |
|
| 2910 |
+ "Labels": null, |
|
| 2911 |
+ "Scope": "local" |
|
| 2910 | 2912 |
} |
| 2911 | 2913 |
], |
| 2912 | 2914 |
"Warnings": [] |
| ... | ... |
@@ -2941,6 +2943,7 @@ Create a volume |
| 2941 | 2941 |
"com.example.some-label": "some-value", |
| 2942 | 2942 |
"com.example.some-other-label": "some-other-value" |
| 2943 | 2943 |
}, |
| 2944 |
+ "Driver": "custom" |
|
| 2944 | 2945 |
} |
| 2945 | 2946 |
|
| 2946 | 2947 |
**Example response**: |
| ... | ... |
@@ -2950,13 +2953,16 @@ Create a volume |
| 2950 | 2950 |
|
| 2951 | 2951 |
{
|
| 2952 | 2952 |
"Name": "tardis", |
| 2953 |
- "Driver": "local", |
|
| 2953 |
+ "Driver": "custom", |
|
| 2954 | 2954 |
"Mountpoint": "/var/lib/docker/volumes/tardis", |
| 2955 |
- "Status": null, |
|
| 2955 |
+ "Status": {
|
|
| 2956 |
+ "hello": "world" |
|
| 2957 |
+ }, |
|
| 2956 | 2958 |
"Labels": {
|
| 2957 | 2959 |
"com.example.some-label": "some-value", |
| 2958 | 2960 |
"com.example.some-other-label": "some-other-value" |
| 2959 | 2961 |
}, |
| 2962 |
+ "Scope": "local" |
|
| 2960 | 2963 |
} |
| 2961 | 2964 |
|
| 2962 | 2965 |
**Status codes**: |
| ... | ... |
@@ -2970,8 +2976,13 @@ Create a volume |
| 2970 | 2970 |
- **Driver** - Name of the volume driver to use. Defaults to `local` for the name. |
| 2971 | 2971 |
- **DriverOpts** - A mapping of driver options and values. These options are |
| 2972 | 2972 |
passed directly to the driver and are driver specific. |
| 2973 |
-- **Labels** - Labels to set on the volume, specified as a map: `{"key":"value" [,"key2":"value2"]}`
|
|
| 2973 |
+- **Labels** - Labels to set on the volume, specified as a map: `{"key":"value","key2":"value2"}`
|
|
| 2974 | 2974 |
|
| 2975 |
+**JSON fields in response**: |
|
| 2976 |
+ |
|
| 2977 |
+Refer to the [inspect a volume](#inspect-a-volume) section or details about the |
|
| 2978 |
+JSON fields returned in the response. |
|
| 2979 |
+ |
|
| 2975 | 2980 |
### Inspect a volume |
| 2976 | 2981 |
|
| 2977 | 2982 |
`GET /volumes/(name)` |
| ... | ... |
@@ -2989,12 +3000,16 @@ Return low-level information on the volume `name` |
| 2989 | 2989 |
|
| 2990 | 2990 |
{
|
| 2991 | 2991 |
"Name": "tardis", |
| 2992 |
- "Driver": "local", |
|
| 2992 |
+ "Driver": "custom", |
|
| 2993 | 2993 |
"Mountpoint": "/var/lib/docker/volumes/tardis/_data", |
| 2994 |
+ "Status": {
|
|
| 2995 |
+ "hello": "world" |
|
| 2996 |
+ }, |
|
| 2994 | 2997 |
"Labels": {
|
| 2995 | 2998 |
"com.example.some-label": "some-value", |
| 2996 | 2999 |
"com.example.some-other-label": "some-other-value" |
| 2997 |
- } |
|
| 3000 |
+ }, |
|
| 3001 |
+ "Scope": "local" |
|
| 2998 | 3002 |
} |
| 2999 | 3003 |
|
| 3000 | 3004 |
**Status codes**: |
| ... | ... |
@@ -3003,6 +3018,23 @@ Return low-level information on the volume `name` |
| 3003 | 3003 |
- **404** - no such volume |
| 3004 | 3004 |
- **500** - server error |
| 3005 | 3005 |
|
| 3006 |
+**JSON fields in response**: |
|
| 3007 |
+ |
|
| 3008 |
+The following fields can be returned in the API response. Empty fields, or |
|
| 3009 |
+fields that are not supported by the volume's driver may be omitted in the |
|
| 3010 |
+response. |
|
| 3011 |
+ |
|
| 3012 |
+- **Name** - Name of the volume. |
|
| 3013 |
+- **Driver** - Name of the volume driver used by the volume. |
|
| 3014 |
+- **Mountpoint** - Mount path of the volume on the host. |
|
| 3015 |
+- **Status** - Low-level details about the volume, provided by the volume driver. |
|
| 3016 |
+ Details are returned as a map with key/value pairs: `{"key":"value","key2":"value2"}`.
|
|
| 3017 |
+ The `Status` field is optional, and is omitted if the volume driver does not |
|
| 3018 |
+ support this feature. |
|
| 3019 |
+- **Labels** - Labels set on the volume, specified as a map: `{"key":"value","key2":"value2"}`.
|
|
| 3020 |
+- **Scope** - Scope describes the level at which the volume exists, can be one of |
|
| 3021 |
+ `global` for cluster-wide or `local` for machine level. The default is `local`. |
|
| 3022 |
+ |
|
| 3006 | 3023 |
### Remove a volume |
| 3007 | 3024 |
|
| 3008 | 3025 |
`DELETE /volumes/(name)` |
| ... | ... |
@@ -2912,7 +2912,12 @@ Return low-level information about the `exec` command `id`. |
| 2912 | 2912 |
{
|
| 2913 | 2913 |
"Name": "tardis", |
| 2914 | 2914 |
"Driver": "local", |
| 2915 |
- "Mountpoint": "/var/lib/docker/volumes/tardis" |
|
| 2915 |
+ "Mountpoint": "/var/lib/docker/volumes/tardis", |
|
| 2916 |
+ "Labels":{
|
|
| 2917 |
+ "com.example.some-label": "some-value", |
|
| 2918 |
+ "com.example.some-other-label": "some-other-value" |
|
| 2919 |
+ }, |
|
| 2920 |
+ "Scope": "local" |
|
| 2916 | 2921 |
} |
| 2917 | 2922 |
], |
| 2918 | 2923 |
"Warnings": [] |
| ... | ... |
@@ -2956,13 +2961,16 @@ Create a volume |
| 2956 | 2956 |
|
| 2957 | 2957 |
{
|
| 2958 | 2958 |
"Name": "tardis", |
| 2959 |
- "Driver": "local", |
|
| 2959 |
+ "Driver": "custom", |
|
| 2960 | 2960 |
"Mountpoint": "/var/lib/docker/volumes/tardis", |
| 2961 |
- "Status": null, |
|
| 2961 |
+ "Status": {
|
|
| 2962 |
+ "hello": "world" |
|
| 2963 |
+ }, |
|
| 2962 | 2964 |
"Labels": {
|
| 2963 | 2965 |
"com.example.some-label": "some-value", |
| 2964 | 2966 |
"com.example.some-other-label": "some-other-value" |
| 2965 | 2967 |
}, |
| 2968 |
+ "Scope": "local" |
|
| 2966 | 2969 |
} |
| 2967 | 2970 |
|
| 2968 | 2971 |
**Status codes**: |
| ... | ... |
@@ -2976,7 +2984,12 @@ Create a volume |
| 2976 | 2976 |
- **Driver** - Name of the volume driver to use. Defaults to `local` for the name. |
| 2977 | 2977 |
- **DriverOpts** - A mapping of driver options and values. These options are |
| 2978 | 2978 |
passed directly to the driver and are driver specific. |
| 2979 |
-- **Labels** - Labels to set on the volume, specified as a map: `{"key":"value" [,"key2":"value2"]}`
|
|
| 2979 |
+- **Labels** - Labels to set on the volume, specified as a map: `{"key":"value","key2":"value2"}`
|
|
| 2980 |
+ |
|
| 2981 |
+**JSON fields in response**: |
|
| 2982 |
+ |
|
| 2983 |
+Refer to the [inspect a volume](#inspect-a-volume) section or details about the |
|
| 2984 |
+JSON fields returned in the response. |
|
| 2980 | 2985 |
|
| 2981 | 2986 |
### Inspect a volume |
| 2982 | 2987 |
|
| ... | ... |
@@ -2995,12 +3008,16 @@ Return low-level information on the volume `name` |
| 2995 | 2995 |
|
| 2996 | 2996 |
{
|
| 2997 | 2997 |
"Name": "tardis", |
| 2998 |
- "Driver": "local", |
|
| 2998 |
+ "Driver": "custom", |
|
| 2999 |
+ "Status": {
|
|
| 3000 |
+ "hello": "world" |
|
| 3001 |
+ }, |
|
| 2999 | 3002 |
"Mountpoint": "/var/lib/docker/volumes/tardis/_data", |
| 3000 | 3003 |
"Labels": {
|
| 3001 | 3004 |
"com.example.some-label": "some-value", |
| 3002 | 3005 |
"com.example.some-other-label": "some-other-value" |
| 3003 |
- } |
|
| 3006 |
+ }, |
|
| 3007 |
+ "Scope": "local" |
|
| 3004 | 3008 |
} |
| 3005 | 3009 |
|
| 3006 | 3010 |
**Status codes**: |
| ... | ... |
@@ -3009,6 +3026,23 @@ Return low-level information on the volume `name` |
| 3009 | 3009 |
- **404** - no such volume |
| 3010 | 3010 |
- **500** - server error |
| 3011 | 3011 |
|
| 3012 |
+**JSON fields in response**: |
|
| 3013 |
+ |
|
| 3014 |
+The following fields can be returned in the API response. Empty fields, or |
|
| 3015 |
+fields that are not supported by the volume's driver may be omitted in the |
|
| 3016 |
+response. |
|
| 3017 |
+ |
|
| 3018 |
+- **Name** - Name of the volume. |
|
| 3019 |
+- **Driver** - Name of the volume driver used by the volume. |
|
| 3020 |
+- **Mountpoint** - Mount path of the volume on the host. |
|
| 3021 |
+- **Status** - Low-level details about the volume, provided by the volume driver. |
|
| 3022 |
+ Details are returned as a map with key/value pairs: `{"key":"value","key2":"value2"}`.
|
|
| 3023 |
+ The `Status` field is optional, and is omitted if the volume driver does not |
|
| 3024 |
+ support this feature. |
|
| 3025 |
+- **Labels** - Labels set on the volume, specified as a map: `{"key":"value","key2":"value2"}`.
|
|
| 3026 |
+- **Scope** - Scope describes the level at which the volume exists, can be one of |
|
| 3027 |
+ `global` for cluster-wide or `local` for machine level. The default is `local`. |
|
| 3028 |
+ |
|
| 3012 | 3029 |
### Remove a volume |
| 3013 | 3030 |
|
| 3014 | 3031 |
`DELETE /volumes/(name)` |