pools¶
Pools
¶
-
class
stingray.config.pools.
Pools
(host=None, port=None, user=None, password=None, api_version=None, ssl_verify=None)[source]¶ Bases:
stingray.apiclient.Client
Class for interacting with Pools via the REST API
-
add
(pool, nodes=None, **pool_props)[source]¶ Add a new load balancer pool
Parameters: - pool (str) – The name of the pool to add
- nodes (list) – List of nodes for the pool
- pool_props (dict) –
Additional arguments to set properties of the pool at time of creation. Must be a dict in the form of:
{'section': {'key': 'value'}}
Returns: The new pool
Return type: (Pool)
-
Pool
¶
-
class
stingray.config.pools.
Pool
(pool_name, pool_path, pool_properties=None, host=None, port=None, user=None, password=None, api_version=None, ssl_verify=None)[source]¶ Bases:
stingray.apiclient.Client
Class for interacting with individual pools via the REST API
-
add_node
(node, state='active', priority=1, weight=1)[source]¶ Add a new node to the pool
Parameters: - node (str) – The node to add. Must be in accepted pool node config
format:
<ip or dns name>:<port>
- state (str) – active, draining, or disabled. Default is active because it should be pretty rare to add a node in any other state.
- priority (int) – Load balancer priority for the node
- weight (int) – Load balancer weight for the node
Returns: Pool nodes status
Return type: (dict)
- node (str) – The node to add. Must be in accepted pool node config
format:
-
delete_node
(node)[source]¶ Delete a node from the pool
Parameters: node (str) – The node to delete Returns: Pool nodes status Return type: (dict)
-
disable_node
(node)[source]¶ Disable a node in the pool
Parameters: node (str) – The node to disable Returns: Pool nodes status Return type: (dict)
-
drain_node
(node)[source]¶ Set a node in the pool to draining status
Parameters: node (str) – The node to drain Returns: Pool nodes status Return type: (dict)
-
enable_node
(node)[source]¶ Reenable a node in the pool
Parameters: node (str) – The node to enable Returns: Pool nodes status Return type: (dict)
-