Merge pull request #25604 from allencloud/add-missing-fields-in-volume-api

add fields in volume api for 1.24, 1.25
(cherry picked from commit a3432c2fdb)

Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>

Conflicts:
	docs/reference/api/docker_remote_api_v1.25.md
This commit is contained in:
Vincent Demeester 2016-08-11 14:03:25 +02:00 committed by Sven Dowideit
parent 61fe5dabe3
commit 151b799147

View file

@ -2906,7 +2906,9 @@ Return low-level information about the `exec` command `id`.
{
"Name": "tardis",
"Driver": "local",
"Mountpoint": "/var/lib/docker/volumes/tardis"
"Mountpoint": "/var/lib/docker/volumes/tardis",
"Labels": null,
"Scope": "local"
}
],
"Warnings": []
@ -2941,6 +2943,7 @@ Create a volume
"com.example.some-label": "some-value",
"com.example.some-other-label": "some-other-value"
},
"Driver": "custom"
}
**Example response**:
@ -2950,13 +2953,16 @@ Create a volume
{
"Name": "tardis",
"Driver": "local",
"Driver": "custom",
"Mountpoint": "/var/lib/docker/volumes/tardis",
"Status": null,
"Status": {
"hello": "world"
},
"Labels": {
"com.example.some-label": "some-value",
"com.example.some-other-label": "some-other-value"
},
"Scope": "local"
}
**Status codes**:
@ -2970,8 +2976,13 @@ Create a volume
- **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
passed directly to the driver and are driver specific.
- **Labels** - Labels to set on the volume, specified as a map: `{"key":"value" [,"key2":"value2"]}`
- **Labels** - Labels to set on the volume, specified as a map: `{"key":"value","key2":"value2"}`
**JSON fields in response**:
Refer to the [inspect a volume](#inspect-a-volume) section or details about the
JSON fields returned in the response.
### Inspect a volume
`GET /volumes/(name)`
@ -2989,12 +3000,16 @@ Return low-level information on the volume `name`
{
"Name": "tardis",
"Driver": "local",
"Driver": "custom",
"Mountpoint": "/var/lib/docker/volumes/tardis/_data",
"Status": {
"hello": "world"
},
"Labels": {
"com.example.some-label": "some-value",
"com.example.some-other-label": "some-other-value"
}
},
"Scope": "local"
}
**Status codes**:
@ -3003,6 +3018,23 @@ Return low-level information on the volume `name`
- **404** - no such volume
- **500** - server error
**JSON fields in response**:
The following fields can be returned in the API response. Empty fields, or
fields that are not supported by the volume's driver may be omitted in the
response.
- **Name** - Name of the volume.
- **Driver** - Name of the volume driver used by the volume.
- **Mountpoint** - Mount path of the volume on the host.
- **Status** - Low-level details about the volume, provided by the volume driver.
Details are returned as a map with key/value pairs: `{"key":"value","key2":"value2"}`.
The `Status` field is optional, and is omitted if the volume driver does not
support this feature.
- **Labels** - Labels set on the volume, specified as a map: `{"key":"value","key2":"value2"}`.
- **Scope** - Scope describes the level at which the volume exists, can be one of
`global` for cluster-wide or `local` for machine level. The default is `local`.
### Remove a volume
`DELETE /volumes/(name)`