apache-airflow-providers-google 16.0.0a1__py3-none-any.whl → 16.1.0rc1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- airflow/providers/google/__init__.py +1 -1
- airflow/providers/google/ads/hooks/ads.py +43 -5
- airflow/providers/google/ads/operators/ads.py +1 -1
- airflow/providers/google/ads/transfers/ads_to_gcs.py +1 -1
- airflow/providers/google/cloud/hooks/bigquery.py +63 -77
- airflow/providers/google/cloud/hooks/cloud_sql.py +8 -4
- airflow/providers/google/cloud/hooks/datacatalog.py +9 -1
- airflow/providers/google/cloud/hooks/dataflow.py +2 -2
- airflow/providers/google/cloud/hooks/dataplex.py +1 -1
- airflow/providers/google/cloud/hooks/dataprep.py +4 -1
- airflow/providers/google/cloud/hooks/gcs.py +5 -5
- airflow/providers/google/cloud/hooks/looker.py +10 -1
- airflow/providers/google/cloud/hooks/mlengine.py +2 -1
- airflow/providers/google/cloud/hooks/secret_manager.py +102 -10
- airflow/providers/google/cloud/hooks/spanner.py +2 -2
- airflow/providers/google/cloud/hooks/translate.py +1 -1
- airflow/providers/google/cloud/hooks/vertex_ai/auto_ml.py +0 -36
- airflow/providers/google/cloud/hooks/vertex_ai/feature_store.py +307 -7
- airflow/providers/google/cloud/hooks/vertex_ai/generative_model.py +44 -80
- airflow/providers/google/cloud/hooks/vertex_ai/ray.py +11 -2
- airflow/providers/google/cloud/hooks/vision.py +2 -2
- airflow/providers/google/cloud/links/alloy_db.py +0 -46
- airflow/providers/google/cloud/links/base.py +75 -11
- airflow/providers/google/cloud/links/bigquery.py +0 -47
- airflow/providers/google/cloud/links/bigquery_dts.py +0 -20
- airflow/providers/google/cloud/links/bigtable.py +0 -48
- airflow/providers/google/cloud/links/cloud_build.py +0 -73
- airflow/providers/google/cloud/links/cloud_functions.py +0 -33
- airflow/providers/google/cloud/links/cloud_memorystore.py +0 -58
- airflow/providers/google/cloud/links/cloud_run.py +27 -0
- airflow/providers/google/cloud/links/cloud_sql.py +0 -33
- airflow/providers/google/cloud/links/cloud_storage_transfer.py +16 -43
- airflow/providers/google/cloud/links/cloud_tasks.py +6 -25
- airflow/providers/google/cloud/links/compute.py +0 -58
- airflow/providers/google/cloud/links/data_loss_prevention.py +0 -169
- airflow/providers/google/cloud/links/datacatalog.py +23 -54
- airflow/providers/google/cloud/links/dataflow.py +0 -34
- airflow/providers/google/cloud/links/dataform.py +0 -64
- airflow/providers/google/cloud/links/datafusion.py +1 -96
- airflow/providers/google/cloud/links/dataplex.py +0 -154
- airflow/providers/google/cloud/links/dataprep.py +0 -24
- airflow/providers/google/cloud/links/dataproc.py +14 -90
- airflow/providers/google/cloud/links/datastore.py +0 -31
- airflow/providers/google/cloud/links/kubernetes_engine.py +5 -59
- airflow/providers/google/cloud/links/life_sciences.py +0 -19
- airflow/providers/google/cloud/links/managed_kafka.py +0 -70
- airflow/providers/google/cloud/links/mlengine.py +0 -70
- airflow/providers/google/cloud/links/pubsub.py +0 -32
- airflow/providers/google/cloud/links/spanner.py +0 -33
- airflow/providers/google/cloud/links/stackdriver.py +0 -30
- airflow/providers/google/cloud/links/translate.py +16 -186
- airflow/providers/google/cloud/links/vertex_ai.py +8 -224
- airflow/providers/google/cloud/links/workflows.py +0 -52
- airflow/providers/google/cloud/log/gcs_task_handler.py +4 -4
- airflow/providers/google/cloud/operators/alloy_db.py +69 -54
- airflow/providers/google/cloud/operators/automl.py +16 -14
- airflow/providers/google/cloud/operators/bigquery.py +49 -25
- airflow/providers/google/cloud/operators/bigquery_dts.py +2 -4
- airflow/providers/google/cloud/operators/bigtable.py +35 -6
- airflow/providers/google/cloud/operators/cloud_base.py +21 -1
- airflow/providers/google/cloud/operators/cloud_build.py +74 -31
- airflow/providers/google/cloud/operators/cloud_composer.py +34 -35
- airflow/providers/google/cloud/operators/cloud_memorystore.py +68 -42
- airflow/providers/google/cloud/operators/cloud_run.py +9 -1
- airflow/providers/google/cloud/operators/cloud_sql.py +11 -15
- airflow/providers/google/cloud/operators/cloud_storage_transfer_service.py +0 -2
- airflow/providers/google/cloud/operators/compute.py +7 -39
- airflow/providers/google/cloud/operators/datacatalog.py +156 -20
- airflow/providers/google/cloud/operators/dataflow.py +37 -14
- airflow/providers/google/cloud/operators/dataform.py +14 -4
- airflow/providers/google/cloud/operators/datafusion.py +4 -12
- airflow/providers/google/cloud/operators/dataplex.py +180 -96
- airflow/providers/google/cloud/operators/dataprep.py +0 -4
- airflow/providers/google/cloud/operators/dataproc.py +10 -16
- airflow/providers/google/cloud/operators/dataproc_metastore.py +95 -87
- airflow/providers/google/cloud/operators/datastore.py +21 -5
- airflow/providers/google/cloud/operators/dlp.py +3 -26
- airflow/providers/google/cloud/operators/functions.py +15 -6
- airflow/providers/google/cloud/operators/gcs.py +1 -7
- airflow/providers/google/cloud/operators/kubernetes_engine.py +53 -92
- airflow/providers/google/cloud/operators/life_sciences.py +0 -1
- airflow/providers/google/cloud/operators/managed_kafka.py +106 -51
- airflow/providers/google/cloud/operators/mlengine.py +0 -1
- airflow/providers/google/cloud/operators/pubsub.py +4 -5
- airflow/providers/google/cloud/operators/spanner.py +0 -4
- airflow/providers/google/cloud/operators/speech_to_text.py +0 -1
- airflow/providers/google/cloud/operators/stackdriver.py +0 -8
- airflow/providers/google/cloud/operators/tasks.py +0 -11
- airflow/providers/google/cloud/operators/text_to_speech.py +0 -1
- airflow/providers/google/cloud/operators/translate.py +37 -13
- airflow/providers/google/cloud/operators/translate_speech.py +0 -1
- airflow/providers/google/cloud/operators/vertex_ai/auto_ml.py +31 -18
- airflow/providers/google/cloud/operators/vertex_ai/batch_prediction_job.py +28 -8
- airflow/providers/google/cloud/operators/vertex_ai/custom_job.py +38 -25
- airflow/providers/google/cloud/operators/vertex_ai/dataset.py +69 -7
- airflow/providers/google/cloud/operators/vertex_ai/endpoint_service.py +42 -8
- airflow/providers/google/cloud/operators/vertex_ai/feature_store.py +531 -0
- airflow/providers/google/cloud/operators/vertex_ai/generative_model.py +93 -117
- airflow/providers/google/cloud/operators/vertex_ai/hyperparameter_tuning_job.py +10 -8
- airflow/providers/google/cloud/operators/vertex_ai/model_service.py +56 -10
- airflow/providers/google/cloud/operators/vertex_ai/pipeline_job.py +29 -6
- airflow/providers/google/cloud/operators/vertex_ai/ray.py +9 -6
- airflow/providers/google/cloud/operators/workflows.py +1 -9
- airflow/providers/google/cloud/sensors/bigquery.py +1 -1
- airflow/providers/google/cloud/sensors/bigquery_dts.py +6 -1
- airflow/providers/google/cloud/sensors/bigtable.py +15 -3
- airflow/providers/google/cloud/sensors/cloud_composer.py +6 -1
- airflow/providers/google/cloud/sensors/cloud_storage_transfer_service.py +6 -1
- airflow/providers/google/cloud/sensors/dataflow.py +3 -3
- airflow/providers/google/cloud/sensors/dataform.py +6 -1
- airflow/providers/google/cloud/sensors/datafusion.py +6 -1
- airflow/providers/google/cloud/sensors/dataplex.py +6 -1
- airflow/providers/google/cloud/sensors/dataprep.py +6 -1
- airflow/providers/google/cloud/sensors/dataproc.py +6 -1
- airflow/providers/google/cloud/sensors/dataproc_metastore.py +6 -1
- airflow/providers/google/cloud/sensors/gcs.py +9 -3
- airflow/providers/google/cloud/sensors/looker.py +6 -1
- airflow/providers/google/cloud/sensors/pubsub.py +8 -3
- airflow/providers/google/cloud/sensors/tasks.py +6 -1
- airflow/providers/google/cloud/sensors/vertex_ai/feature_store.py +6 -1
- airflow/providers/google/cloud/sensors/workflows.py +6 -1
- airflow/providers/google/cloud/transfers/azure_blob_to_gcs.py +1 -1
- airflow/providers/google/cloud/transfers/azure_fileshare_to_gcs.py +1 -1
- airflow/providers/google/cloud/transfers/bigquery_to_bigquery.py +10 -7
- airflow/providers/google/cloud/transfers/bigquery_to_gcs.py +1 -2
- airflow/providers/google/cloud/transfers/bigquery_to_mssql.py +0 -1
- airflow/providers/google/cloud/transfers/bigquery_to_sql.py +1 -1
- airflow/providers/google/cloud/transfers/calendar_to_gcs.py +1 -1
- airflow/providers/google/cloud/transfers/cassandra_to_gcs.py +1 -1
- airflow/providers/google/cloud/transfers/facebook_ads_to_gcs.py +2 -2
- airflow/providers/google/cloud/transfers/gcs_to_bigquery.py +1 -2
- airflow/providers/google/cloud/transfers/gcs_to_gcs.py +1 -1
- airflow/providers/google/cloud/transfers/gcs_to_local.py +1 -1
- airflow/providers/google/cloud/transfers/gcs_to_sftp.py +1 -1
- airflow/providers/google/cloud/transfers/gdrive_to_gcs.py +5 -1
- airflow/providers/google/cloud/transfers/gdrive_to_local.py +1 -1
- airflow/providers/google/cloud/transfers/http_to_gcs.py +193 -0
- airflow/providers/google/cloud/transfers/local_to_gcs.py +1 -1
- airflow/providers/google/cloud/transfers/s3_to_gcs.py +11 -5
- airflow/providers/google/cloud/transfers/salesforce_to_gcs.py +1 -1
- airflow/providers/google/cloud/transfers/sftp_to_gcs.py +1 -1
- airflow/providers/google/cloud/transfers/sheets_to_gcs.py +2 -2
- airflow/providers/google/cloud/transfers/sql_to_gcs.py +1 -1
- airflow/providers/google/cloud/triggers/bigquery.py +32 -5
- airflow/providers/google/cloud/triggers/dataproc.py +62 -10
- airflow/providers/google/cloud/utils/field_validator.py +1 -2
- airflow/providers/google/common/auth_backend/google_openid.py +2 -1
- airflow/providers/google/common/deprecated.py +2 -1
- airflow/providers/google/common/hooks/base_google.py +7 -3
- airflow/providers/google/common/links/storage.py +0 -22
- airflow/providers/google/firebase/operators/firestore.py +1 -1
- airflow/providers/google/get_provider_info.py +14 -16
- airflow/providers/google/leveldb/hooks/leveldb.py +30 -1
- airflow/providers/google/leveldb/operators/leveldb.py +1 -1
- airflow/providers/google/marketing_platform/links/analytics_admin.py +3 -6
- airflow/providers/google/marketing_platform/operators/analytics_admin.py +0 -1
- airflow/providers/google/marketing_platform/operators/campaign_manager.py +4 -4
- airflow/providers/google/marketing_platform/operators/display_video.py +6 -6
- airflow/providers/google/marketing_platform/operators/search_ads.py +1 -1
- airflow/providers/google/marketing_platform/sensors/campaign_manager.py +6 -1
- airflow/providers/google/marketing_platform/sensors/display_video.py +6 -1
- airflow/providers/google/suite/operators/sheets.py +3 -3
- airflow/providers/google/suite/sensors/drive.py +6 -1
- airflow/providers/google/suite/transfers/gcs_to_gdrive.py +1 -1
- airflow/providers/google/suite/transfers/gcs_to_sheets.py +1 -1
- airflow/providers/google/suite/transfers/local_to_drive.py +1 -1
- airflow/providers/google/version_compat.py +28 -0
- {apache_airflow_providers_google-16.0.0a1.dist-info → apache_airflow_providers_google-16.1.0rc1.dist-info}/METADATA +35 -35
- {apache_airflow_providers_google-16.0.0a1.dist-info → apache_airflow_providers_google-16.1.0rc1.dist-info}/RECORD +171 -170
- airflow/providers/google/cloud/links/automl.py +0 -193
- {apache_airflow_providers_google-16.0.0a1.dist-info → apache_airflow_providers_google-16.1.0rc1.dist-info}/WHEEL +0 -0
- {apache_airflow_providers_google-16.0.0a1.dist-info → apache_airflow_providers_google-16.1.0rc1.dist-info}/entry_points.txt +0 -0
@@ -108,6 +108,12 @@ class CloudBuildCancelBuildOperator(GoogleCloudBaseOperator):
|
|
108
108
|
self.impersonation_chain = impersonation_chain
|
109
109
|
self.location = location
|
110
110
|
|
111
|
+
@property
|
112
|
+
def extra_links_params(self) -> dict[str, Any]:
|
113
|
+
return {
|
114
|
+
"region": self.location,
|
115
|
+
}
|
116
|
+
|
111
117
|
def execute(self, context: Context):
|
112
118
|
hook = CloudBuildHook(gcp_conn_id=self.gcp_conn_id, impersonation_chain=self.impersonation_chain)
|
113
119
|
result = hook.cancel_build(
|
@@ -119,14 +125,12 @@ class CloudBuildCancelBuildOperator(GoogleCloudBaseOperator):
|
|
119
125
|
location=self.location,
|
120
126
|
)
|
121
127
|
|
122
|
-
|
128
|
+
context["task_instance"].xcom_push(key="id", value=result.id)
|
123
129
|
project_id = self.project_id or hook.project_id
|
124
130
|
if project_id:
|
125
131
|
CloudBuildLink.persist(
|
126
132
|
context=context,
|
127
|
-
task_instance=self,
|
128
133
|
project_id=project_id,
|
129
|
-
region=self.location,
|
130
134
|
build_id=result.id,
|
131
135
|
)
|
132
136
|
return Build.to_dict(result)
|
@@ -210,6 +214,12 @@ class CloudBuildCreateBuildOperator(GoogleCloudBaseOperator):
|
|
210
214
|
if self.build_raw.endswith(".json"):
|
211
215
|
self.build = json.loads(file.read())
|
212
216
|
|
217
|
+
@property
|
218
|
+
def extra_links_params(self) -> dict[str, Any]:
|
219
|
+
return {
|
220
|
+
"region": self.location,
|
221
|
+
}
|
222
|
+
|
213
223
|
def execute(self, context: Context):
|
214
224
|
hook = CloudBuildHook(
|
215
225
|
gcp_conn_id=self.gcp_conn_id,
|
@@ -225,7 +235,7 @@ class CloudBuildCreateBuildOperator(GoogleCloudBaseOperator):
|
|
225
235
|
metadata=self.metadata,
|
226
236
|
location=self.location,
|
227
237
|
)
|
228
|
-
|
238
|
+
context["task_instance"].xcom_push(key="id", value=self.id_)
|
229
239
|
if not self.wait:
|
230
240
|
return Build.to_dict(
|
231
241
|
hook.get_build(id_=self.id_, project_id=self.project_id, location=self.location)
|
@@ -251,9 +261,7 @@ class CloudBuildCreateBuildOperator(GoogleCloudBaseOperator):
|
|
251
261
|
if project_id:
|
252
262
|
CloudBuildLink.persist(
|
253
263
|
context=context,
|
254
|
-
task_instance=self,
|
255
264
|
project_id=project_id,
|
256
|
-
region=self.location,
|
257
265
|
build_id=cloud_build_instance_result.id,
|
258
266
|
)
|
259
267
|
return Build.to_dict(cloud_build_instance_result)
|
@@ -269,9 +277,7 @@ class CloudBuildCreateBuildOperator(GoogleCloudBaseOperator):
|
|
269
277
|
if project_id:
|
270
278
|
CloudBuildLink.persist(
|
271
279
|
context=context,
|
272
|
-
task_instance=self,
|
273
280
|
project_id=project_id,
|
274
|
-
region=self.location,
|
275
281
|
build_id=event["id_"],
|
276
282
|
)
|
277
283
|
return event["instance"]
|
@@ -336,6 +342,12 @@ class CloudBuildCreateBuildTriggerOperator(GoogleCloudBaseOperator):
|
|
336
342
|
self.impersonation_chain = impersonation_chain
|
337
343
|
self.location = location
|
338
344
|
|
345
|
+
@property
|
346
|
+
def extra_links_params(self) -> dict[str, Any]:
|
347
|
+
return {
|
348
|
+
"region": self.location,
|
349
|
+
}
|
350
|
+
|
339
351
|
def execute(self, context: Context):
|
340
352
|
hook = CloudBuildHook(gcp_conn_id=self.gcp_conn_id, impersonation_chain=self.impersonation_chain)
|
341
353
|
result = hook.create_build_trigger(
|
@@ -346,21 +358,17 @@ class CloudBuildCreateBuildTriggerOperator(GoogleCloudBaseOperator):
|
|
346
358
|
metadata=self.metadata,
|
347
359
|
location=self.location,
|
348
360
|
)
|
349
|
-
|
361
|
+
context["task_instance"].xcom_push(key="id", value=result.id)
|
350
362
|
project_id = self.project_id or hook.project_id
|
351
363
|
if project_id:
|
352
364
|
CloudBuildTriggerDetailsLink.persist(
|
353
365
|
context=context,
|
354
|
-
task_instance=self,
|
355
366
|
project_id=project_id,
|
356
|
-
region=self.location,
|
357
367
|
trigger_id=result.id,
|
358
368
|
)
|
359
369
|
CloudBuildTriggersListLink.persist(
|
360
370
|
context=context,
|
361
|
-
task_instance=self,
|
362
371
|
project_id=project_id,
|
363
|
-
region=self.location,
|
364
372
|
)
|
365
373
|
return BuildTrigger.to_dict(result)
|
366
374
|
|
@@ -419,6 +427,12 @@ class CloudBuildDeleteBuildTriggerOperator(GoogleCloudBaseOperator):
|
|
419
427
|
self.impersonation_chain = impersonation_chain
|
420
428
|
self.location = location
|
421
429
|
|
430
|
+
@property
|
431
|
+
def extra_links_params(self) -> dict[str, Any]:
|
432
|
+
return {
|
433
|
+
"region": self.location,
|
434
|
+
}
|
435
|
+
|
422
436
|
def execute(self, context: Context):
|
423
437
|
hook = CloudBuildHook(gcp_conn_id=self.gcp_conn_id, impersonation_chain=self.impersonation_chain)
|
424
438
|
hook.delete_build_trigger(
|
@@ -433,9 +447,7 @@ class CloudBuildDeleteBuildTriggerOperator(GoogleCloudBaseOperator):
|
|
433
447
|
if project_id:
|
434
448
|
CloudBuildTriggersListLink.persist(
|
435
449
|
context=context,
|
436
|
-
task_instance=self,
|
437
450
|
project_id=project_id,
|
438
|
-
region=self.location,
|
439
451
|
)
|
440
452
|
|
441
453
|
|
@@ -493,6 +505,12 @@ class CloudBuildGetBuildOperator(GoogleCloudBaseOperator):
|
|
493
505
|
self.impersonation_chain = impersonation_chain
|
494
506
|
self.location = location
|
495
507
|
|
508
|
+
@property
|
509
|
+
def extra_links_params(self) -> dict[str, Any]:
|
510
|
+
return {
|
511
|
+
"region": self.location,
|
512
|
+
}
|
513
|
+
|
496
514
|
def execute(self, context: Context):
|
497
515
|
hook = CloudBuildHook(gcp_conn_id=self.gcp_conn_id, impersonation_chain=self.impersonation_chain)
|
498
516
|
result = hook.get_build(
|
@@ -507,9 +525,7 @@ class CloudBuildGetBuildOperator(GoogleCloudBaseOperator):
|
|
507
525
|
if project_id:
|
508
526
|
CloudBuildLink.persist(
|
509
527
|
context=context,
|
510
|
-
task_instance=self,
|
511
528
|
project_id=project_id,
|
512
|
-
region=self.location,
|
513
529
|
build_id=result.id,
|
514
530
|
)
|
515
531
|
return Build.to_dict(result)
|
@@ -569,6 +585,12 @@ class CloudBuildGetBuildTriggerOperator(GoogleCloudBaseOperator):
|
|
569
585
|
self.impersonation_chain = impersonation_chain
|
570
586
|
self.location = location
|
571
587
|
|
588
|
+
@property
|
589
|
+
def extra_links_params(self) -> dict[str, Any]:
|
590
|
+
return {
|
591
|
+
"region": self.location,
|
592
|
+
}
|
593
|
+
|
572
594
|
def execute(self, context: Context):
|
573
595
|
hook = CloudBuildHook(gcp_conn_id=self.gcp_conn_id, impersonation_chain=self.impersonation_chain)
|
574
596
|
result = hook.get_build_trigger(
|
@@ -583,9 +605,7 @@ class CloudBuildGetBuildTriggerOperator(GoogleCloudBaseOperator):
|
|
583
605
|
if project_id:
|
584
606
|
CloudBuildTriggerDetailsLink.persist(
|
585
607
|
context=context,
|
586
|
-
task_instance=self,
|
587
608
|
project_id=project_id,
|
588
|
-
region=self.location,
|
589
609
|
trigger_id=result.id,
|
590
610
|
)
|
591
611
|
return BuildTrigger.to_dict(result)
|
@@ -649,6 +669,12 @@ class CloudBuildListBuildTriggersOperator(GoogleCloudBaseOperator):
|
|
649
669
|
self.gcp_conn_id = gcp_conn_id
|
650
670
|
self.impersonation_chain = impersonation_chain
|
651
671
|
|
672
|
+
@property
|
673
|
+
def extra_links_params(self) -> dict[str, Any]:
|
674
|
+
return {
|
675
|
+
"region": self.location,
|
676
|
+
}
|
677
|
+
|
652
678
|
def execute(self, context: Context):
|
653
679
|
hook = CloudBuildHook(gcp_conn_id=self.gcp_conn_id, impersonation_chain=self.impersonation_chain)
|
654
680
|
results = hook.list_build_triggers(
|
@@ -664,9 +690,7 @@ class CloudBuildListBuildTriggersOperator(GoogleCloudBaseOperator):
|
|
664
690
|
if project_id:
|
665
691
|
CloudBuildTriggersListLink.persist(
|
666
692
|
context=context,
|
667
|
-
task_instance=self,
|
668
693
|
project_id=project_id,
|
669
|
-
region=self.location,
|
670
694
|
)
|
671
695
|
return [BuildTrigger.to_dict(result) for result in results]
|
672
696
|
|
@@ -729,6 +753,12 @@ class CloudBuildListBuildsOperator(GoogleCloudBaseOperator):
|
|
729
753
|
self.gcp_conn_id = gcp_conn_id
|
730
754
|
self.impersonation_chain = impersonation_chain
|
731
755
|
|
756
|
+
@property
|
757
|
+
def extra_links_params(self) -> dict[str, Any]:
|
758
|
+
return {
|
759
|
+
"region": self.location,
|
760
|
+
}
|
761
|
+
|
732
762
|
def execute(self, context: Context):
|
733
763
|
hook = CloudBuildHook(gcp_conn_id=self.gcp_conn_id, impersonation_chain=self.impersonation_chain)
|
734
764
|
results = hook.list_builds(
|
@@ -743,7 +773,8 @@ class CloudBuildListBuildsOperator(GoogleCloudBaseOperator):
|
|
743
773
|
project_id = self.project_id or hook.project_id
|
744
774
|
if project_id:
|
745
775
|
CloudBuildListLink.persist(
|
746
|
-
context=context,
|
776
|
+
context=context,
|
777
|
+
project_id=project_id,
|
747
778
|
)
|
748
779
|
return [Build.to_dict(result) for result in results]
|
749
780
|
|
@@ -805,6 +836,12 @@ class CloudBuildRetryBuildOperator(GoogleCloudBaseOperator):
|
|
805
836
|
self.impersonation_chain = impersonation_chain
|
806
837
|
self.location = location
|
807
838
|
|
839
|
+
@property
|
840
|
+
def extra_links_params(self) -> dict[str, Any]:
|
841
|
+
return {
|
842
|
+
"region": self.location,
|
843
|
+
}
|
844
|
+
|
808
845
|
def execute(self, context: Context):
|
809
846
|
hook = CloudBuildHook(gcp_conn_id=self.gcp_conn_id, impersonation_chain=self.impersonation_chain)
|
810
847
|
result = hook.retry_build(
|
@@ -817,14 +854,12 @@ class CloudBuildRetryBuildOperator(GoogleCloudBaseOperator):
|
|
817
854
|
location=self.location,
|
818
855
|
)
|
819
856
|
|
820
|
-
|
857
|
+
context["task_instance"].xcom_push(key="id", value=result.id)
|
821
858
|
project_id = self.project_id or hook.project_id
|
822
859
|
if project_id:
|
823
860
|
CloudBuildLink.persist(
|
824
861
|
context=context,
|
825
|
-
task_instance=self,
|
826
862
|
project_id=project_id,
|
827
|
-
region=self.location,
|
828
863
|
build_id=result.id,
|
829
864
|
)
|
830
865
|
return Build.to_dict(result)
|
@@ -891,6 +926,12 @@ class CloudBuildRunBuildTriggerOperator(GoogleCloudBaseOperator):
|
|
891
926
|
self.impersonation_chain = impersonation_chain
|
892
927
|
self.location = location
|
893
928
|
|
929
|
+
@property
|
930
|
+
def extra_links_params(self) -> dict[str, Any]:
|
931
|
+
return {
|
932
|
+
"region": self.location,
|
933
|
+
}
|
934
|
+
|
894
935
|
def execute(self, context: Context):
|
895
936
|
hook = CloudBuildHook(gcp_conn_id=self.gcp_conn_id, impersonation_chain=self.impersonation_chain)
|
896
937
|
result = hook.run_build_trigger(
|
@@ -903,14 +944,12 @@ class CloudBuildRunBuildTriggerOperator(GoogleCloudBaseOperator):
|
|
903
944
|
metadata=self.metadata,
|
904
945
|
location=self.location,
|
905
946
|
)
|
906
|
-
|
947
|
+
context["task_instance"].xcom_push(key="id", value=result.id)
|
907
948
|
project_id = self.project_id or hook.project_id
|
908
949
|
if project_id:
|
909
950
|
CloudBuildLink.persist(
|
910
951
|
context=context,
|
911
|
-
task_instance=self,
|
912
952
|
project_id=project_id,
|
913
|
-
region=self.location,
|
914
953
|
build_id=result.id,
|
915
954
|
)
|
916
955
|
return Build.to_dict(result)
|
@@ -974,6 +1013,12 @@ class CloudBuildUpdateBuildTriggerOperator(GoogleCloudBaseOperator):
|
|
974
1013
|
self.impersonation_chain = impersonation_chain
|
975
1014
|
self.location = location
|
976
1015
|
|
1016
|
+
@property
|
1017
|
+
def extra_links_params(self) -> dict[str, Any]:
|
1018
|
+
return {
|
1019
|
+
"region": self.location,
|
1020
|
+
}
|
1021
|
+
|
977
1022
|
def execute(self, context: Context):
|
978
1023
|
hook = CloudBuildHook(gcp_conn_id=self.gcp_conn_id, impersonation_chain=self.impersonation_chain)
|
979
1024
|
result = hook.update_build_trigger(
|
@@ -985,14 +1030,12 @@ class CloudBuildUpdateBuildTriggerOperator(GoogleCloudBaseOperator):
|
|
985
1030
|
metadata=self.metadata,
|
986
1031
|
location=self.location,
|
987
1032
|
)
|
988
|
-
|
1033
|
+
context["task_instance"].xcom_push(key="id", value=result.id)
|
989
1034
|
project_id = self.project_id or hook.project_id
|
990
1035
|
if project_id:
|
991
1036
|
CloudBuildTriggerDetailsLink.persist(
|
992
1037
|
context=context,
|
993
|
-
task_instance=self,
|
994
1038
|
project_id=project_id,
|
995
|
-
region=self.location,
|
996
1039
|
trigger_id=result.id,
|
997
1040
|
)
|
998
1041
|
return BuildTrigger.to_dict(result)
|
@@ -19,7 +19,7 @@ from __future__ import annotations
|
|
19
19
|
|
20
20
|
import shlex
|
21
21
|
from collections.abc import Sequence
|
22
|
-
from typing import TYPE_CHECKING
|
22
|
+
from typing import TYPE_CHECKING, Any
|
23
23
|
|
24
24
|
from google.api_core.exceptions import AlreadyExists
|
25
25
|
from google.api_core.gapic_v1.method import DEFAULT, _MethodDefault
|
@@ -57,25 +57,6 @@ class CloudComposerEnvironmentLink(BaseGoogleLink):
|
|
57
57
|
key = "composer_conf"
|
58
58
|
format_str = CLOUD_COMPOSER_DETAILS_LINK
|
59
59
|
|
60
|
-
@staticmethod
|
61
|
-
def persist(
|
62
|
-
operator_instance: (
|
63
|
-
CloudComposerCreateEnvironmentOperator
|
64
|
-
| CloudComposerUpdateEnvironmentOperator
|
65
|
-
| CloudComposerGetEnvironmentOperator
|
66
|
-
),
|
67
|
-
context: Context,
|
68
|
-
) -> None:
|
69
|
-
operator_instance.xcom_push(
|
70
|
-
context,
|
71
|
-
key=CloudComposerEnvironmentLink.key,
|
72
|
-
value={
|
73
|
-
"project_id": operator_instance.project_id,
|
74
|
-
"region": operator_instance.region,
|
75
|
-
"environment_id": operator_instance.environment_id,
|
76
|
-
},
|
77
|
-
)
|
78
|
-
|
79
60
|
|
80
61
|
class CloudComposerEnvironmentsLink(BaseGoogleLink):
|
81
62
|
"""Helper class for constructing Cloud Composer Environment Link."""
|
@@ -84,16 +65,6 @@ class CloudComposerEnvironmentsLink(BaseGoogleLink):
|
|
84
65
|
key = "composer_conf"
|
85
66
|
format_str = CLOUD_COMPOSER_ENVIRONMENTS_LINK
|
86
67
|
|
87
|
-
@staticmethod
|
88
|
-
def persist(operator_instance: CloudComposerListEnvironmentsOperator, context: Context) -> None:
|
89
|
-
operator_instance.xcom_push(
|
90
|
-
context,
|
91
|
-
key=CloudComposerEnvironmentsLink.key,
|
92
|
-
value={
|
93
|
-
"project_id": operator_instance.project_id,
|
94
|
-
},
|
95
|
-
)
|
96
|
-
|
97
68
|
|
98
69
|
class CloudComposerCreateEnvironmentOperator(GoogleCloudBaseOperator):
|
99
70
|
"""
|
@@ -159,6 +130,14 @@ class CloudComposerCreateEnvironmentOperator(GoogleCloudBaseOperator):
|
|
159
130
|
self.deferrable = deferrable
|
160
131
|
self.pooling_period_seconds = pooling_period_seconds
|
161
132
|
|
133
|
+
@property
|
134
|
+
def extra_links_params(self) -> dict[str, Any]:
|
135
|
+
return {
|
136
|
+
"project_id": self.project_id,
|
137
|
+
"region": self.region,
|
138
|
+
"environment_id": self.environment_id,
|
139
|
+
}
|
140
|
+
|
162
141
|
def execute(self, context: Context):
|
163
142
|
hook = CloudComposerHook(
|
164
143
|
gcp_conn_id=self.gcp_conn_id,
|
@@ -171,7 +150,7 @@ class CloudComposerCreateEnvironmentOperator(GoogleCloudBaseOperator):
|
|
171
150
|
else:
|
172
151
|
self.environment["name"] = name
|
173
152
|
|
174
|
-
CloudComposerEnvironmentLink.persist(
|
153
|
+
CloudComposerEnvironmentLink.persist(context=context)
|
175
154
|
try:
|
176
155
|
result = hook.create_environment(
|
177
156
|
project_id=self.project_id,
|
@@ -370,6 +349,14 @@ class CloudComposerGetEnvironmentOperator(GoogleCloudBaseOperator):
|
|
370
349
|
self.gcp_conn_id = gcp_conn_id
|
371
350
|
self.impersonation_chain = impersonation_chain
|
372
351
|
|
352
|
+
@property
|
353
|
+
def extra_links_params(self) -> dict[str, Any]:
|
354
|
+
return {
|
355
|
+
"project_id": self.project_id,
|
356
|
+
"region": self.region,
|
357
|
+
"environment_id": self.environment_id,
|
358
|
+
}
|
359
|
+
|
373
360
|
def execute(self, context: Context):
|
374
361
|
hook = CloudComposerHook(
|
375
362
|
gcp_conn_id=self.gcp_conn_id,
|
@@ -384,8 +371,7 @@ class CloudComposerGetEnvironmentOperator(GoogleCloudBaseOperator):
|
|
384
371
|
timeout=self.timeout,
|
385
372
|
metadata=self.metadata,
|
386
373
|
)
|
387
|
-
|
388
|
-
CloudComposerEnvironmentLink.persist(operator_instance=self, context=context)
|
374
|
+
CloudComposerEnvironmentLink.persist(context=context)
|
389
375
|
return Environment.to_dict(result)
|
390
376
|
|
391
377
|
|
@@ -445,12 +431,17 @@ class CloudComposerListEnvironmentsOperator(GoogleCloudBaseOperator):
|
|
445
431
|
self.gcp_conn_id = gcp_conn_id
|
446
432
|
self.impersonation_chain = impersonation_chain
|
447
433
|
|
434
|
+
@property
|
435
|
+
def extra_links_params(self) -> dict[str, Any]:
|
436
|
+
return {
|
437
|
+
"project_id": self.project_id,
|
438
|
+
}
|
439
|
+
|
448
440
|
def execute(self, context: Context):
|
449
441
|
hook = CloudComposerHook(
|
450
442
|
gcp_conn_id=self.gcp_conn_id,
|
451
443
|
impersonation_chain=self.impersonation_chain,
|
452
444
|
)
|
453
|
-
CloudComposerEnvironmentsLink.persist(operator_instance=self, context=context)
|
454
445
|
result = hook.list_environments(
|
455
446
|
project_id=self.project_id,
|
456
447
|
region=self.region,
|
@@ -532,6 +523,14 @@ class CloudComposerUpdateEnvironmentOperator(GoogleCloudBaseOperator):
|
|
532
523
|
self.deferrable = deferrable
|
533
524
|
self.pooling_period_seconds = pooling_period_seconds
|
534
525
|
|
526
|
+
@property
|
527
|
+
def extra_links_params(self) -> dict[str, Any]:
|
528
|
+
return {
|
529
|
+
"project_id": self.project_id,
|
530
|
+
"region": self.region,
|
531
|
+
"environment_id": self.environment_id,
|
532
|
+
}
|
533
|
+
|
535
534
|
def execute(self, context: Context):
|
536
535
|
hook = CloudComposerHook(
|
537
536
|
gcp_conn_id=self.gcp_conn_id,
|
@@ -549,7 +548,7 @@ class CloudComposerUpdateEnvironmentOperator(GoogleCloudBaseOperator):
|
|
549
548
|
metadata=self.metadata,
|
550
549
|
)
|
551
550
|
|
552
|
-
CloudComposerEnvironmentLink.persist(
|
551
|
+
CloudComposerEnvironmentLink.persist(context=context)
|
553
552
|
if not self.deferrable:
|
554
553
|
environment = hook.wait_for_operation(timeout=self.timeout, operation=result)
|
555
554
|
return Environment.to_dict(environment)
|