Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
Showing results for
Search instead for
Did you mean:
HowTo: List all of the draining nodes in Stingray using Python and REST
This question cropped up on our discussion forum: Re: How to use RESTful Control API with Python? - enable, disable, or drain node: How can I list the nodes that are draining in a Stingray configuration, much like the 'Draining' page in the UI.
You can get the list of nodes that are draining per-pool from /api/tm/1.0/config/active/pools/poolname; look at the properties->basic->draining value. There's no single action to get a list of all of the nodes that are draining in all pools. The UI reads each pool one at a time and merges the 'draining' lists from each; you will need to do the same.
The following Python code illustrates how you could do this: