class documentation
class NodeCollection(Collection): (source)
Nodes on the Docker server.
Method | get |
Get a node. |
Method | list |
List swarm nodes. |
Inherited from Collection
:
Method | __call__ |
Undocumented |
Method | __init__ |
Undocumented |
Method | create |
Undocumented |
Method | prepare |
Create a model from a set of attributes. |
Class Variable | model |
Undocumented |
Instance Variable | client |
Undocumented |
overrides
docker.models.resource.Collection.get
Get a node. Args: node_id (string): ID of the node to be inspected. Returns: A :py:class:`Node` object. Raises: :py:class:`docker.errors.APIError` If the server returns an error.
overrides
docker.models.resource.Collection.list
List swarm nodes. Args: filters (dict): Filters to process on the nodes list. Valid filters: ``id``, ``name``, ``membership`` and ``role``. Default: ``None`` Returns: A list of :py:class:`Node` objects. Raises: :py:class:`docker.errors.APIError` If the server returns an error. Example: >>> client.nodes.list(filters={'role': 'manager'})