class documentation

class NodeCollection(Collection): (source)

View In Hierarchy

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_model Create a model from a set of attributes.
Class Variable model Undocumented
Instance Variable client Undocumented
def get(self, node_id): (source)

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.

def list(self, *args, **kwargs): (source)

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'})