blob: 772b2b078370f915b2133d3dd4f372465c380f8f [file] [log] [blame]
:py:mod:`airflow.providers.amazon.aws.hooks.redshift_cluster`
=============================================================
.. py:module:: airflow.providers.amazon.aws.hooks.redshift_cluster
Module Contents
---------------
Classes
~~~~~~~
.. autoapisummary::
airflow.providers.amazon.aws.hooks.redshift_cluster.RedshiftHook
.. py:class:: RedshiftHook(*args, **kwargs)
Bases: :py:obj:`airflow.providers.amazon.aws.hooks.base_aws.AwsBaseHook`
Interact with AWS Redshift, using the boto3 library
Additional arguments (such as ``aws_conn_id``) may be specified and
are passed down to the underlying AwsBaseHook.
.. seealso::
:class:`~airflow.providers.amazon.aws.hooks.base_aws.AwsBaseHook`
:param aws_conn_id: The Airflow connection used for AWS credentials.
.. py:attribute:: template_fields
:annotation: :Sequence[str] = ['cluster_identifier']
.. py:method:: create_cluster(cluster_identifier, node_type, master_username, master_user_password, params)
Creates a new cluster with the specified parameters
:param cluster_identifier: A unique identifier for the cluster.
:param node_type: The node type to be provisioned for the cluster.
Valid Values: ``ds2.xlarge``, ``ds2.8xlarge``, ``dc1.large``,
``dc1.8xlarge``, ``dc2.large``, ``dc2.8xlarge``, ``ra3.xlplus``,
``ra3.4xlarge``, and ``ra3.16xlarge``.
:param master_username: The username associated with the admin user account
for the cluster that is being created.
:param master_user_password: password associated with the admin user account
for the cluster that is being created.
:param params: Remaining AWS Create cluster API params.
.. py:method:: cluster_status(cluster_identifier)
Return status of a cluster
:param cluster_identifier: unique identifier of a cluster
:param skip_final_cluster_snapshot: determines cluster snapshot creation
:param final_cluster_snapshot_identifier: Optional[str]
.. py:method:: delete_cluster(cluster_identifier, skip_final_cluster_snapshot = True, final_cluster_snapshot_identifier = None)
Delete a cluster and optionally create a snapshot
:param cluster_identifier: unique identifier of a cluster
:param skip_final_cluster_snapshot: determines cluster snapshot creation
:param final_cluster_snapshot_identifier: name of final cluster snapshot
.. py:method:: describe_cluster_snapshots(cluster_identifier)
Gets a list of snapshots for a cluster
:param cluster_identifier: unique identifier of a cluster
.. py:method:: restore_from_cluster_snapshot(cluster_identifier, snapshot_identifier)
Restores a cluster from its snapshot
:param cluster_identifier: unique identifier of a cluster
:param snapshot_identifier: unique identifier for a snapshot of a cluster
.. py:method:: create_cluster_snapshot(snapshot_identifier, cluster_identifier, retention_period = -1)
Creates a snapshot of a cluster
:param snapshot_identifier: unique identifier for a snapshot of a cluster
:param cluster_identifier: unique identifier of a cluster
:param retention_period: The number of days that a manual snapshot is retained.
If the value is -1, the manual snapshot is retained indefinitely.
.. py:method:: get_cluster_snapshot_status(snapshot_identifier, cluster_identifier)
Return Redshift cluster snapshot status. If cluster snapshot not found return ``None``
:param snapshot_identifier: A unique identifier for the snapshot that you are requesting
:param cluster_identifier: The unique identifier of the cluster the snapshot was created from