mirror of
https://github.com/bentoml/OpenLLM.git
synced 2026-02-01 19:32:55 -05:00
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
113 lines
3.4 KiB
Python
Generated
113 lines
3.4 KiB
Python
Generated
"""This type stub file was generated by pyright."""
|
|
|
|
from .. import utils
|
|
|
|
class VolumeApiMixin:
|
|
def volumes(self, filters=...):
|
|
"""List volumes currently registered by the docker daemon. Similar to the
|
|
``docker volume ls`` command.
|
|
|
|
Args:
|
|
filters (dict): Server-side list filtering options.
|
|
|
|
Returns:
|
|
(dict): Dictionary with list of volume objects as value of the
|
|
``Volumes`` key.
|
|
|
|
Raises:
|
|
:py:class:`docker.errors.APIError`
|
|
If the server returns an error.
|
|
|
|
Example:
|
|
>>> client.api.volumes()
|
|
{u'Volumes': [{u'Driver': u'local',
|
|
u'Mountpoint': u'/var/lib/docker/volumes/foobar/_data',
|
|
u'Name': u'foobar'},
|
|
{u'Driver': u'local',
|
|
u'Mountpoint': u'/var/lib/docker/volumes/baz/_data',
|
|
u'Name': u'baz'}]}
|
|
"""
|
|
...
|
|
def create_volume(self, name=..., driver=..., driver_opts=..., labels=...):
|
|
"""Create and register a named volume.
|
|
|
|
Args:
|
|
name (str): Name of the volume
|
|
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:
|
|
(dict): The created volume reference object
|
|
|
|
Raises:
|
|
:py:class:`docker.errors.APIError`
|
|
If the server returns an error.
|
|
|
|
Example:
|
|
>>> volume = client.api.create_volume(
|
|
... name='foobar',
|
|
... driver='local',
|
|
... driver_opts={'foo': 'bar', 'baz': 'false'},
|
|
... labels={"key": "value"},
|
|
... )
|
|
... print(volume)
|
|
{u'Driver': u'local',
|
|
u'Labels': {u'key': u'value'},
|
|
u'Mountpoint': u'/var/lib/docker/volumes/foobar/_data',
|
|
u'Name': u'foobar',
|
|
u'Scope': u'local'}
|
|
|
|
"""
|
|
...
|
|
def inspect_volume(self, name):
|
|
"""Retrieve volume info by name.
|
|
|
|
Args:
|
|
name (str): volume name
|
|
|
|
Returns:
|
|
(dict): Volume information dictionary
|
|
|
|
Raises:
|
|
:py:class:`docker.errors.APIError`
|
|
If the server returns an error.
|
|
|
|
Example:
|
|
>>> client.api.inspect_volume('foobar')
|
|
{u'Driver': u'local',
|
|
u'Mountpoint': u'/var/lib/docker/volumes/foobar/_data',
|
|
u'Name': u'foobar'}
|
|
|
|
"""
|
|
...
|
|
@utils.minimum_version("1.25")
|
|
def prune_volumes(self, filters=...):
|
|
"""Delete unused volumes.
|
|
|
|
Args:
|
|
filters (dict): Filters to process on the prune list.
|
|
|
|
Returns:
|
|
(dict): A dict containing a list of deleted volume names and
|
|
the amount of disk space reclaimed in bytes.
|
|
|
|
Raises:
|
|
:py:class:`docker.errors.APIError`
|
|
If the server returns an error.
|
|
"""
|
|
...
|
|
def remove_volume(self, name, force=...): # -> None:
|
|
"""Remove a volume. Similar to the ``docker volume rm`` command.
|
|
|
|
Args:
|
|
name (str): The volume's name
|
|
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.
|
|
"""
|
|
...
|