airflow.providers.amazon.aws.operators.redshift_cluster

RedshiftCreateClusterOperator

使用指定引數建立一個新叢集。

RedshiftCreateClusterSnapshotOperator

為指定叢集建立一個手動快照。叢集必須處於可用狀態。

RedshiftDeleteClusterSnapshotOperator

刪除指定的手動快照。

RedshiftResumeClusterOperator

恢復已暫停的 AWS Redshift 叢集。

RedshiftPauseClusterOperator

如果 AWS Redshift 叢集的狀態為 available,則暫停它。

RedshiftDeleteClusterOperator

刪除 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, and ra3.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_typemulti-node 時,此引數為必填項。

  • cluster_security_groups (list[str] | None) – 與此叢集關聯的安全組列表。

  • 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) – 保留

  • iam_roles (list[str] | None) – 叢集可用於訪問其他 AWS 服務的 IAM 角色列表。

  • 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]
ui_color = '#eeaa11'[source]
ui_fgcolor = '#ffffff'[source]
cluster_identifier[source]
node_type[source]
master_username[source]
master_user_password[source]
cluster_type = 'multi-node'[source]
db_name = 'dev'[source]
number_of_nodes = 1[source]
cluster_security_groups = None[source]
vpc_security_group_ids = None[source]
cluster_subnet_group_name = None[source]
availability_zone = None[source]
preferred_maintenance_window = None[source]
cluster_parameter_group_name = None[source]
automated_snapshot_retention_period = 1[source]
manual_snapshot_retention_period = None[source]
port = 5439[source]
cluster_version = '1.0'[source]
allow_version_upgrade = True[source]
publicly_accessible = True[source]
encrypted = False[source]
hsm_client_certificate_identifier = None[source]
hsm_configuration_identifier = None[source]
elastic_ip = None[source]
tags = None[source]
kms_key_id = None[source]
enhanced_vpc_routing = False[source]
additional_info = None[source]
iam_roles = None[source]
maintenance_track_name = None[source]
snapshot_schedule_identifier = None[source]
availability_zone_relocation = None[source]
aqua_configuration_status = None[source]
default_iam_role_arn = None[source]
aws_conn_id = 'aws_default'[source]
wait_for_completion = False[source]
max_attempt = 5[source]
poll_interval = 60[source]
deferrable = True[source]
kwargs[source]
execute(context)[source]

建立運算子時派生。

上下文是與渲染 Jinja 模板時使用的字典相同的字典。

有關更多上下文,請參閱 get_template_context。

execute_complete(context, event=None)[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_default

  • deferrable (bool) – 如果為 True,則運算子將作為可推遲運算子執行。

template_fields: collections.abc.Sequence[str] = ('cluster_identifier', 'snapshot_identifier')[source]
snapshot_identifier[source]
cluster_identifier[source]
retention_period = -1[source]
tags = None[source]
wait_for_completion = False[source]
poll_interval = 15[source]
max_attempt = 20[source]
deferrable = True[source]
aws_conn_id = 'aws_default'[source]
redshift_hook[source]
execute(context)[source]

建立運算子時派生。

上下文是與渲染 Jinja 模板時使用的字典相同的字典。

有關更多上下文,請參閱 get_template_context。

execute_complete(context, event=None)[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 叢集快照

引數:
  • snapshot_identifier (str) – 您正在請求的快照的唯一識別符號

  • cluster_identifier (str) – 建立快照的叢集的唯一識別符號

  • wait_for_completion (bool) – 是否等待叢集刪除。預設值為 True

  • aws_conn_id (str | None) – 用於 AWS 憑證的 Airflow 連線。預設連線 ID 為 aws_default

  • poll_interval (int) – 兩次連續檢查快照狀態呼叫之間的等待時間(秒)

template_fields: collections.abc.Sequence[str] = ('cluster_identifier', 'snapshot_identifier')[source]
snapshot_identifier[source]
cluster_identifier[source]
wait_for_completion = True[source]
poll_interval = 10[source]
redshift_hook[source]
execute(context)[source]

建立運算子時派生。

上下文是與渲染 Jinja 模板時使用的字典相同的字典。

有關更多上下文,請參閱 get_template_context。

get_status()[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_default

  • poll_interval (int) – 兩次連續檢查叢集狀態呼叫之間的等待時間(秒)

  • max_attempts (int) – 檢查叢集狀態的最大嘗試次數。

  • wait_for_completion (bool) – 如果為 True,則運算子將等待叢集處於 resumed 狀態。預設為 False。

  • deferrable (bool) – 如果為 True,則運算子將作為可推遲運算子執行。

template_fields: collections.abc.Sequence[str] = ('cluster_identifier',)[source]
ui_color = '#eeaa11'[source]
ui_fgcolor = '#ffffff'[source]
cluster_identifier[source]
aws_conn_id = 'aws_default'[source]
wait_for_completion = False[source]
deferrable = True[source]
max_attempts = 30[source]
poll_interval = 30[source]
execute(context)[source]

建立運算子時派生。

上下文是與渲染 Jinja 模板時使用的字典相同的字典。

有關更多上下文,請參閱 get_template_context。

execute_complete(context, event=None)[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]
ui_color = '#eeaa11'[source]
ui_fgcolor = '#ffffff'[source]
cluster_identifier[source]
aws_conn_id = 'aws_default'[source]
wait_for_completion = False[source]
deferrable = True[source]
max_attempts = 30[source]
poll_interval = 30[source]
execute(context)[source]

建立運算子時派生。

上下文是與渲染 Jinja 模板時使用的字典相同的字典。

有關更多上下文,請參閱 get_template_context。

execute_complete(context, event=None)[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) – 是否等待叢集刪除。預設值為 True

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

  • 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]
ui_color : str = '#eeaa11'[source]
ui_fgcolor : str = '#ffffff'[source]
cluster_identifier[source]
skip_final_cluster_snapshot = True[source]
final_cluster_snapshot_identifier = None[source]
wait_for_completion = True[source]
poll_interval = 30[source]
redshift_hook[source]
aws_conn_id = 'aws_default'[source]
deferrable = True[source]
max_attempts = 30[source]
execute(context)[source]

建立運算子時派生。

上下文是與渲染 Jinja 模板時使用的字典相同的字典。

有關更多上下文,請參閱 get_template_context。

execute_complete(context, event=None)[source]

此條目是否有用?