airflow.providers.amazon.aws.operators.rds¶
類¶
建立資料庫例項或資料庫叢集的快照。 |
|
複製指定的資料庫例項或資料庫叢集快照。 |
|
刪除資料庫例項或叢集快照,或終止複製操作。 |
|
開始將快照匯出到 Amazon S3。提供的 IAM 角色必須具有訪問 S3 儲存桶的許可權。 |
|
取消正在進行中的、將快照匯出到 Amazon S3 的匯出任務。 |
|
建立 RDS 事件通知訂閱。 |
|
刪除 RDS 事件通知訂閱。 |
|
建立 RDS 資料庫例項。 |
|
刪除 RDS 資料庫例項。 |
|
啟動 RDS 資料庫例項/叢集。 |
|
停止 RDS 資料庫例項/叢集。 |
模組內容¶
- class airflow.providers.amazon.aws.operators.rds.RdsCreateDbSnapshotOperator(*, db_type, db_identifier, db_snapshot_identifier, tags=None, wait_for_completion=True, **kwargs)[source]¶
基礎:
RdsBaseOperator建立資料庫例項或資料庫叢集的快照。
源資料庫例項或叢集必須處於可用或儲存最佳化狀態。
另請參閱
有關如何使用此運算子的更多資訊,請參閱指南:建立資料庫快照
- 引數:
db_type (str) – 資料庫型別 - “instance”或“cluster”
db_identifier (str) – 要建立快照的例項或叢集的識別符號
db_snapshot_identifier (str) – 資料庫快照的識別符號
tags (collections.abc.Sequence[mypy_boto3_rds.type_defs.TagTypeDef] | dict | None) – 標籤字典或格式為 [{“Key”: “…”, “Value”: “…”},] 的標籤列表 USER Tagging
wait_for_completion (bool) – 如果為 True,則等待資料庫快照建立完成。(預設值:True)
aws_conn_id – 用於 AWS 憑證的 Airflow 連線。如果此引數為
None或為空,則使用預設的 boto3 行為。如果在分散式環境中執行 Airflow 且 aws_conn_id 為 None 或為空,則將使用預設的 boto3 配置(且必須在每個工作節點上維護)。region_name – AWS region_name。如果未指定,則使用預設的 boto3 行為。
verify – 是否驗證 SSL 證書。參見:https://boto3.amazonaws.com/v1/documentation/api/latest/reference/core/session.html
botocore_config – botocore 客戶端的配置字典(鍵值對)。參見:https://botocore.amazonaws.com/v1/documentation/api/latest/reference/config.html
- class airflow.providers.amazon.aws.operators.rds.RdsCopyDbSnapshotOperator(*, db_type, source_db_snapshot_identifier, target_db_snapshot_identifier, kms_key_id='', tags=None, copy_tags=False, pre_signed_url='', option_group_name='', target_custom_availability_zone='', source_region='', wait_for_completion=True, **kwargs)[source]¶
基礎:
RdsBaseOperator複製指定的資料庫例項或資料庫叢集快照。
另請參閱
有關如何使用此運算子的更多資訊,請參閱指南:複製資料庫快照
- 引數:
db_type (str) – 資料庫型別 - “instance”或“cluster”
source_db_snapshot_identifier (str) – 源快照的識別符號
target_db_snapshot_identifier (str) – 目標快照的識別符號
kms_key_id (str) – 加密資料庫快照的 AWS KMS 金鑰識別符號
tags (collections.abc.Sequence[mypy_boto3_rds.type_defs.TagTypeDef] | dict | None) – 標籤字典或格式為 [{“Key”: “…”, “Value”: “…”},] 的標籤列表 USER Tagging
copy_tags (bool) – 是否將源快照的所有標籤複製到目標快照(預設值 False)
pre_signed_url (str) – 包含簽名版本 4 簽名請求的 URL
option_group_name (str) – 與快照副本關聯的選項組名稱 僅當 db_type=’instance’ 時有效
target_custom_availability_zone (str) – 目標外部自定義可用區識別符號 僅當 db_type=’instance’ 時有效
source_region (str) – 包含要複製的快照的區域 ID
wait_for_completion (bool) – 如果為 True,則等待快照複製完成。(預設值:True)
region_name – AWS region_name。如果未指定,則使用預設的 boto3 行為。
verify – 是否驗證 SSL 證書。參見:https://boto3.amazonaws.com/v1/documentation/api/latest/reference/core/session.html
botocore_config – botocore 客戶端的配置字典(鍵值對)。參見:https://botocore.amazonaws.com/v1/documentation/api/latest/reference/config.html
- class airflow.providers.amazon.aws.operators.rds.RdsDeleteDbSnapshotOperator(*, db_type, db_snapshot_identifier, wait_for_completion=True, **kwargs)[source]¶
基礎:
RdsBaseOperator刪除資料庫例項或叢集快照,或終止複製操作。
另請參閱
有關如何使用此運算子的更多資訊,請參閱指南:刪除資料庫快照
- 引數:
db_type (str) – 資料庫型別 - “instance”或“cluster”
db_snapshot_identifier (str) – 資料庫例項或資料庫叢集快照的識別符號
region_name – AWS region_name。如果未指定,則使用預設的 boto3 行為。
verify – 是否驗證 SSL 證書。參見:https://boto3.amazonaws.com/v1/documentation/api/latest/reference/core/session.html
botocore_config – botocore 客戶端的配置字典(鍵值對)。參見:https://botocore.amazonaws.com/v1/documentation/api/latest/reference/config.html
- class airflow.providers.amazon.aws.operators.rds.RdsStartExportTaskOperator(*, export_task_identifier, source_arn, s3_bucket_name, iam_role_arn, kms_key_id, s3_prefix='', export_only=None, wait_for_completion=True, waiter_interval=30, waiter_max_attempts=40, **kwargs)[source]¶
基礎:
RdsBaseOperator開始將快照匯出到 Amazon S3。提供的 IAM 角色必須具有訪問 S3 儲存桶的許可權。
另請參閱
有關如何使用此運算子的更多資訊,請參閱指南:將 Amazon RDS 快照匯出到 Amazon S3
- 引數:
export_task_identifier (str) – 快照匯出任務的唯一識別符號。
source_arn (str) – 要匯出到 Amazon S3 的快照的 Amazon Resource Name (ARN)。
s3_bucket_name (str) – 要將快照匯出到的 Amazon S3 儲存桶的名稱。
iam_role_arn (str) – 用於寫入 Amazon S3 儲存桶的 IAM 角色名稱。
kms_key_id (str) – 用於加密快照的 Amazon Web Services KMS 金鑰 ID。
s3_prefix (str) – 用作匯出快照的檔名和路徑的 Amazon S3 儲存桶字首。
wait_for_completion (bool) – 如果為 True,則等待資料庫快照匯出完成。(預設值:True)
waiter_interval (int) – 檢查匯出狀態之前等待的秒數。(預設值:30)
waiter_max_attempts (int) – 失敗前嘗試的最大次數。(預設值:40)
region_name – AWS region_name。如果未指定,則使用預設的 boto3 行為。
verify – 是否驗證 SSL 證書。參見:https://boto3.amazonaws.com/v1/documentation/api/latest/reference/core/session.html
botocore_config – botocore 客戶端的配置字典(鍵值對)。參見:https://botocore.amazonaws.com/v1/documentation/api/latest/reference/config.html
- class airflow.providers.amazon.aws.operators.rds.RdsCancelExportTaskOperator(*, export_task_identifier, wait_for_completion=True, check_interval=30, max_attempts=40, **kwargs)[source]¶
基礎:
RdsBaseOperator取消正在進行中的、將快照匯出到 Amazon S3 的匯出任務。
另請參閱
有關如何使用此運算子的更多資訊,請參閱指南:取消 Amazon RDS 匯出任務
- 引數:
export_task_identifier (str) – 要取消的快照匯出任務的識別符號
wait_for_completion (bool) – 如果為 True,則等待資料庫快照匯出任務取消。(預設值:True)
check_interval (int) – 嘗試之間等待的秒數
max_attempts (int) – 最大嘗試次數
region_name – AWS region_name。如果未指定,則使用預設的 boto3 行為。
verify – 是否驗證 SSL 證書。參見:https://boto3.amazonaws.com/v1/documentation/api/latest/reference/core/session.html
botocore_config – botocore 客戶端的配置字典(鍵值對)。參見:https://botocore.amazonaws.com/v1/documentation/api/latest/reference/config.html
- 類 airflow.providers.amazon.aws.operators.rds.RdsCreateEventSubscriptionOperator(*, subscription_name, sns_topic_arn, source_type='', event_categories=None, source_ids=None, enabled=True, tags=None, wait_for_completion=True, **kwargs)[原始碼]¶
基礎:
RdsBaseOperator建立 RDS 事件通知訂閱。
另請參閱
有關如何使用此操作器的更多資訊,請參閱指南:訂閱 Amazon RDS 事件通知
- 引數:
subscription_name (str) – 訂閱的名稱(必須少於 255 個字元)
sns_topic_arn (str) – 為事件通知建立的 SNS 主題的 ARN
source_type (str) – 生成事件的源型別。有效值:db-instance | db-cluster | db-parameter-group | db-security-group | db-snapshot | db-cluster-snapshot | db-proxy
event_categories (collections.abc.Sequence[str] | None) – 您想要訂閱的源型別的事件類別列表 使用者事件
source_ids (collections.abc.Sequence[str] | None) – 返回事件的事件源識別符號列表
enabled (bool) – 一個值,指示是否啟用訂閱(預設為 True)
tags (collections.abc.Sequence[mypy_boto3_rds.type_defs.TagTypeDef] | dict | None) – 標籤字典或格式為 [{“Key”: “…”, “Value”: “…”},] 的標籤列表 USER Tagging
wait_for_completion (bool) – 如果為 True,則等待訂閱建立完成。(預設為 True)
region_name – AWS region_name。如果未指定,則使用預設的 boto3 行為。
verify – 是否驗證 SSL 證書。參見:https://boto3.amazonaws.com/v1/documentation/api/latest/reference/core/session.html
botocore_config – botocore 客戶端的配置字典(鍵值對)。參見:https://botocore.amazonaws.com/v1/documentation/api/latest/reference/config.html
- 類 airflow.providers.amazon.aws.operators.rds.RdsDeleteEventSubscriptionOperator(*, subscription_name, **kwargs)[原始碼]¶
基礎:
RdsBaseOperator刪除 RDS 事件通知訂閱。
另請參閱
有關如何使用此操作器的更多資訊,請參閱指南:取消訂閱 Amazon RDS 事件通知
- 引數:
subscription_name (str) – 您想要刪除的 RDS 事件通知訂閱的名稱
region_name – AWS region_name。如果未指定,則使用預設的 boto3 行為。
verify – 是否驗證 SSL 證書。參見:https://boto3.amazonaws.com/v1/documentation/api/latest/reference/core/session.html
botocore_config – botocore 客戶端的配置字典(鍵值對)。參見:https://botocore.amazonaws.com/v1/documentation/api/latest/reference/config.html
- 類 airflow.providers.amazon.aws.operators.rds.RdsCreateDbInstanceOperator(*, db_instance_identifier, db_instance_class, engine, rds_kwargs=None, wait_for_completion=True, deferrable=conf.getboolean('operators', 'default_deferrable', fallback=False), waiter_delay=30, waiter_max_attempts=60, **kwargs)[原始碼]¶
基礎:
RdsBaseOperator建立 RDS 資料庫例項。
另請參閱
有關如何使用此操作器的更多資訊,請參閱指南:建立資料庫例項
- 引數:
db_instance_identifier (str) – 資料庫例項識別符號,必須以字母開頭,包含 1 到 63 個字母、數字或連字元
db_instance_class (str) – 資料庫例項的計算和記憶體容量,例如 db.m5.large
engine (str) – 此例項要使用的資料庫引擎名稱
rds_kwargs (dict | None) – 傳遞給 boto3 RDS 客戶端函式
create_db_instance的命名引數 https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/rds.html#RDS.Client.create_db_instancewait_for_completion (bool) – 如果為 True,則等待資料庫例項建立完成。(預設為 True)
waiter_delay (int) – 檢查資料庫例項狀態的兩次連續呼叫之間的等待時間(以秒為單位)
waiter_max_attempts (int) – 檢查資料庫例項狀態的最大嘗試次數
deferrable (bool) – 如果為 True,操作器將非同步等待資料庫例項建立。這意味著將等待完成。此模式需要安裝 aiobotocore 模組。(預設為 False)
region_name – AWS region_name。如果未指定,則使用預設的 boto3 行為。
verify – 是否驗證 SSL 證書。參見:https://boto3.amazonaws.com/v1/documentation/api/latest/reference/core/session.html
botocore_config – botocore 客戶端的配置字典(鍵值對)。參見:https://botocore.amazonaws.com/v1/documentation/api/latest/reference/config.html
- 類 airflow.providers.amazon.aws.operators.rds.RdsDeleteDbInstanceOperator(*, db_instance_identifier, rds_kwargs=None, wait_for_completion=True, deferrable=conf.getboolean('operators', 'default_deferrable', fallback=False), waiter_delay=30, waiter_max_attempts=60, **kwargs)[原始碼]¶
基礎:
RdsBaseOperator刪除 RDS 資料庫例項。
另請參閱
有關如何使用此操作器的更多資訊,請參閱指南:刪除資料庫例項
- 引數:
db_instance_identifier (str) – 要刪除的資料庫例項的資料庫例項識別符號
rds_kwargs (dict | None) – 傳遞給 boto3 RDS 客戶端函式
delete_db_instance的命名引數 https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/rds.html#RDS.Client.delete_db_instancewait_for_completion (bool) – 如果為 True,則等待資料庫例項刪除完成。(預設為 True)
waiter_delay (int) – 檢查資料庫例項狀態的兩次連續呼叫之間的等待時間(以秒為單位)
waiter_max_attempts (int) – 檢查資料庫例項狀態的最大嘗試次數
deferrable (bool) – 如果為 True,操作器將非同步等待資料庫例項建立。這意味著將等待完成。此模式需要安裝 aiobotocore 模組。(預設為 False)
region_name – AWS region_name。如果未指定,則使用預設的 boto3 行為。
verify – 是否驗證 SSL 證書。參見:https://boto3.amazonaws.com/v1/documentation/api/latest/reference/core/session.html
botocore_config – botocore 客戶端的配置字典(鍵值對)。參見:https://botocore.amazonaws.com/v1/documentation/api/latest/reference/config.html
- 類 airflow.providers.amazon.aws.operators.rds.RdsStartDbOperator(*, db_identifier, db_type=RdsDbType.INSTANCE, wait_for_completion=True, waiter_delay=30, waiter_max_attempts=40, deferrable=conf.getboolean('operators', 'default_deferrable', fallback=False), **kwargs)[原始碼]¶
基礎:
RdsBaseOperator啟動 RDS 資料庫例項/叢集。
另請參閱
有關如何使用此操作器的更多資訊,請參閱指南:啟動資料庫例項或叢集
- 引數:
db_identifier (str) – 要啟動的資料庫的 AWS 識別符號
db_type (airflow.providers.amazon.aws.utils.rds.RdsDbType | str) – 資料庫型別 - "instance"(例項)或 "cluster"(叢集)(預設為 "instance")
wait_for_completion (bool) – 如果為 True,則等待資料庫啟動。(預設為 True)
waiter_delay (int) – 檢查資料庫例項狀態的兩次連續呼叫之間的等待時間(以秒為單位)
waiter_max_attempts (int) – 檢查資料庫例項狀態的最大嘗試次數
deferrable (bool) – 如果為 True,操作器將非同步等待資料庫例項建立。這意味著將等待完成。此模式需要安裝 aiobotocore 模組。
region_name – AWS region_name。如果未指定,則使用預設的 boto3 行為。
verify – 是否驗證 SSL 證書。參見:https://boto3.amazonaws.com/v1/documentation/api/latest/reference/core/session.html
botocore_config – botocore 客戶端的配置字典(鍵值對)。參見:https://botocore.amazonaws.com/v1/documentation/api/latest/reference/config.html
- 類 airflow.providers.amazon.aws.operators.rds.RdsStopDbOperator(*, db_identifier, db_type=RdsDbType.INSTANCE, db_snapshot_identifier=None, wait_for_completion=True, waiter_delay=30, waiter_max_attempts=40, deferrable=conf.getboolean('operators', 'default_deferrable', fallback=False), **kwargs)[原始碼]¶
基礎:
RdsBaseOperator停止 RDS 資料庫例項/叢集。
另請參閱
有關如何使用此操作器的更多資訊,請參閱指南:停止資料庫例項或叢集
- 引數:
db_identifier (str) – 要停止的資料庫的 AWS 識別符號
db_type (airflow.providers.amazon.aws.utils.rds.RdsDbType | str) – 資料庫型別 - "instance"(例項)或 "cluster"(叢集)(預設為 "instance")
db_snapshot_identifier (str | None) – 在停止資料庫例項之前要建立的資料庫快照的例項識別符號。預設值 (None) 跳過快照建立。當
db_type為 "cluster" 時,此引數將被忽略。wait_for_completion (bool) – 如果為 True,則等待資料庫停止。(預設為 True)
waiter_delay (int) – 檢查資料庫例項狀態的兩次連續呼叫之間的等待時間(以秒為單位)
waiter_max_attempts (int) – 檢查資料庫例項狀態的最大嘗試次數
deferrable (bool) – 如果為 True,操作器將非同步等待資料庫例項建立。這意味著將等待完成。此模式需要安裝 aiobotocore 模組。
region_name – AWS region_name。如果未指定,則使用預設的 boto3 行為。
verify – 是否驗證 SSL 證書。參見:https://boto3.amazonaws.com/v1/documentation/api/latest/reference/core/session.html
botocore_config – botocore 客戶端的配置字典(鍵值對)。參見:https://botocore.amazonaws.com/v1/documentation/api/latest/reference/config.html