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_default
deferrable (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_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]¶
- 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) – 是否等待集群删除。默认值为
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]¶