airflow.providers.google.cloud.transfers.gdrive_to_gcs

模組內容

類別

GoogleDriveToGCSOperator

將 Google 雲端硬碟檔案寫入 Google Cloud Storage。

class airflow.providers.google.cloud.transfers.gdrive_to_gcs.GoogleDriveToGCSOperator(*, bucket_name, object_name=None, file_name, folder_id, drive_id=None, gcp_conn_id='google_cloud_default', impersonation_chain=None, **kwargs)[原始碼]

基底類別: airflow.models.BaseOperator

將 Google 雲端硬碟檔案寫入 Google Cloud Storage。

參見

關於如何使用此運算子的更多資訊,請參閱指南: 運算子

參數
  • bucket_name (str) – 檔案應寫入的目的地 Google Cloud Storage 儲存桶

  • object_name (str | None) – 運算子建立的 Google Cloud Storage 物件名稱。 例如: path/to/my/file/file.txt

  • folder_id (str) – Google 雲端硬碟檔案所在資料夾的資料夾 ID

  • file_name (str) – Google 雲端硬碟中檔案的名稱

  • drive_id (str | None) – 選填。 檔案所在的共用 Google 雲端硬碟的 ID。

  • gcp_conn_id (str) – 擷取連線資訊時使用的 GCP 連線 ID。

  • impersonation_chain (str | collections.abc.Sequence[str] | None) – 選填的服務帳戶,用於模擬短期憑證,或是取得清單中最後一個帳戶的 access_token 所需的串聯帳戶清單,該帳戶將在請求中被模擬。 如果設定為字串,則該帳戶必須授予原始帳戶「服務帳戶權杖建立者」IAM 角色。 如果設定為序列,則清單中的身分必須將「服務帳戶權杖建立者」IAM 角色授予緊接在前的身分,清單中的第一個帳戶將此角色授予原始帳戶(可使用範本)。

template_fields: collections.abc.Sequence[str] = ('bucket_name', 'object_name', 'folder_id', 'file_name', 'drive_id', 'impersonation_chain')[原始碼]
execute(context)[原始碼]

在建立運算子時衍生。

Context 與呈現 jinja 範本時使用的字典相同。

請參閱 get_template_context 以取得更多上下文。

此條目是否有幫助?