示例#1
0
 def execute(self, context):
     hook = GCSHook(google_cloud_storage_conn_id=self.gcp_conn_id,
                    delegate_to=self.delegate_to)
     hook.sync(source_bucket=self.source_bucket,
               destination_bucket=self.destination_bucket,
               source_object=self.source_object,
               destination_object=self.destination_object,
               recursive=self.recursive,
               delete_extra_files=self.delete_extra_files,
               allow_overwrite=self.allow_overwrite)
示例#2
0
文件: gcs.py 项目: iVerner/airflow
 def execute(self, context: "Context") -> None:
     hook = GCSHook(
         gcp_conn_id=self.gcp_conn_id,
         delegate_to=self.delegate_to,
         impersonation_chain=self.impersonation_chain,
     )
     hook.sync(
         source_bucket=self.source_bucket,
         destination_bucket=self.destination_bucket,
         source_object=self.source_object,
         destination_object=self.destination_object,
         recursive=self.recursive,
         delete_extra_files=self.delete_extra_files,
         allow_overwrite=self.allow_overwrite,
     )
示例#3
0
 def execute(self, context: "Context") -> None:
     hook = GCSHook(
         gcp_conn_id=self.gcp_conn_id,
         delegate_to=self.delegate_to,
         impersonation_chain=self.impersonation_chain,
     )
     StorageLink.persist(
         context=context,
         task_instance=self,
         uri=self._get_uri(self.destination_bucket, self.destination_object),
         project_id=hook.project_id,
     )
     hook.sync(
         source_bucket=self.source_bucket,
         destination_bucket=self.destination_bucket,
         source_object=self.source_object,
         destination_object=self.destination_object,
         recursive=self.recursive,
         delete_extra_files=self.delete_extra_files,
         allow_overwrite=self.allow_overwrite,
     )