airflow.providers.amazon.aws.operators.redshift_cluster¶
類¶
使用指定引數建立一個新叢集。 |
|
為指定叢集建立一個手動快照。叢集必須處於可用狀態。 |
|
刪除指定的手動快照。 |
|
恢復已暫停的 AWS Redshift 叢集。 |
|
如果 AWS Redshift 叢集的狀態為 available,則暫停它。 |
|
刪除 AWS Redshift 叢集。 |
模組內容¶
- class airflow.providers.amazon.aws.operators.redshift_cluster.RedshiftCreateClusterOperator(*, cluster_identifier, node_type, master_username, master_user_password, cluster_type='multi-node', db_name='dev', number_of_nodes=1, cluster_security_groups=None, vpc_security_group_ids=None, cluster_subnet_group_name=None, availability_zone=None, preferred_maintenance_window=None, cluster_parameter_group_name=None, automated_snapshot_retention_period=1, manual_snapshot_retention_period=None, port=5439, cluster_version='1.0', allow_version_upgrade=True, publicly_accessible=True, encrypted=False, hsm_client_certificate_identifier=None, hsm_configuration_identifier=None, elastic_ip=None, tags=None, kms_key_id=None, enhanced_vpc_routing=False, additional_info=None, iam_roles=None, maintenance_track_name=None, snapshot_schedule_identifier=None, availability_zone_relocation=None, aqua_configuration_status=None, default_iam_role_arn=None, aws_conn_id='aws_default', wait_for_completion=False, max_attempt=5, poll_interval=60, deferrable=conf.getboolean('operators', 'default_deferrable', fallback=False), **kwargs)[source]¶
基類:
airflow.models.BaseOperator使用指定引數建立一個新叢集。
另請參閱
有關如何使用此運算子的更多資訊,請參閱指南: 建立 Amazon Redshift 叢集
- 引數:
cluster_identifier (str) – 叢集的唯一識別符號。
node_type (str) – 為叢集配置的節點型別。有效值:
ds2.xlarge,ds2.8xlarge,dc1.large,dc1.8xlarge,dc2.large,dc2.8xlarge,ra3.xlplus,ra3.4xlarge, andra3.16xlarge。master_username (str) – 與正在建立的叢集的管理使用者賬戶關聯的使用者名稱。
master_user_password (str) – 與正在建立的叢集的管理使用者賬戶關聯的密碼。
cluster_type (str) – 叢集型別,可以是
single-node(單節點)或multi-node(多節點)。預設值為multi-node。db_name (str) – 建立叢集時要建立的第一個資料庫的名稱。
number_of_nodes (int) – 叢集中的計算節點數量。當
cluster_type為multi-node時,此引數為必填項。vpc_security_group_ids (list[str] | None) – 與此叢集關聯的 VPC 安全組列表。
cluster_subnet_group_name (str | None) – 與此叢集關聯的叢集子網組的名稱。
availability_zone (str | None) – EC2 可用區 (AZ)。
preferred_maintenance_window (str | None) – 自動叢集維護可以發生的時間範圍(UTC)。
cluster_parameter_group_name (str | None) – 與此叢集關聯的引數組的名稱。
automated_snapshot_retention_period (int) – 自動快照的保留天數。預設值為
1。manual_snapshot_retention_period (int | None) – 手動快照的預設保留天數。
port (int) – 叢集接受傳入連線的埠號。預設值為
5439。cluster_version (str) – 要部署在叢集上的 Redshift 引擎軟體版本。
allow_version_upgrade (bool) – 在維護視窗期間是否允許應用主要版本升級。預設值為
True。publicly_accessible (bool) – 叢集是否可以從公共網路訪問。
encrypted (bool) – 叢集中的資料是否靜態加密。預設值為
False。hsm_client_certificate_identifier (str | None) – Amazon Redshift 叢集用於檢索資料的 HSM 客戶端證書名稱。
hsm_configuration_identifier (str | None) – HSM 配置名稱
elastic_ip (str | None) – 叢集的彈性 IP (EIP) 地址。
tags (list[Any] | None) – 標籤例項列表
kms_key_id (str | None) – 加密金鑰的 KMS 金鑰 ID。
enhanced_vpc_routing (bool) – 是否建立啟用了增強型 VPC 路由的叢集。預設值為
False。additional_info (str | None) – 保留
maintenance_track_name (str | None) – 叢集維護軌道名稱。
snapshot_schedule_identifier (str | None) – 快照計劃的唯一識別符號。
availability_zone_relocation (bool | None) – 在叢集建立後,允許 Redshift 叢集在可用區之間重新定位。
aqua_configuration_status (str | None) – 叢集配置為使用 AQUA 。
default_iam_role_arn (str | None) – IAM 角色的 ARN。
aws_conn_id (str | None) – str | None = 用於 AWS 憑據的 Airflow 連線。預設連線 ID 為
aws_default。wait_for_completion (bool) – 是否等待叢集處於
available(可用)狀態max_attempt (int) – 最大嘗試次數。預設值:5
poll_interval (int) – 每次嘗試之間等待的時間(秒)。預設值:60
deferrable (bool) – 如果為 True,運算子將在可推遲模式下執行
- template_fields: collections.abc.Sequence[str] = ('cluster_identifier', 'cluster_type', 'node_type', 'master_username', 'master_user_password',...[source]¶
- class airflow.providers.amazon.aws.operators.redshift_cluster.RedshiftCreateClusterSnapshotOperator(*, snapshot_identifier, cluster_identifier, retention_period=-1, tags=None, wait_for_completion=False, poll_interval=15, max_attempt=20, aws_conn_id='aws_default', deferrable=conf.getboolean('operators', 'default_deferrable', fallback=False), **kwargs)[source]¶
基類:
airflow.models.BaseOperator為指定叢集建立一個手動快照。叢集必須處於可用狀態。
另請參閱
有關如何使用此運算子的更多資訊,請參閱指南: 建立 Amazon Redshift 叢集快照
- 引數:
snapshot_identifier (str) – 您正在請求的快照的唯一識別符號
cluster_identifier (str) – 您要為其建立快照的叢集的識別符號
retention_period (int) – 手動快照的保留天數。如果值為 -1,則手動快照將無限期保留。
tags (list[Any] | None) – 標籤例項列表
wait_for_completion (bool) – 是否等待叢集快照處於
available狀態poll_interval (int) – 兩次連續檢查狀態呼叫之間的等待時間(秒)
max_attempt (int) – 檢查狀態的最大嘗試次數
aws_conn_id (str | None) – 用於 AWS 憑證的 Airflow 連線。預設連線 ID 為
aws_defaultdeferrable (bool) – 如果為 True,則運算子將作為可推遲運算子執行。
- template_fields: collections.abc.Sequence[str] = ('cluster_identifier', 'snapshot_identifier')[source]¶
- class airflow.providers.amazon.aws.operators.redshift_cluster.RedshiftDeleteClusterSnapshotOperator(*, snapshot_identifier, cluster_identifier, wait_for_completion=True, aws_conn_id='aws_default', poll_interval=10, **kwargs)[source]¶
基類:
airflow.models.BaseOperator刪除指定的手動快照。
另請參閱
有關如何使用此運算子的更多資訊,請參閱指南: 刪除 Amazon Redshift 叢集快照
- 引數:
- template_fields: collections.abc.Sequence[str] = ('cluster_identifier', 'snapshot_identifier')[source]¶
- class airflow.providers.amazon.aws.operators.redshift_cluster.RedshiftResumeClusterOperator(*, cluster_identifier, aws_conn_id='aws_default', wait_for_completion=False, deferrable=conf.getboolean('operators', 'default_deferrable', fallback=False), poll_interval=30, max_attempts=30, **kwargs)[source]¶
基類:
airflow.models.BaseOperator恢復已暫停的 AWS Redshift 叢集。
另請參閱
有關如何使用此運算子的更多資訊,請參閱指南: 恢復 Amazon Redshift 叢集
- 引數:
cluster_identifier (str) – AWS Redshift 叢集的唯一識別符號
aws_conn_id (str | None) – 用於 AWS 憑證的 Airflow 連線。預設連線 ID 為
aws_defaultpoll_interval (int) – 兩次連續檢查叢集狀態呼叫之間的等待時間(秒)
max_attempts (int) – 檢查叢集狀態的最大嘗試次數。
wait_for_completion (bool) – 如果為 True,則運算子將等待叢集處於 resumed 狀態。預設為 False。
deferrable (bool) – 如果為 True,則運算子將作為可推遲運算子執行。
- template_fields: collections.abc.Sequence[str] = ('cluster_identifier',)[source]¶
- class airflow.providers.amazon.aws.operators.redshift_cluster.RedshiftPauseClusterOperator(*, cluster_identifier, aws_conn_id='aws_default', wait_for_completion=False, deferrable=conf.getboolean('operators', 'default_deferrable', fallback=False), poll_interval=30, max_attempts=30, **kwargs)[source]¶
基類:
airflow.models.BaseOperator如果 AWS Redshift 叢集的狀態為 available,則暫停它。
另請參閱
For more information on how to use this operator, take a look at the guide: Pause an Amazon Redshift cluster
- 引數:
cluster_identifier (str) – id of the AWS Redshift Cluster
aws_conn_id (str | None) – The Airflow connection used for AWS credentials. If this is None or empty then the default boto3 behaviour is used. If running Airflow in a distributed manner and aws_conn_id is None or empty, then default boto3 configuration would be used (and must be maintained on each worker node).
wait_for_completion (bool) – If True, waits for the cluster to be paused. (default: False)
deferrable (bool) – Run operator in the deferrable mode
poll_interval (int) – 兩次連續檢查叢集狀態呼叫之間的等待時間(秒)
max_attempts (int) – Maximum number of attempts to poll the cluster
- template_fields: collections.abc.Sequence[str] = ('cluster_identifier',)[source]¶
- class airflow.providers.amazon.aws.operators.redshift_cluster.RedshiftDeleteClusterOperator(*, cluster_identifier, skip_final_cluster_snapshot=True, final_cluster_snapshot_identifier=None, wait_for_completion=True, aws_conn_id='aws_default', poll_interval=30, deferrable=conf.getboolean('operators', 'default_deferrable', fallback=False), max_attempts=30, **kwargs)[source]¶
基類:
airflow.models.BaseOperator刪除 AWS Redshift 叢集。
另請參閱
For more information on how to use this operator, take a look at the guide: Delete an Amazon Redshift cluster
- 引數:
cluster_identifier (str) – unique identifier of a cluster
skip_final_cluster_snapshot (bool) – determines cluster snapshot creation
final_cluster_snapshot_identifier (str | None) – name of final cluster snapshot
wait_for_completion (bool) – 是否等待叢集刪除。預設值為
Trueaws_conn_id (str | None) – The Airflow connection used for AWS credentials. If this is None or empty then the default boto3 behaviour is used. If running Airflow in a distributed manner and aws_conn_id is None or empty, then default boto3 configuration would be used (and must be maintained on each worker node).
poll_interval (int) – 兩次連續檢查叢集狀態呼叫之間的等待時間(秒)
deferrable (bool) – Run operator in the deferrable mode.
max_attempts (int) – (Deferrable mode only) The maximum number of attempts to be made
- template_fields: collections.abc.Sequence[str] = ('cluster_identifier',)[source]¶