airflow.contrib.hooks.redshift_hook

Module Contents

class airflow.contrib.hooks.redshift_hook.RedshiftHook[source]

Bases:airflow.contrib.hooks.aws_hook.AwsHook

Interact with AWS Redshift, using the boto3 library

get_conn(self)[source]
cluster_status(self, cluster_identifier)[source]

Return status of a cluster

Parameters

cluster_identifier (str) – unique identifier of a cluster

delete_cluster(self, cluster_identifier, skip_final_cluster_snapshot=True, final_cluster_snapshot_identifier='')[source]

Delete a cluster and optionally create a snapshot

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

  • skip_final_cluster_snapshot (bool) – determines cluster snapshot creation

  • final_cluster_snapshot_identifier (str) – name of final cluster snapshot

describe_cluster_snapshots(self, cluster_identifier)[source]

Gets a list of snapshots for a cluster

Parameters

cluster_identifier (str) – unique identifier of a cluster

restore_from_cluster_snapshot(self, cluster_identifier, snapshot_identifier)[source]

Restores a cluster from its snapshot

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

  • snapshot_identifier (str) – unique identifier for a snapshot of a cluster

create_cluster_snapshot(self, snapshot_identifier, cluster_identifier)[source]

Creates a snapshot of a cluster

Parameters
  • snapshot_identifier (str) – unique identifier for a snapshot of a cluster

  • cluster_identifier (str) – unique identifier of a cluster