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

Method remove_node

docker/api/swarm.py:321–344  ·  view source on GitHub ↗

Remove a node from the swarm. Args: node_id (string): ID of the node to be removed. force (bool): Force remove an active node. Default: `False` Raises: :py:class:`docker.errors.NotFound` If the node referenced doesn't exi

(self, node_id, force=False)

Source from the content-addressed store, hash-verified

319 @utils.check_resource('node_id')
320 @utils.minimum_version('1.24')
321 def remove_node(self, node_id, force=False):
322 """
323 Remove a node from the swarm.
324
325 Args:
326 node_id (string): ID of the node to be removed.
327 force (bool): Force remove an active node. Default: `False`
328
329 Raises:
330 :py:class:`docker.errors.NotFound`
331 If the node referenced doesn't exist in the swarm.
332
333 :py:class:`docker.errors.APIError`
334 If the server returns an error.
335 Returns:
336 `True` if the request was successful.
337 """
338 url = self._url('/nodes/{0}', node_id)
339 params = {
340 'force': force
341 }
342 res = self._delete(url, params=params)
343 self._raise_for_status(res)
344 return True
345
346 @utils.minimum_version('1.24')
347 def unlock_swarm(self, key):

Callers 2

test_remove_main_nodeMethod · 0.80
removeMethod · 0.80

Calls 3

_urlMethod · 0.80
_deleteMethod · 0.80
_raise_for_statusMethod · 0.80

Tested by 1

test_remove_main_nodeMethod · 0.64