MCPcopy Index your code
hub / github.com/docker/docker-py / list

Method list

docker/models/volumes.py:78–95  ·  view source on GitHub ↗

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`

(self, **kwargs)

Source from the content-addressed store, hash-verified

76 return self.prepare_model(self.client.api.inspect_volume(volume_id))
77
78 def list(self, **kwargs):
79 """
80 List volumes. Similar to the ``docker volume ls`` command.
81
82 Args:
83 filters (dict): Server-side list filtering options.
84
85 Returns:
86 (list of :py:class:`Volume`): The volumes.
87
88 Raises:
89 :py:class:`docker.errors.APIError`
90 If the server returns an error.
91 """
92 resp = self.client.api.volumes(**kwargs)
93 if not resp.get('Volumes'):
94 return []
95 return [self.prepare_model(obj) for obj in resp['Volumes']]
96
97 def prune(self, filters=None):
98 return self.client.api.prune_volumes(filters=filters)

Callers

nothing calls this directly

Calls 3

prepare_modelMethod · 0.80
volumesMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected