繼承自: airflow.providers.amazon.aws.hooks.base_aws.AwsGenericHook[mypy_boto3_rds.RDSClient]
與 Amazon 關係型資料庫服務 (RDS) 進行互動。
提供對 boto3.client("rds") 的輕量級封裝。
可以指定額外的引數(例如 aws_conn_id),這些引數會向下傳遞給底層的 AwsBaseHook。
-
get_db_snapshot_state(snapshot_id)[原始碼]
獲取 DB 例項快照的當前狀態。
- 引數:
snapshot_id (str) – 目標 DB 例項快照的 ID
- 返回值:
以字串形式返回 DB 快照的狀態(例如,“available”)
- 丟擲異常:
AirflowNotFoundException – 如果 DB 例項快照不存在。
- 返回型別:
str
-
wait_for_db_snapshot_state(snapshot_id, target_state, check_interval=30, max_attempts=40)[原始碼]
輪詢 DB 快照直到達到目標狀態;在達到最大嘗試次數後丟擲 AirflowException。
- 引數:
snapshot_id (str) – 目標 DB 例項快照的 ID
target_state (str) – 等待直到達到此狀態
check_interval (int) – 每次嘗試之間等待的時間(秒)
max_attempts (int) – 最大嘗試次數
-
get_db_cluster_snapshot_state(snapshot_id)[原始碼]
獲取 DB 叢集快照的當前狀態。
- 引數:
snapshot_id (str) – 目標 DB 叢集的 ID。
- 返回值:
以字串形式返回 DB 叢集快照的狀態(例如,“available”)
- 丟擲異常:
AirflowNotFoundException – 如果 DB 叢集快照不存在。
- 返回型別:
str
-
wait_for_db_cluster_snapshot_state(snapshot_id, target_state, check_interval=30, max_attempts=40)[原始碼]
輪詢 DB 叢集快照直到達到目標狀態;在達到最大嘗試次數後丟擲 AirflowException。
- 引數:
snapshot_id (str) – 目標 DB 叢集快照的 ID
target_state (str) – 等待直到達到此狀態
check_interval (int) – 每次嘗試之間等待的時間(秒)
max_attempts (int) – 最大嘗試次數
-
get_export_task_state(export_task_id)[原始碼]
獲取 RDS 快照匯出到 Amazon S3 的當前狀態。
- 引數:
export_task_id (str) – 目標快照匯出任務的識別符號。
- 返回值:
以字串形式返回快照匯出任務的狀態(例如,“canceled”)
- 丟擲異常:
AirflowNotFoundException – 如果匯出任務不存在。
- 返回型別:
str
-
wait_for_export_task_state(export_task_id, target_state, check_interval=30, max_attempts=40)[原始碼]
輪詢匯出任務直到達到目標狀態;在達到最大嘗試次數後丟擲 AirflowException。
- 引數:
export_task_id (str) – 目標快照匯出任務的識別符號。
target_state (str) – 等待直到達到此狀態
check_interval (int) – 每次嘗試之間等待的時間(秒)
max_attempts (int) – 最大嘗試次數
-
get_event_subscription_state(subscription_name)[原始碼]
獲取 RDS 快照匯出到 Amazon S3 的當前狀態。
- 引數:
subscription_name (str) – 目標 RDS 事件通知訂閱的名稱。
- 返回值:
以字串形式返回事件訂閱的狀態(例如,“active”)
- 丟擲異常:
AirflowNotFoundException – 如果事件訂閱不存在。
- 返回型別:
str
-
wait_for_event_subscription_state(subscription_name, target_state, check_interval=30, max_attempts=40)[原始碼]
輪詢事件訂閱直到達到目標狀態;在達到最大嘗試次數後丟擲 AirflowException。
- 引數:
subscription_name (str) – 目標 RDS 事件通知訂閱的名稱。
target_state (str) – 等待直到達到此狀態
check_interval (int) – 每次嘗試之間等待的時間(秒)
max_attempts (int) – 最大嘗試次數
-
get_db_instance_state(db_instance_id)[原始碼]
獲取 DB 例項的當前狀態。
- 引數:
db_instance_id (str) – 目標 DB 例項的 ID。
- 返回值:
以字串形式返回 DB 例項的狀態(例如,“available”)
- 丟擲異常:
AirflowNotFoundException – 如果 DB 例項不存在。
- 返回型別:
str
-
wait_for_db_instance_state(db_instance_id, target_state, check_interval=30, max_attempts=40)[原始碼]
輪詢 DB 例項直到達到目標狀態;在達到最大嘗試次數後丟擲 AirflowException。
- 引數:
db_instance_id (str) – 目標 DB 例項的 ID。
target_state (str) – 等待直到達到此狀態
check_interval (int) – 每次嘗試之間等待的時間(秒)
max_attempts (int) – 最大嘗試次數
-
get_db_cluster_state(db_cluster_id)[原始碼]
獲取 DB 叢集的當前狀態。
- 引數:
db_cluster_id (str) – 目標 DB 叢集的 ID。
- 返回值:
以字串形式返回 DB 叢集的狀態(例如,“available”)
- 丟擲異常:
AirflowNotFoundException – 如果 DB 叢集不存在。
- 返回型別:
str
-
wait_for_db_cluster_state(db_cluster_id, target_state, check_interval=30, max_attempts=40)[原始碼]
輪詢 DB 叢集直到達到目標狀態;在達到最大嘗試次數後丟擲 AirflowException。
- 引數:
db_cluster_id (str) – 目標 DB 叢集的 ID。
target_state (str) – 等待直到達到此狀態
check_interval (int) – 每次嘗試之間等待的時間(秒)
max_attempts (int) – 最大嘗試次數