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 terminating lifecycle 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_time seconds 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’s COMPLETE. If the node doesn’t reach the COMPLETE state after wait_time seconds, 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 COMPLETE state.

  • 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.