Description
I want to manage the labels on nodes. I can use client.nodes() or client.inspect_node(id) to get the current configuration, but I would like to be able to update the labels via Python.
The command line that I can run to manually add labels is
docker node update --label-add my.key="my value" 269...mynodeid...gd
This is a snippet of the output from the client.nodes() output.
'Spec': { 'Availability': 'active',
'Labels': {'my.key': 'my value'},
'Role': 'worker'},
The closest thing in the code now is in the swarm.py
The API docs show it in the nodes section. I can add a pull request. Would you prefer that I add an update_node function to the swarm.py or refactor to pull the node related changes out of swarm.py and put it into a nodes.py file?
I am thinking something in the style of the create_volumes function that takes named parameters, converts them to json and posts to the nodes/{id} url. I would also like to promote nodes between worker and manager. I think that could Any thoughts on that?