astronomer.providers.amazon.aws.hooks.redshift_cluster

Module Contents

Classes

RedshiftHookAsync

Interact with AWS Redshift using aiobotocore python library

class astronomer.providers.amazon.aws.hooks.redshift_cluster.RedshiftHookAsync(*args, **kwargs)[source]

Bases: astronomer.providers.amazon.aws.hooks.base_aws.AwsBaseHookAsync

Interact with AWS Redshift using aiobotocore python library

async cluster_status(cluster_identifier, delete_operation=False)[source]

Connects to the AWS redshift cluster via aiobotocore and get the status and returns the status of the cluster based on the cluster_identifier passed

Parameters:
  • cluster_identifier (str) – unique identifier of a cluster

  • delete_operation (bool) – whether the method has been called as part of delete cluster operation

async delete_cluster(cluster_identifier, skip_final_cluster_snapshot=True, final_cluster_snapshot_identifier=None, polling_period_seconds=5.0)[source]

Connects to the AWS redshift cluster via aiobotocore and deletes the cluster based on the cluster_identifier passed

Parameters:
  • cluster_identifier (str) – unique identifier of a cluster

  • skip_final_cluster_snapshot (bool) – determines cluster snapshot creation

  • final_cluster_snapshot_identifier (Optional[str]) – name of final cluster snapshot

  • polling_period_seconds (float) – polling period in seconds to check for the status

async pause_cluster(cluster_identifier, polling_period_seconds=5.0)[source]

Connects to the AWS redshift cluster via aiobotocore and pause the cluster based on the cluster_identifier passed

Parameters:
  • cluster_identifier (str) – unique identifier of a cluster

  • polling_period_seconds (float) – polling period in seconds to check for the status

async resume_cluster(cluster_identifier, polling_period_seconds=5.0)[source]

Connects to the AWS redshift cluster via aiobotocore and resume the cluster for the cluster_identifier passed

Parameters:
  • cluster_identifier (str) – unique identifier of a cluster

  • polling_period_seconds (float) – polling period in seconds to check for the status

async get_cluster_status(cluster_identifier, expected_state, flag, delete_operation=False)[source]

Make call self.cluster_status to know the status and run till the expected_state is met and set the flag

Parameters:
  • cluster_identifier (str) – unique identifier of a cluster

  • expected_state (str) – expected_state example(“available”, “pausing”, “paused””)

  • flag (asyncio.Event) – asyncio even flag set true if success and if any error

  • delete_operation (bool) – whether the method has been called as part of delete cluster operation