infrahouse_toolkit.cli.ih_elastic.cmd_cluster.cmd_decommision_node package¶
Module contents¶
- infrahouse_toolkit.cli.ih_elastic.cmd_cluster.cmd_decommision_node.complete_lifecycle_action()[source]¶
Completes the
terminatinglifecycle hook. If it fails, cancel all instance refreshes in the autoscaling group.
- infrahouse_toolkit.cli.ih_elastic.cmd_cluster.cmd_decommision_node.wait_until_complete(client: ShutdownClient, node_id: str, wait_time: int = 3600, hook_name: str = 'terminating')[source]¶
Give up to
wait_timeseconds to Elasticsearch to move shards out of the node. The function periodically checks the node’s shutdown info (https://www.elastic.co/guide/en/elasticsearch/reference/current/get-shutdown.html) until it’sCOMPLETE. If the node doesn’t reach theCOMPLETEstate afterwait_timeseconds, raise TimeoutError.- Parameters:
client (ShutdownClient) – a shutdown Elasticsearch client.
node_id (str) – Elasticsearch node identifier.
wait_time (int) – Time in second to wait for the
COMPLETEstate.hook_name (str) – Lifecycle hook name to extend while waiting.
- Raises:
TimeoutError – if after
wait_time, Elasticsearch hasn’t moved all shards from the node.