Add support for declaring named volumes in compose files
* Bump default API version to 1.21 (required for named volume management) * Introduce new, versioned compose file format while maintaining support for current (legacy) format * Test updates to reflect changes made to the internal API Signed-off-by: Joffrey F <joffrey@docker.com>
This commit is contained in:
parent
4bf2f8c4f9
commit
b4be7b870f
14 changed files with 262 additions and 81 deletions
19
compose/volume.py
Normal file
19
compose/volume.py
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
from __future__ import unicode_literals
|
||||
|
||||
|
||||
class Volume(object):
|
||||
def __init__(self, client, project, name, driver=None, driver_opts=None):
|
||||
self.client = client
|
||||
self.project = project
|
||||
self.name = name
|
||||
self.driver = driver
|
||||
self.driver_opts = driver_opts
|
||||
|
||||
def create(self):
|
||||
return self.client.create_volume(self.name, self.driver, self.driver_opts)
|
||||
|
||||
def remove(self):
|
||||
return self.client.remove_volume(self.name)
|
||||
|
||||
def inspect(self):
|
||||
return self.client.inspect_volume(self.name)
|
||||
Loading…
Add table
Add a link
Reference in a new issue