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
@@ -16,13 +16,8 @@
|
|
16
16
|
# under the License.
|
17
17
|
from __future__ import annotations
|
18
18
|
|
19
|
-
from typing import TYPE_CHECKING
|
20
|
-
|
21
19
|
from airflow.providers.google.cloud.links.base import BaseGoogleLink
|
22
20
|
|
23
|
-
if TYPE_CHECKING:
|
24
|
-
from airflow.utils.context import Context
|
25
|
-
|
26
21
|
BUILD_BASE_LINK = "/cloud-build"
|
27
22
|
|
28
23
|
BUILD_LINK = BUILD_BASE_LINK + "/builds;region={region}/{build_id}?project={project_id}"
|
@@ -43,24 +38,6 @@ class CloudBuildLink(BaseGoogleLink):
|
|
43
38
|
key = "cloud_build_key"
|
44
39
|
format_str = BUILD_LINK
|
45
40
|
|
46
|
-
@staticmethod
|
47
|
-
def persist(
|
48
|
-
context: Context,
|
49
|
-
task_instance,
|
50
|
-
build_id: str,
|
51
|
-
project_id: str,
|
52
|
-
region: str,
|
53
|
-
):
|
54
|
-
task_instance.xcom_push(
|
55
|
-
context=context,
|
56
|
-
key=CloudBuildLink.key,
|
57
|
-
value={
|
58
|
-
"project_id": project_id,
|
59
|
-
"region": region,
|
60
|
-
"build_id": build_id,
|
61
|
-
},
|
62
|
-
)
|
63
|
-
|
64
41
|
|
65
42
|
class CloudBuildListLink(BaseGoogleLink):
|
66
43
|
"""Helper class for constructing Cloud Build List link."""
|
@@ -69,22 +46,6 @@ class CloudBuildListLink(BaseGoogleLink):
|
|
69
46
|
key = "cloud_build_list_key"
|
70
47
|
format_str = BUILD_LIST_LINK
|
71
48
|
|
72
|
-
@staticmethod
|
73
|
-
def persist(
|
74
|
-
context: Context,
|
75
|
-
task_instance,
|
76
|
-
project_id: str,
|
77
|
-
region: str,
|
78
|
-
):
|
79
|
-
task_instance.xcom_push(
|
80
|
-
context=context,
|
81
|
-
key=CloudBuildListLink.key,
|
82
|
-
value={
|
83
|
-
"project_id": project_id,
|
84
|
-
"region": region,
|
85
|
-
},
|
86
|
-
)
|
87
|
-
|
88
49
|
|
89
50
|
class CloudBuildTriggersListLink(BaseGoogleLink):
|
90
51
|
"""Helper class for constructing Cloud Build Triggers List link."""
|
@@ -93,22 +54,6 @@ class CloudBuildTriggersListLink(BaseGoogleLink):
|
|
93
54
|
key = "cloud_build_triggers_list_key"
|
94
55
|
format_str = BUILD_TRIGGERS_LIST_LINK
|
95
56
|
|
96
|
-
@staticmethod
|
97
|
-
def persist(
|
98
|
-
context: Context,
|
99
|
-
task_instance,
|
100
|
-
project_id: str,
|
101
|
-
region: str,
|
102
|
-
):
|
103
|
-
task_instance.xcom_push(
|
104
|
-
context=context,
|
105
|
-
key=CloudBuildTriggersListLink.key,
|
106
|
-
value={
|
107
|
-
"project_id": project_id,
|
108
|
-
"region": region,
|
109
|
-
},
|
110
|
-
)
|
111
|
-
|
112
57
|
|
113
58
|
class CloudBuildTriggerDetailsLink(BaseGoogleLink):
|
114
59
|
"""Helper class for constructing Cloud Build Trigger Details link."""
|
@@ -116,21 +61,3 @@ class CloudBuildTriggerDetailsLink(BaseGoogleLink):
|
|
116
61
|
name = "Cloud Build Triggers Details"
|
117
62
|
key = "cloud_build_triggers_details_key"
|
118
63
|
format_str = BUILD_TRIGGER_DETAILS_LINK
|
119
|
-
|
120
|
-
@staticmethod
|
121
|
-
def persist(
|
122
|
-
context: Context,
|
123
|
-
task_instance,
|
124
|
-
project_id: str,
|
125
|
-
region: str,
|
126
|
-
trigger_id: str,
|
127
|
-
):
|
128
|
-
task_instance.xcom_push(
|
129
|
-
context=context,
|
130
|
-
key=CloudBuildTriggerDetailsLink.key,
|
131
|
-
value={
|
132
|
-
"project_id": project_id,
|
133
|
-
"region": region,
|
134
|
-
"trigger_id": trigger_id,
|
135
|
-
},
|
136
|
-
)
|
@@ -19,15 +19,8 @@
|
|
19
19
|
|
20
20
|
from __future__ import annotations
|
21
21
|
|
22
|
-
from typing import TYPE_CHECKING
|
23
|
-
|
24
22
|
from airflow.providers.google.cloud.links.base import BaseGoogleLink
|
25
23
|
|
26
|
-
if TYPE_CHECKING:
|
27
|
-
from airflow.models import BaseOperator
|
28
|
-
from airflow.utils.context import Context
|
29
|
-
|
30
|
-
|
31
24
|
CLOUD_FUNCTIONS_BASE_LINK = "https://console.cloud.google.com/functions"
|
32
25
|
|
33
26
|
CLOUD_FUNCTIONS_DETAILS_LINK = (
|
@@ -44,20 +37,6 @@ class CloudFunctionsDetailsLink(BaseGoogleLink):
|
|
44
37
|
key = "cloud_functions_details"
|
45
38
|
format_str = CLOUD_FUNCTIONS_DETAILS_LINK
|
46
39
|
|
47
|
-
@staticmethod
|
48
|
-
def persist(
|
49
|
-
context: Context,
|
50
|
-
task_instance: BaseOperator,
|
51
|
-
function_name: str,
|
52
|
-
location: str,
|
53
|
-
project_id: str,
|
54
|
-
):
|
55
|
-
task_instance.xcom_push(
|
56
|
-
context,
|
57
|
-
key=CloudFunctionsDetailsLink.key,
|
58
|
-
value={"function_name": function_name, "location": location, "project_id": project_id},
|
59
|
-
)
|
60
|
-
|
61
40
|
|
62
41
|
class CloudFunctionsListLink(BaseGoogleLink):
|
63
42
|
"""Helper class for constructing Cloud Functions Details Link."""
|
@@ -65,15 +44,3 @@ class CloudFunctionsListLink(BaseGoogleLink):
|
|
65
44
|
name = "Cloud Functions List"
|
66
45
|
key = "cloud_functions_list"
|
67
46
|
format_str = CLOUD_FUNCTIONS_LIST_LINK
|
68
|
-
|
69
|
-
@staticmethod
|
70
|
-
def persist(
|
71
|
-
context: Context,
|
72
|
-
task_instance: BaseOperator,
|
73
|
-
project_id: str,
|
74
|
-
):
|
75
|
-
task_instance.xcom_push(
|
76
|
-
context,
|
77
|
-
key=CloudFunctionsDetailsLink.key,
|
78
|
-
value={"project_id": project_id},
|
79
|
-
)
|
@@ -19,14 +19,8 @@
|
|
19
19
|
|
20
20
|
from __future__ import annotations
|
21
21
|
|
22
|
-
from typing import TYPE_CHECKING
|
23
|
-
|
24
22
|
from airflow.providers.google.cloud.links.base import BaseGoogleLink
|
25
23
|
|
26
|
-
if TYPE_CHECKING:
|
27
|
-
from airflow.models import BaseOperator
|
28
|
-
from airflow.utils.context import Context
|
29
|
-
|
30
24
|
BASE_LINK = "/memorystore"
|
31
25
|
MEMCACHED_LINK = (
|
32
26
|
BASE_LINK + "/memcached/locations/{location_id}/instances/{instance_id}/details?project={project_id}"
|
@@ -45,20 +39,6 @@ class MemcachedInstanceDetailsLink(BaseGoogleLink):
|
|
45
39
|
key = "memcached_instance"
|
46
40
|
format_str = MEMCACHED_LINK
|
47
41
|
|
48
|
-
@staticmethod
|
49
|
-
def persist(
|
50
|
-
context: Context,
|
51
|
-
task_instance: BaseOperator,
|
52
|
-
instance_id: str,
|
53
|
-
location_id: str,
|
54
|
-
project_id: str | None,
|
55
|
-
):
|
56
|
-
task_instance.xcom_push(
|
57
|
-
context,
|
58
|
-
key=MemcachedInstanceDetailsLink.key,
|
59
|
-
value={"instance_id": instance_id, "location_id": location_id, "project_id": project_id},
|
60
|
-
)
|
61
|
-
|
62
42
|
|
63
43
|
class MemcachedInstanceListLink(BaseGoogleLink):
|
64
44
|
"""Helper class for constructing Memorystore Memcached List of Instances Link."""
|
@@ -67,18 +47,6 @@ class MemcachedInstanceListLink(BaseGoogleLink):
|
|
67
47
|
key = "memcached_instances"
|
68
48
|
format_str = MEMCACHED_LIST_LINK
|
69
49
|
|
70
|
-
@staticmethod
|
71
|
-
def persist(
|
72
|
-
context: Context,
|
73
|
-
task_instance: BaseOperator,
|
74
|
-
project_id: str | None,
|
75
|
-
):
|
76
|
-
task_instance.xcom_push(
|
77
|
-
context,
|
78
|
-
key=MemcachedInstanceListLink.key,
|
79
|
-
value={"project_id": project_id},
|
80
|
-
)
|
81
|
-
|
82
50
|
|
83
51
|
class RedisInstanceDetailsLink(BaseGoogleLink):
|
84
52
|
"""Helper class for constructing Memorystore Redis Instance Link."""
|
@@ -87,20 +55,6 @@ class RedisInstanceDetailsLink(BaseGoogleLink):
|
|
87
55
|
key = "redis_instance"
|
88
56
|
format_str = REDIS_LINK
|
89
57
|
|
90
|
-
@staticmethod
|
91
|
-
def persist(
|
92
|
-
context: Context,
|
93
|
-
task_instance: BaseOperator,
|
94
|
-
instance_id: str,
|
95
|
-
location_id: str,
|
96
|
-
project_id: str | None,
|
97
|
-
):
|
98
|
-
task_instance.xcom_push(
|
99
|
-
context,
|
100
|
-
key=RedisInstanceDetailsLink.key,
|
101
|
-
value={"instance_id": instance_id, "location_id": location_id, "project_id": project_id},
|
102
|
-
)
|
103
|
-
|
104
58
|
|
105
59
|
class RedisInstanceListLink(BaseGoogleLink):
|
106
60
|
"""Helper class for constructing Memorystore Redis List of Instances Link."""
|
@@ -108,15 +62,3 @@ class RedisInstanceListLink(BaseGoogleLink):
|
|
108
62
|
name = "Memorystore Redis List of Instances"
|
109
63
|
key = "redis_instances"
|
110
64
|
format_str = REDIS_LIST_LINK
|
111
|
-
|
112
|
-
@staticmethod
|
113
|
-
def persist(
|
114
|
-
context: Context,
|
115
|
-
task_instance: BaseOperator,
|
116
|
-
project_id: str | None,
|
117
|
-
):
|
118
|
-
task_instance.xcom_push(
|
119
|
-
context,
|
120
|
-
key=RedisInstanceListLink.key,
|
121
|
-
value={"project_id": project_id},
|
122
|
-
)
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# Licensed to the Apache Software Foundation (ASF) under one
|
2
|
+
# or more contributor license agreements. See the NOTICE file
|
3
|
+
# distributed with this work for additional information
|
4
|
+
# regarding copyright ownership. The ASF licenses this file
|
5
|
+
# to you under the Apache License, Version 2.0 (the
|
6
|
+
# "License"); you may not use this file except in compliance
|
7
|
+
# with the License. You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing,
|
12
|
+
# software distributed under the License is distributed on an
|
13
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
14
|
+
# KIND, either express or implied. See the License for the
|
15
|
+
# specific language governing permissions and limitations
|
16
|
+
# under the License.
|
17
|
+
from __future__ import annotations
|
18
|
+
|
19
|
+
from airflow.providers.google.cloud.links.base import BaseGoogleLink
|
20
|
+
|
21
|
+
|
22
|
+
class CloudRunJobLoggingLink(BaseGoogleLink):
|
23
|
+
"""Helper class for constructing Cloud Run Job Logging link."""
|
24
|
+
|
25
|
+
name = "Cloud Run Job Logging"
|
26
|
+
key = "log_uri"
|
27
|
+
format_str = "{log_uri}"
|
@@ -19,15 +19,8 @@
|
|
19
19
|
|
20
20
|
from __future__ import annotations
|
21
21
|
|
22
|
-
from typing import TYPE_CHECKING
|
23
|
-
|
24
22
|
from airflow.providers.google.cloud.links.base import BaseGoogleLink
|
25
23
|
|
26
|
-
if TYPE_CHECKING:
|
27
|
-
from airflow.models import BaseOperator
|
28
|
-
from airflow.utils.context import Context
|
29
|
-
|
30
|
-
|
31
24
|
CLOUD_SQL_BASE_LINK = "/sql"
|
32
25
|
CLOUD_SQL_INSTANCE_LINK = CLOUD_SQL_BASE_LINK + "/instances/{instance}/overview?project={project_id}"
|
33
26
|
CLOUD_SQL_INSTANCE_DATABASE_LINK = (
|
@@ -42,19 +35,6 @@ class CloudSQLInstanceLink(BaseGoogleLink):
|
|
42
35
|
key = "cloud_sql_instance"
|
43
36
|
format_str = CLOUD_SQL_INSTANCE_LINK
|
44
37
|
|
45
|
-
@staticmethod
|
46
|
-
def persist(
|
47
|
-
context: Context,
|
48
|
-
task_instance: BaseOperator,
|
49
|
-
cloud_sql_instance: str,
|
50
|
-
project_id: str | None,
|
51
|
-
):
|
52
|
-
task_instance.xcom_push(
|
53
|
-
context,
|
54
|
-
key=CloudSQLInstanceLink.key,
|
55
|
-
value={"instance": cloud_sql_instance, "project_id": project_id},
|
56
|
-
)
|
57
|
-
|
58
38
|
|
59
39
|
class CloudSQLInstanceDatabaseLink(BaseGoogleLink):
|
60
40
|
"""Helper class for constructing Cloud SQL Instance Database Link."""
|
@@ -62,16 +42,3 @@ class CloudSQLInstanceDatabaseLink(BaseGoogleLink):
|
|
62
42
|
name = "Cloud SQL Instance Database"
|
63
43
|
key = "cloud_sql_instance_database"
|
64
44
|
format_str = CLOUD_SQL_INSTANCE_DATABASE_LINK
|
65
|
-
|
66
|
-
@staticmethod
|
67
|
-
def persist(
|
68
|
-
context: Context,
|
69
|
-
task_instance: BaseOperator,
|
70
|
-
cloud_sql_instance: str,
|
71
|
-
project_id: str | None,
|
72
|
-
):
|
73
|
-
task_instance.xcom_push(
|
74
|
-
context,
|
75
|
-
key=CloudSQLInstanceDatabaseLink.key,
|
76
|
-
value={"instance": cloud_sql_instance, "project_id": project_id},
|
77
|
-
)
|
@@ -60,18 +60,6 @@ class CloudStorageTransferListLink(BaseGoogleLink):
|
|
60
60
|
key = "cloud_storage_transfer"
|
61
61
|
format_str = CLOUD_STORAGE_TRANSFER_LIST_LINK
|
62
62
|
|
63
|
-
@staticmethod
|
64
|
-
def persist(
|
65
|
-
context: Context,
|
66
|
-
task_instance,
|
67
|
-
project_id: str,
|
68
|
-
):
|
69
|
-
task_instance.xcom_push(
|
70
|
-
context,
|
71
|
-
key=CloudStorageTransferListLink.key,
|
72
|
-
value={"project_id": project_id},
|
73
|
-
)
|
74
|
-
|
75
63
|
|
76
64
|
class CloudStorageTransferJobLink(BaseGoogleLink):
|
77
65
|
"""Helper class for constructing Storage Transfer Job Link."""
|
@@ -80,22 +68,6 @@ class CloudStorageTransferJobLink(BaseGoogleLink):
|
|
80
68
|
key = "cloud_storage_transfer_job"
|
81
69
|
format_str = CLOUD_STORAGE_TRANSFER_JOB_LINK
|
82
70
|
|
83
|
-
@staticmethod
|
84
|
-
def persist(
|
85
|
-
context: Context,
|
86
|
-
project_id: str,
|
87
|
-
job_name: str,
|
88
|
-
):
|
89
|
-
job_name = job_name.split("/")[1] if job_name else ""
|
90
|
-
|
91
|
-
context["ti"].xcom_push(
|
92
|
-
key=CloudStorageTransferJobLink.key,
|
93
|
-
value={
|
94
|
-
"project_id": project_id,
|
95
|
-
"transfer_job": job_name,
|
96
|
-
},
|
97
|
-
)
|
98
|
-
|
99
71
|
|
100
72
|
class CloudStorageTransferDetailsLink(BaseGoogleLink):
|
101
73
|
"""Helper class for constructing Cloud Storage Transfer Operation Link."""
|
@@ -105,20 +77,21 @@ class CloudStorageTransferDetailsLink(BaseGoogleLink):
|
|
105
77
|
format_str = CLOUD_STORAGE_TRANSFER_OPERATION_LINK
|
106
78
|
|
107
79
|
@staticmethod
|
108
|
-
def
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
operation_name
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
80
|
+
def extract_parts(operation_name: str | None):
|
81
|
+
if not operation_name:
|
82
|
+
return "", ""
|
83
|
+
transfer_operation = operation_name.split("/")[1]
|
84
|
+
transfer_job = operation_name.split("-")[1]
|
85
|
+
return transfer_operation, transfer_job
|
86
|
+
|
87
|
+
@classmethod
|
88
|
+
def persist(cls, context: Context, **value):
|
89
|
+
operation_name = value.get("operation_name")
|
90
|
+
transfer_operation, transfer_job = cls.extract_parts(operation_name)
|
91
|
+
|
92
|
+
super().persist(
|
117
93
|
context,
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
"transfer_job": transfer_job,
|
122
|
-
"transfer_operation": transfer_operation,
|
123
|
-
},
|
94
|
+
project_id=value.get("project_id"),
|
95
|
+
transfer_job=transfer_job,
|
96
|
+
transfer_operation=transfer_operation,
|
124
97
|
)
|
@@ -24,7 +24,6 @@ from typing import TYPE_CHECKING
|
|
24
24
|
from airflow.providers.google.cloud.links.base import BaseGoogleLink
|
25
25
|
|
26
26
|
if TYPE_CHECKING:
|
27
|
-
from airflow.models import BaseOperator
|
28
27
|
from airflow.utils.context import Context
|
29
28
|
|
30
29
|
CLOUD_TASKS_BASE_LINK = "/cloudtasks"
|
@@ -51,18 +50,12 @@ class CloudTasksQueueLink(BaseGoogleLink):
|
|
51
50
|
parts = queue_name.split("/")
|
52
51
|
return parts[1], parts[3], parts[5]
|
53
52
|
|
54
|
-
@
|
55
|
-
def persist(
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
project_id, location, queue_id = CloudTasksQueueLink.extract_parts(queue_name)
|
61
|
-
operator_instance.xcom_push(
|
62
|
-
context,
|
63
|
-
key=CloudTasksQueueLink.key,
|
64
|
-
value={"project_id": project_id, "location": location, "queue_id": queue_id},
|
65
|
-
)
|
53
|
+
@classmethod
|
54
|
+
def persist(cls, context: Context, **value):
|
55
|
+
queue_name = value.get("queue_name")
|
56
|
+
project_id, location, queue_id = cls.extract_parts(queue_name)
|
57
|
+
|
58
|
+
super().persist(context, project_id=project_id, location=location, queue_id=queue_id)
|
66
59
|
|
67
60
|
|
68
61
|
class CloudTasksLink(BaseGoogleLink):
|
@@ -71,15 +64,3 @@ class CloudTasksLink(BaseGoogleLink):
|
|
71
64
|
name = "Cloud Tasks"
|
72
65
|
key = "cloud_task"
|
73
66
|
format_str = CLOUD_TASKS_LINK
|
74
|
-
|
75
|
-
@staticmethod
|
76
|
-
def persist(
|
77
|
-
operator_instance: BaseOperator,
|
78
|
-
context: Context,
|
79
|
-
project_id: str | None,
|
80
|
-
):
|
81
|
-
operator_instance.xcom_push(
|
82
|
-
context,
|
83
|
-
key=CloudTasksLink.key,
|
84
|
-
value={"project_id": project_id},
|
85
|
-
)
|
@@ -19,14 +19,8 @@
|
|
19
19
|
|
20
20
|
from __future__ import annotations
|
21
21
|
|
22
|
-
from typing import TYPE_CHECKING
|
23
|
-
|
24
22
|
from airflow.providers.google.cloud.links.base import BaseGoogleLink
|
25
23
|
|
26
|
-
if TYPE_CHECKING:
|
27
|
-
from airflow.models import BaseOperator
|
28
|
-
from airflow.utils.context import Context
|
29
|
-
|
30
24
|
COMPUTE_BASE_LINK = "https://console.cloud.google.com/compute"
|
31
25
|
COMPUTE_LINK = (
|
32
26
|
COMPUTE_BASE_LINK + "/instancesDetail/zones/{location_id}/instances/{resource_id}?project={project_id}"
|
@@ -44,24 +38,6 @@ class ComputeInstanceDetailsLink(BaseGoogleLink):
|
|
44
38
|
key = "compute_instance_details"
|
45
39
|
format_str = COMPUTE_LINK
|
46
40
|
|
47
|
-
@staticmethod
|
48
|
-
def persist(
|
49
|
-
context: Context,
|
50
|
-
task_instance: BaseOperator,
|
51
|
-
location_id: str,
|
52
|
-
resource_id: str | None,
|
53
|
-
project_id: str | None,
|
54
|
-
):
|
55
|
-
task_instance.xcom_push(
|
56
|
-
context,
|
57
|
-
key=ComputeInstanceDetailsLink.key,
|
58
|
-
value={
|
59
|
-
"location_id": location_id,
|
60
|
-
"resource_id": resource_id,
|
61
|
-
"project_id": project_id,
|
62
|
-
},
|
63
|
-
)
|
64
|
-
|
65
41
|
|
66
42
|
class ComputeInstanceTemplateDetailsLink(BaseGoogleLink):
|
67
43
|
"""Helper class for constructing Compute Instance Template details Link."""
|
@@ -70,22 +46,6 @@ class ComputeInstanceTemplateDetailsLink(BaseGoogleLink):
|
|
70
46
|
key = "compute_instance_template_details"
|
71
47
|
format_str = COMPUTE_TEMPLATE_LINK
|
72
48
|
|
73
|
-
@staticmethod
|
74
|
-
def persist(
|
75
|
-
context: Context,
|
76
|
-
task_instance: BaseOperator,
|
77
|
-
resource_id: str | None,
|
78
|
-
project_id: str | None,
|
79
|
-
):
|
80
|
-
task_instance.xcom_push(
|
81
|
-
context,
|
82
|
-
key=ComputeInstanceTemplateDetailsLink.key,
|
83
|
-
value={
|
84
|
-
"resource_id": resource_id,
|
85
|
-
"project_id": project_id,
|
86
|
-
},
|
87
|
-
)
|
88
|
-
|
89
49
|
|
90
50
|
class ComputeInstanceGroupManagerDetailsLink(BaseGoogleLink):
|
91
51
|
"""Helper class for constructing Compute Instance Group Manager details Link."""
|
@@ -93,21 +53,3 @@ class ComputeInstanceGroupManagerDetailsLink(BaseGoogleLink):
|
|
93
53
|
name = "Compute Instance Group Manager"
|
94
54
|
key = "compute_instance_group_manager_details"
|
95
55
|
format_str = COMPUTE_GROUP_MANAGER_LINK
|
96
|
-
|
97
|
-
@staticmethod
|
98
|
-
def persist(
|
99
|
-
context: Context,
|
100
|
-
task_instance: BaseOperator,
|
101
|
-
location_id: str,
|
102
|
-
resource_id: str | None,
|
103
|
-
project_id: str | None,
|
104
|
-
):
|
105
|
-
task_instance.xcom_push(
|
106
|
-
context,
|
107
|
-
key=ComputeInstanceGroupManagerDetailsLink.key,
|
108
|
-
value={
|
109
|
-
"location_id": location_id,
|
110
|
-
"resource_id": resource_id,
|
111
|
-
"project_id": project_id,
|
112
|
-
},
|
113
|
-
)
|