A node in a swarm.
Method | remove |
Remove this node from the swarm. |
Method | update |
Update the node's configuration. |
Class Variable | id |
Undocumented |
Property | version |
The version number of the service. If this is not the same as the server, the :py:meth:`update` function will not work and you will need to call :py:meth:`reload` before calling it again. |
Inherited from Model
:
Method | __eq__ |
Undocumented |
Method | __hash__ |
Undocumented |
Method | __init__ |
Undocumented |
Method | __repr__ |
Undocumented |
Method | reload |
Load this object from the server again and update ``attrs`` with the new data. |
Instance Variable | attrs |
Undocumented |
Instance Variable | client |
Undocumented |
Instance Variable | collection |
Undocumented |
Property | id |
The ID of the object. |
Property | short |
The ID of the object, truncated to 12 characters. |
Remove this node from the swarm. Args: force (bool): Force remove an active node. Default: `False` Returns: `True` if the request was successful. Raises: :py:class:`docker.errors.NotFound` If the node doesn't exist in the swarm. :py:class:`docker.errors.APIError` If the server returns an error.
Update the node's configuration. Args: node_spec (dict): Configuration settings to update. Any values not provided will be removed. Default: ``None`` Returns: `True` if the request went through. Raises: :py:class:`docker.errors.APIError` If the server returns an error. Example: >>> node_spec = {'Availability': 'active', 'Name': 'node-name', 'Role': 'manager', 'Labels': {'foo': 'bar'} } >>> node.update(node_spec)