docker node
NodeCLI
demote
demote(x)
Demote one or more nodes from manager in the swarm
PARAMETER | DESCRIPTION |
---|---|
x |
One or a list of nodes.
TYPE:
|
inspect
inspect(x)
Returns a python_on_whales.Node
object from a string
(id or hostname of the node)
PARAMETER | DESCRIPTION |
---|---|
x |
One id or hostname or a list of ids or hostnames
TYPE:
|
Returns
One or a list of `python_on_whales.Node`
list
list()
Returns the list of nodes in this swarm.
Returns
A `List[python_on_whales.Node]`
promote
promote(x)
Promote one or more nodes to manager in the swarm
PARAMETER | DESCRIPTION |
---|---|
x |
One or a list of nodes.
TYPE:
|
ps
ps(x=None)
Returns the list of swarm tasks running on one or more nodes.
from python_on_whales import docker
tasks = docker.node.ps("my-node-name")
print(tasks[0].desired_state)
# running
PARAMETER | DESCRIPTION |
---|---|
x |
One or more nodes (can be id, name or
TYPE:
|
Returns
`List[python_on_whales.Task]`
remove
remove(x, force=False)
Remove one or more nodes from the swarm
PARAMETER | DESCRIPTION |
---|---|
x |
One node or a list of nodes. You can use the id or the hostname of a node.
You can also use a
TYPE:
|
force |
Force remove a node from the swarm
TYPE:
|
update
update(node, availability=None, labels_add={}, rm_labels=[], role=None)
Updates a Swarm node.
PARAMETER | DESCRIPTION |
---|---|
node |
The node to update, you can use a string or a
TYPE:
|
availability |
Availability of the node ("active"|"pause"|"drain")
TYPE:
|
labels_add |
Remove a node label if exists
TYPE:
|
rm_labels |
Labels to remove from the node.
TYPE:
|
role |
Role of the node ("worker"|"manager")
TYPE:
|