mirror of https://github.com/docker/docker-py.git
Merge 30d050cc42
into db7f8b8bb6
This commit is contained in:
commit
405bb5c87f
|
@ -11,6 +11,20 @@ class Volume(Model):
|
|||
"""The name of the volume."""
|
||||
return self.attrs['Name']
|
||||
|
||||
@property
|
||||
def labels(self):
|
||||
"""
|
||||
The labels of a volume as dictionary.
|
||||
"""
|
||||
try:
|
||||
result = self.attrs['Config'].get('Labels')
|
||||
return result or {}
|
||||
except KeyError as ke:
|
||||
raise DockerException(
|
||||
'Label data is not available for sparse objects. Call reload()'
|
||||
' to retrieve all information'
|
||||
) from ke
|
||||
|
||||
def remove(self, force=False):
|
||||
"""
|
||||
Remove this volume.
|
||||
|
|
Loading…
Reference in New Issue