airflow.providers.amazon.aws.hooks.quicksight

QuickSightHook

與 Amazon QuickSight 互動。

模組內容

class airflow.providers.amazon.aws.hooks.quicksight.QuickSightHook(*args, **kwargs)[source]

基類: airflow.providers.amazon.aws.hooks.base_aws.AwsBaseHook

與 Amazon QuickSight 互動。

提供圍繞 boto3.client("quicksight") 的精簡包裝。

可以指定其他引數(例如 aws_conn_id),這些引數將向下傳遞給底層的 AwsBaseHook。

NON_TERMINAL_STATES[source]
FAILED_STATES[source]
create_ingestion(data_set_id, ingestion_id, ingestion_type, wait_for_completion=True, check_interval=30, aws_account_id=None)[source]

為資料集建立並啟動新的 SPICE 資料攝取;重新整理 SPICE 資料集。

引數:
  • data_set_id (str) – 用於資料攝取的資料集的 ID。

  • ingestion_id (str) – 資料攝取的 ID。

  • ingestion_type (str) – 資料攝取型別:“INCREMENTAL_REFRESH”|“FULL_REFRESH”

  • wait_for_completion (bool) – 程式是否應持續執行直到作業完成

  • check_interval (int) – Operator 檢查 QuickSight 資料攝取狀態的時間間隔(秒)

  • aws_account_id (str | None) – AWS 賬戶 ID,如果設定為 None 則使用關聯的 AWS 賬戶 ID。

返回:

返回關於已建立的資料攝取的描述性資訊,包括 Ingestion ARN、HTTP 狀態、資料攝取 ID 和資料攝取狀態。

返回型別:

dict

get_status(aws_account_id, data_set_id, ingestion_id)[source]

獲取 QuickSight Create Ingestion API 的當前狀態。

引數:
  • aws_account_id (str | None) – AWS 賬戶 ID,如果設定為 None 則使用關聯的 AWS 賬戶 ID。

  • data_set_id (str) – QuickSight 資料集 ID

  • ingestion_id (str) – QuickSight 資料攝取 ID

返回:

一個 QuickSight 資料攝取狀態

返回型別:

str

get_error_info(aws_account_id, data_set_id, ingestion_id)[source]

獲取有關錯誤的詳細資訊(如果有)。

引數:
  • aws_account_id (str | None) – AWS 賬戶 ID,如果設定為 None 則使用關聯的 AWS 賬戶 ID。

  • data_set_id (str) – QuickSight 資料集 ID

  • ingestion_id (str) – QuickSight 資料攝取 ID

返回:

包含錯誤型別(鍵 ‘Type’)和訊息(鍵 ‘Message’)的錯誤資訊字典(如果可用)。否則,返回 None。

返回型別:

dict | None

wait_for_state(aws_account_id, data_set_id, ingestion_id, target_state, check_interval)[source]

檢查 QuickSight Create Ingestion API 的狀態。

引數:
  • aws_account_id (str | None) – AWS 賬戶 ID,如果設定為 None 則使用關聯的 AWS 賬戶 ID。

  • data_set_id (str) – QuickSight 資料集 ID

  • ingestion_id (str) – QuickSight 資料攝取 ID

  • target_state (set) – 描述 QuickSight 作業的目標狀態

  • check_interval (int) – Operator 檢查 QuickSight 資料攝取狀態的時間間隔(秒)

返回:

資料攝取完成後 describe_ingestion 呼叫的響應

此條目有幫助嗎?