
                          L    S SK Jr  SSKJrJr   " S S\5      r " S S\5      rg)	   )	APIClient   )Model
Collectionc                   6    \ rS rSrSrSr\S 5       rSS jrSr	g)	Volume   z	A volume.Namec                      U R                   S   $ )zThe name of the volume.r
   )attrs)selfs    (lib/third_party/docker/models/volumes.pynameVolume.name	   s     zz&!!    c                 ^    U R                   R                  R                  U R                  US9$ )z
Remove this volume.

Args:
    force (bool): Force removal of volumes that were already removed
        out of band by the volume driver plugin.
Raises:
    :py:class:`docker.errors.APIError`
        If volume failed to remove.
)force)clientapiremove_volumeid)r   r   s     r   removeVolume.remove   s&     {{,,TWWE,BBr    N)F)
__name__
__module____qualname____firstlineno____doc__id_attributepropertyr   r   __static_attributes__r   r   r   r   r      s"    L" "Cr   r   c                   r    \ rS rSrSr\rS	S jrS rS r	S	S jr
\R                  R                  \
l        Srg)
VolumeCollection   zVolumes on the Docker server.Nc                 r    U R                   R                  R                  " U40 UD6nU R                  U5      $ )ac  
Create a volume.

Args:
    name (str): Name of the volume.  If not specified, the engine
        generates a name.
    driver (str): Name of the driver used to create the volume
    driver_opts (dict): Driver options as a key-value dictionary
    labels (dict): Labels to set on the volume

Returns:
    (:py:class:`Volume`): The volume created.

Raises:
    :py:class:`docker.errors.APIError`
        If the server returns an error.

Example:

    >>> volume = client.volumes.create(name='foobar', driver='local',
            driver_opts={'foo': 'bar', 'baz': 'false'},
            labels={"key": "value"})

)r   r   create_volumeprepare_model)r   r   kwargsobjs       r   createVolumeCollection.create    s2    2 kkoo++D;F;!!#&&r   c                 j    U R                  U R                  R                  R                  U5      5      $ )a  
Get a volume.

Args:
    volume_id (str): Volume name.

Returns:
    (:py:class:`Volume`): The volume.

Raises:
    :py:class:`docker.errors.NotFound`
        If the volume does not exist.
    :py:class:`docker.errors.APIError`
        If the server returns an error.
)r(   r   r   inspect_volume)r   	volume_ids     r   getVolumeCollection.get<   s(      !!$++//"@"@"KLLr   c                     U R                   R                  R                  " S0 UD6nUR                  S5      (       d  / $ US    Vs/ s H  o0R	                  U5      PM     sn$ s  snf )a  
List volumes. Similar to the ``docker volume ls`` command.

Args:
    filters (dict): Server-side list filtering options.

Returns:
    (list of :py:class:`Volume`): The volumes.

Raises:
    :py:class:`docker.errors.APIError`
        If the server returns an error.
Volumesr   )r   r   volumesr0   r(   )r   r)   respr*   s       r   listVolumeCollection.listN   sX     {{&&00xx	""I37	?C?C""3'?CCCs   A#c                 H    U R                   R                  R                  US9$ )N)filters)r   r   prune_volumes)r   r9   s     r   pruneVolumeCollection.prunea   s    {{,,W,==r   r   )N)r   r   r   r   r   r   modelr+   r0   r6   r;   r   r:   r"   r   r   r   r$   r$      s3    'E'8M$D&>++33EMr   r$   N)r   r   resourcer   r   r   r$   r   r   r   <module>r?      s'     'CU C.G4z G4r   