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)
| 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): |