airflow.providers.google.cloud.transfers.gdrive_to_gcs

GoogleDriveToGCSOperator

将 Google Drive 文件写入 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)[source]

基类: airflow.models.BaseOperator

将 Google Drive 文件写入 Google Cloud Storage。

另请参阅

有关如何使用此 Operator 的更多信息,请参阅指南: Operator

参数:
  • bucket_name (str) – 目标 Google Cloud Storage 存储桶,文件将写入此处

  • object_name (str | None) – Operator 创建的对象在 Google Cloud Storage 中的对象名称。例如: path/to/my/file/file.txt

  • folder_id (str) – Google Drive 文件所在的文件夹 ID

  • file_name (str) – 位于 Google Drive 中的文件名

  • drive_id (str | None) – 可选。文件所在的共享 Google Drive 的 ID。

  • gcp_conn_id (str) – 获取连接信息时使用的 GCP 连接 ID。

  • impersonation_chain (str | collections.abc.Sequence[str] | None) – 可选的服务账号,用于使用短期凭据进行模拟,或者获取列表中最后一个账号(将在请求中被模拟)的 access_token 所需的账号链。如果设置为字符串,该账号必须授予发起账号 Service Account Token Creator IAM 角色。如果设置为序列,则列表中的身份必须将 Service Account Token Creator IAM 角色授予紧邻的前一个身份,列表中的第一个账号将此角色授予发起账号(模板化)。

template_fields: collections.abc.Sequence[str] = ('bucket_name', 'object_name', 'folder_id', 'file_name', 'drive_id', 'impersonation_chain')[source]
bucket_name[source]
object_name = None[source]
folder_id[source]
drive_id = None[source]
file_name[source]
gcp_conn_id = 'google_cloud_default'[source]
impersonation_chain = None[source]
execute(context)[source]

创建 Operator 时派生实现。

Context 是与渲染 jinja 模板时使用的相同字典。

有关更多上下文信息,请参阅 get_template_context。

此条目是否有帮助?