boraberke commented on code in PR #39154:
URL: https://github.com/apache/airflow/pull/39154#discussion_r1573734935
##########
airflow/providers/google/cloud/hooks/cloud_storage_transfer_service.py:
##########
@@ -343,6 +343,32 @@ def delete_transfer_job(self, job_name: str, project_id:
str) -> None:
.execute(num_retries=self.num_retries)
)
+ @GoogleBaseHook.fallback_to_default_project_id
+ def run_transfer_job(self, job_name: str, project_id: str) -> dict:
+ """Run Google Storage Transfer Service job.
+
+ :param job_name: (Required) Name of the job to be fetched
+ :param project_id: (Optional) the ID of the project that owns the
Transfer
+ Job. If set to None or missing, the default project_id from the
Google Cloud
+ connection is used.
+ :return: If successful, Operation. See:
+
https://cloud.google.com/storage-transfer/docs/reference/rest/v1/Operation
+
+ .. seealso::
https://cloud.google.com/storage-transfer/docs/reference/rest/v1/transferJobs/run
+
+ """
+ return (
+ self.get_conn()
+ .transferJobs()
+ .run(
+ jobName=job_name,
+ body={
+ PROJECT_ID: project_id,
+ },
+ )
+ .execute(num_retries=self.num_retries)
+ )
Review Comment:
sure, working on it now!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]