apache-airflow-providers-google 12.0.0rc2__py3-none-any.whl → 14.0.0__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/LICENSE +0 -52
- airflow/providers/google/__init__.py +1 -1
- airflow/providers/google/ads/hooks/ads.py +27 -13
- airflow/providers/google/ads/transfers/ads_to_gcs.py +18 -4
- airflow/providers/google/assets/bigquery.py +17 -0
- airflow/providers/google/cloud/_internal_client/secret_manager_client.py +2 -3
- airflow/providers/google/cloud/hooks/alloy_db.py +736 -8
- airflow/providers/google/cloud/hooks/automl.py +10 -4
- airflow/providers/google/cloud/hooks/bigquery.py +125 -22
- airflow/providers/google/cloud/hooks/bigquery_dts.py +8 -8
- airflow/providers/google/cloud/hooks/bigtable.py +2 -3
- airflow/providers/google/cloud/hooks/cloud_batch.py +3 -4
- airflow/providers/google/cloud/hooks/cloud_build.py +4 -5
- airflow/providers/google/cloud/hooks/cloud_composer.py +3 -4
- airflow/providers/google/cloud/hooks/cloud_memorystore.py +3 -4
- airflow/providers/google/cloud/hooks/cloud_run.py +3 -4
- airflow/providers/google/cloud/hooks/cloud_sql.py +7 -3
- airflow/providers/google/cloud/hooks/cloud_storage_transfer_service.py +119 -7
- airflow/providers/google/cloud/hooks/compute.py +3 -3
- airflow/providers/google/cloud/hooks/datacatalog.py +3 -4
- airflow/providers/google/cloud/hooks/dataflow.py +12 -12
- airflow/providers/google/cloud/hooks/dataform.py +2 -3
- airflow/providers/google/cloud/hooks/datafusion.py +2 -2
- airflow/providers/google/cloud/hooks/dataplex.py +1032 -11
- airflow/providers/google/cloud/hooks/dataproc.py +4 -5
- airflow/providers/google/cloud/hooks/dataproc_metastore.py +3 -4
- airflow/providers/google/cloud/hooks/dlp.py +3 -4
- airflow/providers/google/cloud/hooks/gcs.py +7 -6
- airflow/providers/google/cloud/hooks/kms.py +2 -3
- airflow/providers/google/cloud/hooks/kubernetes_engine.py +8 -8
- airflow/providers/google/cloud/hooks/life_sciences.py +1 -1
- airflow/providers/google/cloud/hooks/managed_kafka.py +482 -0
- airflow/providers/google/cloud/hooks/natural_language.py +2 -3
- airflow/providers/google/cloud/hooks/os_login.py +2 -3
- airflow/providers/google/cloud/hooks/pubsub.py +6 -6
- airflow/providers/google/cloud/hooks/secret_manager.py +2 -3
- airflow/providers/google/cloud/hooks/spanner.py +2 -2
- airflow/providers/google/cloud/hooks/speech_to_text.py +2 -3
- airflow/providers/google/cloud/hooks/stackdriver.py +4 -4
- airflow/providers/google/cloud/hooks/tasks.py +3 -4
- airflow/providers/google/cloud/hooks/text_to_speech.py +2 -3
- airflow/providers/google/cloud/hooks/translate.py +236 -5
- airflow/providers/google/cloud/hooks/vertex_ai/auto_ml.py +9 -4
- airflow/providers/google/cloud/hooks/vertex_ai/batch_prediction_job.py +3 -4
- airflow/providers/google/cloud/hooks/vertex_ai/custom_job.py +4 -5
- airflow/providers/google/cloud/hooks/vertex_ai/dataset.py +3 -4
- airflow/providers/google/cloud/hooks/vertex_ai/endpoint_service.py +2 -3
- airflow/providers/google/cloud/hooks/vertex_ai/feature_store.py +3 -4
- airflow/providers/google/cloud/hooks/vertex_ai/generative_model.py +1 -181
- airflow/providers/google/cloud/hooks/vertex_ai/hyperparameter_tuning_job.py +3 -4
- airflow/providers/google/cloud/hooks/vertex_ai/model_service.py +2 -3
- airflow/providers/google/cloud/hooks/vertex_ai/pipeline_job.py +3 -4
- airflow/providers/google/cloud/hooks/vertex_ai/prediction_service.py +2 -3
- airflow/providers/google/cloud/hooks/video_intelligence.py +2 -3
- airflow/providers/google/cloud/hooks/vision.py +3 -4
- airflow/providers/google/cloud/hooks/workflows.py +2 -3
- airflow/providers/google/cloud/links/alloy_db.py +46 -0
- airflow/providers/google/cloud/links/bigquery.py +25 -0
- airflow/providers/google/cloud/links/dataplex.py +172 -2
- airflow/providers/google/cloud/links/kubernetes_engine.py +1 -2
- airflow/providers/google/cloud/links/managed_kafka.py +104 -0
- airflow/providers/google/cloud/links/translate.py +28 -0
- airflow/providers/google/cloud/log/gcs_task_handler.py +3 -3
- airflow/providers/google/cloud/log/stackdriver_task_handler.py +11 -10
- airflow/providers/google/cloud/openlineage/facets.py +67 -0
- airflow/providers/google/cloud/openlineage/mixins.py +438 -173
- airflow/providers/google/cloud/openlineage/utils.py +394 -61
- airflow/providers/google/cloud/operators/alloy_db.py +980 -69
- airflow/providers/google/cloud/operators/automl.py +83 -245
- airflow/providers/google/cloud/operators/bigquery.py +377 -74
- airflow/providers/google/cloud/operators/bigquery_dts.py +126 -13
- airflow/providers/google/cloud/operators/bigtable.py +1 -3
- airflow/providers/google/cloud/operators/cloud_base.py +1 -2
- airflow/providers/google/cloud/operators/cloud_batch.py +2 -4
- airflow/providers/google/cloud/operators/cloud_build.py +3 -5
- airflow/providers/google/cloud/operators/cloud_composer.py +5 -7
- airflow/providers/google/cloud/operators/cloud_memorystore.py +4 -6
- airflow/providers/google/cloud/operators/cloud_run.py +6 -5
- airflow/providers/google/cloud/operators/cloud_sql.py +20 -8
- airflow/providers/google/cloud/operators/cloud_storage_transfer_service.py +62 -8
- airflow/providers/google/cloud/operators/compute.py +3 -4
- airflow/providers/google/cloud/operators/datacatalog.py +9 -11
- airflow/providers/google/cloud/operators/dataflow.py +1 -112
- airflow/providers/google/cloud/operators/dataform.py +3 -5
- airflow/providers/google/cloud/operators/datafusion.py +1 -1
- airflow/providers/google/cloud/operators/dataplex.py +2046 -7
- airflow/providers/google/cloud/operators/dataproc.py +102 -17
- airflow/providers/google/cloud/operators/dataproc_metastore.py +7 -9
- airflow/providers/google/cloud/operators/dlp.py +17 -19
- airflow/providers/google/cloud/operators/gcs.py +14 -17
- airflow/providers/google/cloud/operators/kubernetes_engine.py +2 -2
- airflow/providers/google/cloud/operators/managed_kafka.py +788 -0
- airflow/providers/google/cloud/operators/natural_language.py +3 -5
- airflow/providers/google/cloud/operators/pubsub.py +39 -7
- airflow/providers/google/cloud/operators/speech_to_text.py +3 -5
- airflow/providers/google/cloud/operators/stackdriver.py +3 -5
- airflow/providers/google/cloud/operators/tasks.py +4 -6
- airflow/providers/google/cloud/operators/text_to_speech.py +2 -4
- airflow/providers/google/cloud/operators/translate.py +414 -5
- airflow/providers/google/cloud/operators/translate_speech.py +2 -4
- airflow/providers/google/cloud/operators/vertex_ai/auto_ml.py +9 -8
- airflow/providers/google/cloud/operators/vertex_ai/batch_prediction_job.py +4 -6
- airflow/providers/google/cloud/operators/vertex_ai/custom_job.py +6 -8
- airflow/providers/google/cloud/operators/vertex_ai/dataset.py +4 -6
- airflow/providers/google/cloud/operators/vertex_ai/endpoint_service.py +4 -6
- airflow/providers/google/cloud/operators/vertex_ai/generative_model.py +0 -322
- airflow/providers/google/cloud/operators/vertex_ai/hyperparameter_tuning_job.py +4 -6
- airflow/providers/google/cloud/operators/vertex_ai/model_service.py +4 -6
- airflow/providers/google/cloud/operators/vertex_ai/pipeline_job.py +4 -6
- airflow/providers/google/cloud/operators/video_intelligence.py +3 -5
- airflow/providers/google/cloud/operators/vision.py +4 -6
- airflow/providers/google/cloud/operators/workflows.py +5 -7
- airflow/providers/google/cloud/secrets/secret_manager.py +1 -2
- airflow/providers/google/cloud/sensors/bigquery_dts.py +3 -5
- airflow/providers/google/cloud/sensors/bigtable.py +2 -3
- airflow/providers/google/cloud/sensors/cloud_composer.py +32 -8
- airflow/providers/google/cloud/sensors/cloud_storage_transfer_service.py +39 -1
- airflow/providers/google/cloud/sensors/dataplex.py +4 -6
- airflow/providers/google/cloud/sensors/dataproc.py +2 -3
- airflow/providers/google/cloud/sensors/dataproc_metastore.py +1 -2
- airflow/providers/google/cloud/sensors/gcs.py +2 -4
- airflow/providers/google/cloud/sensors/pubsub.py +2 -3
- airflow/providers/google/cloud/sensors/workflows.py +3 -5
- airflow/providers/google/cloud/transfers/bigquery_to_gcs.py +5 -5
- airflow/providers/google/cloud/transfers/gcs_to_bigquery.py +10 -12
- airflow/providers/google/cloud/transfers/gcs_to_gcs.py +1 -1
- airflow/providers/google/cloud/transfers/gcs_to_sftp.py +36 -4
- airflow/providers/google/cloud/transfers/mssql_to_gcs.py +27 -2
- airflow/providers/google/cloud/transfers/mysql_to_gcs.py +27 -2
- airflow/providers/google/cloud/transfers/postgres_to_gcs.py +27 -2
- airflow/providers/google/cloud/transfers/sftp_to_gcs.py +34 -5
- airflow/providers/google/cloud/transfers/sql_to_gcs.py +15 -0
- airflow/providers/google/cloud/transfers/trino_to_gcs.py +25 -2
- airflow/providers/google/cloud/triggers/bigquery_dts.py +1 -2
- airflow/providers/google/cloud/triggers/cloud_batch.py +1 -2
- airflow/providers/google/cloud/triggers/cloud_build.py +1 -2
- airflow/providers/google/cloud/triggers/cloud_composer.py +13 -3
- airflow/providers/google/cloud/triggers/cloud_storage_transfer_service.py +102 -4
- airflow/providers/google/cloud/triggers/dataflow.py +2 -3
- airflow/providers/google/cloud/triggers/dataplex.py +1 -2
- airflow/providers/google/cloud/triggers/dataproc.py +2 -3
- airflow/providers/google/cloud/triggers/kubernetes_engine.py +1 -1
- airflow/providers/google/cloud/triggers/pubsub.py +1 -2
- airflow/providers/google/cloud/triggers/vertex_ai.py +7 -8
- airflow/providers/google/cloud/utils/credentials_provider.py +15 -8
- airflow/providers/google/cloud/utils/external_token_supplier.py +1 -0
- airflow/providers/google/common/auth_backend/google_openid.py +4 -4
- airflow/providers/google/common/consts.py +1 -2
- airflow/providers/google/common/hooks/base_google.py +8 -7
- airflow/providers/google/get_provider_info.py +186 -134
- airflow/providers/google/marketing_platform/hooks/analytics_admin.py +2 -3
- airflow/providers/google/marketing_platform/hooks/search_ads.py +1 -1
- airflow/providers/google/marketing_platform/operators/analytics_admin.py +5 -7
- {apache_airflow_providers_google-12.0.0rc2.dist-info → apache_airflow_providers_google-14.0.0.dist-info}/METADATA +41 -58
- {apache_airflow_providers_google-12.0.0rc2.dist-info → apache_airflow_providers_google-14.0.0.dist-info}/RECORD +157 -159
- airflow/providers/google/cloud/example_dags/example_facebook_ads_to_gcs.py +0 -141
- airflow/providers/google/cloud/example_dags/example_looker.py +0 -64
- airflow/providers/google/cloud/example_dags/example_presto_to_gcs.py +0 -194
- airflow/providers/google/cloud/example_dags/example_salesforce_to_gcs.py +0 -129
- airflow/providers/google/marketing_platform/example_dags/__init__.py +0 -16
- airflow/providers/google/marketing_platform/example_dags/example_display_video.py +0 -213
- {apache_airflow_providers_google-12.0.0rc2.dist-info → apache_airflow_providers_google-14.0.0.dist-info}/WHEEL +0 -0
- {apache_airflow_providers_google-12.0.0rc2.dist-info → apache_airflow_providers_google-14.0.0.dist-info}/entry_points.txt +0 -0
@@ -19,35 +19,53 @@
|
|
19
19
|
from __future__ import annotations
|
20
20
|
|
21
21
|
import time
|
22
|
-
from collections.abc import Sequence
|
22
|
+
from collections.abc import MutableSequence, Sequence
|
23
|
+
from copy import deepcopy
|
23
24
|
from typing import TYPE_CHECKING, Any
|
24
25
|
|
26
|
+
from airflow.exceptions import AirflowException
|
27
|
+
from airflow.providers.google.common.consts import CLIENT_INFO
|
28
|
+
from airflow.providers.google.common.hooks.base_google import (
|
29
|
+
PROVIDE_PROJECT_ID,
|
30
|
+
GoogleBaseAsyncHook,
|
31
|
+
GoogleBaseHook,
|
32
|
+
)
|
25
33
|
from google.api_core.client_options import ClientOptions
|
26
34
|
from google.api_core.gapic_v1.method import DEFAULT, _MethodDefault
|
27
|
-
from google.cloud.dataplex_v1 import
|
35
|
+
from google.cloud.dataplex_v1 import (
|
36
|
+
DataplexServiceClient,
|
37
|
+
DataScanServiceAsyncClient,
|
38
|
+
DataScanServiceClient,
|
39
|
+
)
|
40
|
+
from google.cloud.dataplex_v1.services.catalog_service import CatalogServiceClient
|
28
41
|
from google.cloud.dataplex_v1.types import (
|
42
|
+
AspectType,
|
29
43
|
Asset,
|
30
44
|
DataScan,
|
31
45
|
DataScanJob,
|
46
|
+
Entry,
|
47
|
+
EntryGroup,
|
48
|
+
EntryType,
|
49
|
+
EntryView,
|
32
50
|
Lake,
|
33
51
|
Task,
|
34
52
|
Zone,
|
35
53
|
)
|
36
54
|
from google.protobuf.field_mask_pb2 import FieldMask
|
37
55
|
|
38
|
-
from airflow.exceptions import AirflowException
|
39
|
-
from airflow.providers.google.common.consts import CLIENT_INFO
|
40
|
-
from airflow.providers.google.common.hooks.base_google import (
|
41
|
-
PROVIDE_PROJECT_ID,
|
42
|
-
GoogleBaseAsyncHook,
|
43
|
-
GoogleBaseHook,
|
44
|
-
)
|
45
|
-
|
46
56
|
if TYPE_CHECKING:
|
57
|
+
from googleapiclient.discovery import Resource
|
58
|
+
|
47
59
|
from google.api_core.operation import Operation
|
48
60
|
from google.api_core.retry import Retry
|
49
61
|
from google.api_core.retry_async import AsyncRetry
|
50
|
-
from
|
62
|
+
from google.cloud.dataplex_v1.services.catalog_service.pagers import (
|
63
|
+
ListAspectTypesPager,
|
64
|
+
ListEntriesPager,
|
65
|
+
ListEntryGroupsPager,
|
66
|
+
ListEntryTypesPager,
|
67
|
+
SearchEntriesPager,
|
68
|
+
)
|
51
69
|
|
52
70
|
PATH_DATA_SCAN = "projects/{project_id}/locations/{region}/dataScans/{data_scan_id}"
|
53
71
|
|
@@ -110,6 +128,14 @@ class DataplexHook(GoogleBaseHook):
|
|
110
128
|
credentials=self.get_credentials(), client_info=CLIENT_INFO, client_options=client_options
|
111
129
|
)
|
112
130
|
|
131
|
+
def get_dataplex_catalog_client(self) -> CatalogServiceClient:
|
132
|
+
"""Return CatalogServiceClient."""
|
133
|
+
client_options = ClientOptions(api_endpoint="dataplex.googleapis.com:443")
|
134
|
+
|
135
|
+
return CatalogServiceClient(
|
136
|
+
credentials=self.get_credentials(), client_info=CLIENT_INFO, client_options=client_options
|
137
|
+
)
|
138
|
+
|
113
139
|
def wait_for_operation(self, timeout: float | None, operation: Operation):
|
114
140
|
"""Wait for long-lasting operation to complete."""
|
115
141
|
try:
|
@@ -118,6 +144,1001 @@ class DataplexHook(GoogleBaseHook):
|
|
118
144
|
error = operation.exception(timeout=timeout)
|
119
145
|
raise AirflowException(error)
|
120
146
|
|
147
|
+
@GoogleBaseHook.fallback_to_default_project_id
|
148
|
+
def create_entry(
|
149
|
+
self,
|
150
|
+
location: str,
|
151
|
+
entry_id: str,
|
152
|
+
entry_group_id: str,
|
153
|
+
entry_configuration: Entry | dict,
|
154
|
+
project_id: str = PROVIDE_PROJECT_ID,
|
155
|
+
retry: Retry | _MethodDefault = DEFAULT,
|
156
|
+
timeout: float | None = None,
|
157
|
+
metadata: Sequence[tuple[str, str]] = (),
|
158
|
+
) -> Entry:
|
159
|
+
"""
|
160
|
+
Create an EntryType resource.
|
161
|
+
|
162
|
+
:param location: Required. The ID of the Google Cloud location that the task belongs to.
|
163
|
+
:param entry_id: Required. Entry identifier. It has to be unique within an Entry Group.
|
164
|
+
Entries corresponding to Google Cloud resources use an Entry ID format based on `full resource
|
165
|
+
names <https://cloud.google.com/apis/design/resource_names#full_resource_name>`__.
|
166
|
+
The format is a full resource name of the resource without the prefix double slashes in the API
|
167
|
+
service name part of the full resource name. This allows retrieval of entries using their
|
168
|
+
associated resource name.
|
169
|
+
|
170
|
+
For example, if the full resource name of a resource is
|
171
|
+
``//library.googleapis.com/shelves/shelf1/books/book2``, then the suggested entry_id is
|
172
|
+
``library.googleapis.com/shelves/shelf1/books/book2``.
|
173
|
+
|
174
|
+
It is also suggested to follow the same convention for entries corresponding to resources from
|
175
|
+
providers or systems other than Google Cloud.
|
176
|
+
The maximum size of the field is 4000 characters.
|
177
|
+
:param entry_group_id: Required. EntryGroup resource name to which created Entry belongs to.
|
178
|
+
:param entry_configuration: Required. Entry configuration body.
|
179
|
+
:param project_id: Optional. The ID of the Google Cloud project that the task belongs to.
|
180
|
+
:param retry: Optional. A retry object used to retry requests. If `None` is specified, requests
|
181
|
+
will not be retried.
|
182
|
+
:param timeout: Optional. The amount of time, in seconds, to wait for the request to complete.
|
183
|
+
Note that if `retry` is specified, the timeout applies to each individual attempt.
|
184
|
+
:param metadata: Optional. Additional metadata that is provided to the method.
|
185
|
+
"""
|
186
|
+
client = self.get_dataplex_catalog_client()
|
187
|
+
return client.create_entry(
|
188
|
+
request={
|
189
|
+
"parent": client.entry_group_path(project_id, location, entry_group_id),
|
190
|
+
"entry_id": entry_id,
|
191
|
+
"entry": entry_configuration,
|
192
|
+
},
|
193
|
+
retry=retry,
|
194
|
+
timeout=timeout,
|
195
|
+
metadata=metadata,
|
196
|
+
)
|
197
|
+
|
198
|
+
@GoogleBaseHook.fallback_to_default_project_id
|
199
|
+
def get_entry(
|
200
|
+
self,
|
201
|
+
location: str,
|
202
|
+
entry_id: str,
|
203
|
+
entry_group_id: str,
|
204
|
+
view: EntryView | str | None = None,
|
205
|
+
aspect_types: MutableSequence[str] | None = None,
|
206
|
+
paths: MutableSequence[str] | None = None,
|
207
|
+
project_id: str = PROVIDE_PROJECT_ID,
|
208
|
+
retry: Retry | _MethodDefault = DEFAULT,
|
209
|
+
timeout: float | None = None,
|
210
|
+
metadata: Sequence[tuple[str, str]] = (),
|
211
|
+
) -> Entry:
|
212
|
+
"""
|
213
|
+
Get an Entry resource.
|
214
|
+
|
215
|
+
:param location: Required. The ID of the Google Cloud location that the task belongs to.
|
216
|
+
:param entry_id: Required. Entry identifier. It has to be unique within an Entry Group.
|
217
|
+
Entries corresponding to Google Cloud resources use an Entry ID format based on `full resource
|
218
|
+
names <https://cloud.google.com/apis/design/resource_names#full_resource_name>`__.
|
219
|
+
The format is a full resource name of the resource without the prefix double slashes in the API
|
220
|
+
service name part of the full resource name. This allows retrieval of entries using their
|
221
|
+
associated resource name.
|
222
|
+
|
223
|
+
For example, if the full resource name of a resource is
|
224
|
+
``//library.googleapis.com/shelves/shelf1/books/book2``, then the suggested entry_id is
|
225
|
+
``library.googleapis.com/shelves/shelf1/books/book2``.
|
226
|
+
|
227
|
+
It is also suggested to follow the same convention for entries corresponding to resources from
|
228
|
+
providers or systems other than Google Cloud.
|
229
|
+
The maximum size of the field is 4000 characters.
|
230
|
+
:param entry_group_id: Required. EntryGroup resource name to which created Entry belongs to.
|
231
|
+
:param view: Optional. View to control which parts of an entry the service should return.
|
232
|
+
:param aspect_types: Optional. Limits the aspects returned to the provided aspect types.
|
233
|
+
It only works for CUSTOM view.
|
234
|
+
:param paths: Optional. Limits the aspects returned to those associated with the provided paths
|
235
|
+
within the Entry. It only works for CUSTOM view.
|
236
|
+
:param project_id: Optional. The ID of the Google Cloud project that the task belongs to.
|
237
|
+
:param retry: Optional. A retry object used to retry requests. If `None` is specified, requests
|
238
|
+
will not be retried.
|
239
|
+
:param timeout: Optional. The amount of time, in seconds, to wait for the request to complete.
|
240
|
+
Note that if `retry` is specified, the timeout applies to each individual attempt.
|
241
|
+
:param metadata: Optional. Additional metadata that is provided to the method.
|
242
|
+
"""
|
243
|
+
client = self.get_dataplex_catalog_client()
|
244
|
+
return client.get_entry(
|
245
|
+
request={
|
246
|
+
"name": client.entry_path(project_id, location, entry_group_id, entry_id),
|
247
|
+
"view": view,
|
248
|
+
"aspect_types": aspect_types,
|
249
|
+
"paths": paths,
|
250
|
+
},
|
251
|
+
retry=retry,
|
252
|
+
timeout=timeout,
|
253
|
+
metadata=metadata,
|
254
|
+
)
|
255
|
+
|
256
|
+
@GoogleBaseHook.fallback_to_default_project_id
|
257
|
+
def delete_entry(
|
258
|
+
self,
|
259
|
+
location: str,
|
260
|
+
entry_id: str,
|
261
|
+
entry_group_id: str,
|
262
|
+
project_id: str = PROVIDE_PROJECT_ID,
|
263
|
+
retry: Retry | _MethodDefault = DEFAULT,
|
264
|
+
timeout: float | None = None,
|
265
|
+
metadata: Sequence[tuple[str, str]] = (),
|
266
|
+
) -> Entry:
|
267
|
+
"""
|
268
|
+
Delete an AspectType resource.
|
269
|
+
|
270
|
+
:param location: Required. The ID of the Google Cloud location that the task belongs to.
|
271
|
+
:param entry_id: Required. Entry identifier. It has to be unique within an Entry Group.
|
272
|
+
Entries corresponding to Google Cloud resources use an Entry ID format based on `full resource
|
273
|
+
names <https://cloud.google.com/apis/design/resource_names#full_resource_name>`__.
|
274
|
+
The format is a full resource name of the resource without the prefix double slashes in the API
|
275
|
+
service name part of the full resource name. This allows retrieval of entries using their
|
276
|
+
associated resource name.
|
277
|
+
|
278
|
+
For example, if the full resource name of a resource is
|
279
|
+
``//library.googleapis.com/shelves/shelf1/books/book2``, then the suggested entry_id is
|
280
|
+
``library.googleapis.com/shelves/shelf1/books/book2``.
|
281
|
+
|
282
|
+
It is also suggested to follow the same convention for entries corresponding to resources from
|
283
|
+
providers or systems other than Google Cloud.
|
284
|
+
The maximum size of the field is 4000 characters.
|
285
|
+
:param entry_group_id: Required. EntryGroup resource name to which created Entry belongs to.
|
286
|
+
:param project_id: Optional. The ID of the Google Cloud project that the task belongs to.
|
287
|
+
:param retry: Optional. A retry object used to retry requests. If `None` is specified, requests
|
288
|
+
will not be retried.
|
289
|
+
:param timeout: Optional. The amount of time, in seconds, to wait for the request to complete.
|
290
|
+
Note that if `retry` is specified, the timeout applies to each individual attempt.
|
291
|
+
:param metadata: Optional. Additional metadata that is provided to the method.
|
292
|
+
"""
|
293
|
+
client = self.get_dataplex_catalog_client()
|
294
|
+
return client.delete_entry(
|
295
|
+
request={
|
296
|
+
"name": client.entry_path(project_id, location, entry_group_id, entry_id),
|
297
|
+
},
|
298
|
+
retry=retry,
|
299
|
+
timeout=timeout,
|
300
|
+
metadata=metadata,
|
301
|
+
)
|
302
|
+
|
303
|
+
@GoogleBaseHook.fallback_to_default_project_id
|
304
|
+
def list_entries(
|
305
|
+
self,
|
306
|
+
location: str,
|
307
|
+
entry_group_id: str,
|
308
|
+
filter_by: str | None = None,
|
309
|
+
page_size: int | None = None,
|
310
|
+
page_token: str | None = None,
|
311
|
+
project_id: str = PROVIDE_PROJECT_ID,
|
312
|
+
retry: Retry | _MethodDefault = DEFAULT,
|
313
|
+
timeout: float | None = None,
|
314
|
+
metadata: Sequence[tuple[str, str]] = (),
|
315
|
+
) -> ListEntriesPager:
|
316
|
+
r"""
|
317
|
+
List Entries resources from specific location.
|
318
|
+
|
319
|
+
:param location: Required. The ID of the Google Cloud location that the task belongs to.
|
320
|
+
:param entry_group_id: Required. EntryGroup resource name to which created Entry belongs to.
|
321
|
+
:param filter_by: Optional. A filter on the entries to return. Filters are case-sensitive.
|
322
|
+
You can filter the request by the following fields:
|
323
|
+
|
324
|
+
- entry_type
|
325
|
+
- entry_source.display_name
|
326
|
+
|
327
|
+
The comparison operators are =, !=, <, >, <=, >=. The service compares strings according to
|
328
|
+
lexical order.
|
329
|
+
You can use the logical operators AND, OR, NOT in the filter. You can use Wildcard "*", but for
|
330
|
+
entry_type you need to provide the full project id or number.
|
331
|
+
Example filter expressions:
|
332
|
+
|
333
|
+
- "entry_source.display_name=AnExampleDisplayName"
|
334
|
+
- "entry_type=projects/example-project/locations/global/entryTypes/example-entry_type"
|
335
|
+
- "entry_type=projects/example-project/locations/us/entryTypes/a\*
|
336
|
+
OR entry_type=projects/another-project/locations/\*"
|
337
|
+
- "NOT entry_source.display_name=AnotherExampleDisplayName".
|
338
|
+
|
339
|
+
:param page_size: Optional. Number of items to return per page. If there are remaining results,
|
340
|
+
the service returns a next_page_token. If unspecified, the service returns at most 10 Entries.
|
341
|
+
The maximum value is 100; values above 100 will be coerced to 100.
|
342
|
+
:param page_token: Optional. Page token received from a previous ``ListEntries`` call. Provide
|
343
|
+
this to retrieve the subsequent page.
|
344
|
+
:param project_id: Optional. The ID of the Google Cloud project that the task belongs to.
|
345
|
+
:param retry: Optional. A retry object used to retry requests. If `None` is specified, requests
|
346
|
+
will not be retried.
|
347
|
+
:param timeout: Optional. The amount of time, in seconds, to wait for the request to complete.
|
348
|
+
Note that if `retry` is specified, the timeout applies to each individual attempt.
|
349
|
+
:param metadata: Optional. Additional metadata that is provided to the method.
|
350
|
+
"""
|
351
|
+
client = self.get_dataplex_catalog_client()
|
352
|
+
return client.list_entries(
|
353
|
+
request={
|
354
|
+
"parent": client.entry_group_path(project_id, location, entry_group_id),
|
355
|
+
"filter": filter_by,
|
356
|
+
"page_size": page_size,
|
357
|
+
"page_token": page_token,
|
358
|
+
},
|
359
|
+
retry=retry,
|
360
|
+
timeout=timeout,
|
361
|
+
metadata=metadata,
|
362
|
+
)
|
363
|
+
|
364
|
+
@GoogleBaseHook.fallback_to_default_project_id
|
365
|
+
def search_entries(
|
366
|
+
self,
|
367
|
+
location: str,
|
368
|
+
query: str,
|
369
|
+
order_by: str | None = None,
|
370
|
+
scope: str | None = None,
|
371
|
+
page_size: int | None = None,
|
372
|
+
page_token: str | None = None,
|
373
|
+
project_id: str = PROVIDE_PROJECT_ID,
|
374
|
+
retry: Retry | _MethodDefault = DEFAULT,
|
375
|
+
timeout: float | None = None,
|
376
|
+
metadata: Sequence[tuple[str, str]] = (),
|
377
|
+
) -> SearchEntriesPager:
|
378
|
+
"""
|
379
|
+
Search for Entries matching the given query and scope.
|
380
|
+
|
381
|
+
:param location: Required. The ID of the Google Cloud location that the task belongs to.
|
382
|
+
:param query: Required. The query against which entries in scope should be matched. The query
|
383
|
+
syntax is defined in `Search syntax for Dataplex Catalog
|
384
|
+
<https://cloud.google.com/dataplex/docs/search-syntax>`__.
|
385
|
+
:param order_by: Optional. Specifies the ordering of results. Supported values are:
|
386
|
+
|
387
|
+
- ``relevance`` (default)
|
388
|
+
- ``last_modified_timestamp``
|
389
|
+
- ``last_modified_timestamp asc``
|
390
|
+
|
391
|
+
:param scope: Optional. The scope under which the search should be operating. It must either be
|
392
|
+
``organizations/<org_id>`` or ``projects/<project_ref>``. If it is unspecified, it
|
393
|
+
defaults to the organization where the project provided in ``name`` is located.
|
394
|
+
:param page_size: Optional. Number of items to return per page. If there are remaining results,
|
395
|
+
the service returns a next_page_token. If unspecified, the service returns at most 10 Entries.
|
396
|
+
The maximum value is 100; values above 100 will be coerced to 100.
|
397
|
+
:param page_token: Optional. Page token received from a previous ``ListEntries`` call. Provide
|
398
|
+
this to retrieve the subsequent page.
|
399
|
+
:param project_id: Optional. The ID of the Google Cloud project that the task belongs to.
|
400
|
+
:param retry: Optional. A retry object used to retry requests. If `None` is specified, requests
|
401
|
+
will not be retried.
|
402
|
+
:param timeout: Optional. The amount of time, in seconds, to wait for the request to complete.
|
403
|
+
Note that if `retry` is specified, the timeout applies to each individual attempt.
|
404
|
+
:param metadata: Optional. Additional metadata that is provided to the method.
|
405
|
+
"""
|
406
|
+
client = self.get_dataplex_catalog_client()
|
407
|
+
return client.search_entries(
|
408
|
+
request={
|
409
|
+
"name": client.common_location_path(project_id, location),
|
410
|
+
"query": query,
|
411
|
+
"order_by": order_by,
|
412
|
+
"page_size": page_size,
|
413
|
+
"page_token": page_token,
|
414
|
+
"scope": scope,
|
415
|
+
},
|
416
|
+
retry=retry,
|
417
|
+
timeout=timeout,
|
418
|
+
metadata=metadata,
|
419
|
+
)
|
420
|
+
|
421
|
+
@GoogleBaseHook.fallback_to_default_project_id
|
422
|
+
def lookup_entry(
|
423
|
+
self,
|
424
|
+
location: str,
|
425
|
+
entry_id: str,
|
426
|
+
entry_group_id: str,
|
427
|
+
view: EntryView | str | None = None,
|
428
|
+
aspect_types: MutableSequence[str] | None = None,
|
429
|
+
paths: MutableSequence[str] | None = None,
|
430
|
+
project_id: str = PROVIDE_PROJECT_ID,
|
431
|
+
retry: Retry | _MethodDefault = DEFAULT,
|
432
|
+
timeout: float | None = None,
|
433
|
+
metadata: Sequence[tuple[str, str]] = (),
|
434
|
+
) -> Entry:
|
435
|
+
"""
|
436
|
+
Look up a single Entry by name using the permission on the source system.
|
437
|
+
|
438
|
+
:param location: Required. The ID of the Google Cloud location that the task belongs to.
|
439
|
+
:param entry_id: Required. Entry identifier. It has to be unique within an Entry Group.
|
440
|
+
Entries corresponding to Google Cloud resources use an Entry ID format based on `full resource
|
441
|
+
names <https://cloud.google.com/apis/design/resource_names#full_resource_name>`__.
|
442
|
+
The format is a full resource name of the resource without the prefix double slashes in the API
|
443
|
+
service name part of the full resource name. This allows retrieval of entries using their
|
444
|
+
associated resource name.
|
445
|
+
For example, if the full resource name of a resource is
|
446
|
+
``//library.googleapis.com/shelves/shelf1/books/book2``, then the suggested entry_id is
|
447
|
+
``library.googleapis.com/shelves/shelf1/books/book2``.
|
448
|
+
It is also suggested to follow the same convention for entries corresponding to resources from
|
449
|
+
providers or systems other than Google Cloud.
|
450
|
+
The maximum size of the field is 4000 characters.
|
451
|
+
:param entry_group_id: Required. EntryGroup resource name to which created Entry belongs to.
|
452
|
+
:param view: Optional. View to control which parts of an entry the service should return.
|
453
|
+
:param aspect_types: Optional. Limits the aspects returned to the provided aspect types.
|
454
|
+
It only works for CUSTOM view.
|
455
|
+
:param paths: Optional. Limits the aspects returned to those associated with the provided paths
|
456
|
+
within the Entry. It only works for CUSTOM view.
|
457
|
+
:param project_id: Optional. The ID of the Google Cloud project that the task belongs to.
|
458
|
+
:param retry: Optional. A retry object used to retry requests. If `None` is specified, requests
|
459
|
+
will not be retried.
|
460
|
+
:param timeout: Optional. The amount of time, in seconds, to wait for the request to complete.
|
461
|
+
Note that if `retry` is specified, the timeout applies to each individual attempt.
|
462
|
+
:param metadata: Optional. Additional metadata that is provided to the method.
|
463
|
+
"""
|
464
|
+
client = self.get_dataplex_catalog_client()
|
465
|
+
return client.lookup_entry(
|
466
|
+
request={
|
467
|
+
"name": client.common_location_path(project_id, location),
|
468
|
+
"entry": client.entry_path(project_id, location, entry_group_id, entry_id),
|
469
|
+
"view": view,
|
470
|
+
"aspect_types": aspect_types,
|
471
|
+
"paths": paths,
|
472
|
+
},
|
473
|
+
retry=retry,
|
474
|
+
timeout=timeout,
|
475
|
+
metadata=metadata,
|
476
|
+
)
|
477
|
+
|
478
|
+
@GoogleBaseHook.fallback_to_default_project_id
|
479
|
+
def update_entry(
|
480
|
+
self,
|
481
|
+
location: str,
|
482
|
+
entry_id: str,
|
483
|
+
entry_group_id: str,
|
484
|
+
entry_configuration: dict | Entry,
|
485
|
+
allow_missing: bool | None = False,
|
486
|
+
delete_missing_aspects: bool | None = False,
|
487
|
+
aspect_keys: MutableSequence[str] | None = None,
|
488
|
+
update_mask: list[str] | FieldMask | None = None,
|
489
|
+
project_id: str = PROVIDE_PROJECT_ID,
|
490
|
+
retry: Retry | _MethodDefault = DEFAULT,
|
491
|
+
timeout: float | None = None,
|
492
|
+
metadata: Sequence[tuple[str, str]] = (),
|
493
|
+
) -> Entry:
|
494
|
+
"""
|
495
|
+
Update an Entry resource.
|
496
|
+
|
497
|
+
:param entry_id: Required. Entry identifier. It has to be unique within an Entry Group.
|
498
|
+
Entries corresponding to Google Cloud resources use an Entry ID format based on `full resource
|
499
|
+
names <https://cloud.google.com/apis/design/resource_names#full_resource_name>`__.
|
500
|
+
The format is a full resource name of the resource without the prefix double slashes in the API
|
501
|
+
service name part of the full resource name. This allows retrieval of entries using their
|
502
|
+
associated resource name.
|
503
|
+
For example, if the full resource name of a resource is
|
504
|
+
``//library.googleapis.com/shelves/shelf1/books/book2``, then the suggested entry_id is
|
505
|
+
``library.googleapis.com/shelves/shelf1/books/book2``.
|
506
|
+
It is also suggested to follow the same convention for entries corresponding to resources from
|
507
|
+
providers or systems other than Google Cloud.
|
508
|
+
The maximum size of the field is 4000 characters.
|
509
|
+
:param entry_group_id: Required. EntryGroup resource name to which created Entry belongs to.
|
510
|
+
:param entry_configuration: Required. The updated configuration body of the Entry.
|
511
|
+
:param location: Required. The ID of the Google Cloud location that the task belongs to.
|
512
|
+
:param update_mask: Optional. Names of fields whose values to overwrite on an entry group.
|
513
|
+
If this parameter is absent or empty, all modifiable fields are overwritten. If such
|
514
|
+
fields are non-required and omitted in the request body, their values are emptied.
|
515
|
+
:param allow_missing: Optional. If set to true and entry doesn't exist, the service will create it.
|
516
|
+
:param delete_missing_aspects: Optional. If set to true and the aspect_keys specify aspect
|
517
|
+
ranges, the service deletes any existing aspects from that range that weren't provided
|
518
|
+
in the request.
|
519
|
+
:param aspect_keys: Optional. The map keys of the Aspects which the service should modify.
|
520
|
+
It supports the following syntax:
|
521
|
+
|
522
|
+
- ``<aspect_type_reference>`` - matches an aspect of the given type and empty path.
|
523
|
+
- ``<aspect_type_reference>@path`` - matches an aspect of the given type and specified path.
|
524
|
+
For example, to attach an aspect to a field that is specified by the ``schema``
|
525
|
+
aspect, the path should have the format ``Schema.<field_name>``.
|
526
|
+
- ``<aspect_type_reference>@*`` - matches aspects of the given type for all paths.
|
527
|
+
- ``*@path`` - matches aspects of all types on the given path.
|
528
|
+
|
529
|
+
The service will not remove existing aspects matching the syntax unless ``delete_missing_aspects``
|
530
|
+
is set to true.
|
531
|
+
If this field is left empty, the service treats it as specifying exactly those Aspects present
|
532
|
+
in the request.
|
533
|
+
:param project_id: Optional. The ID of the Google Cloud project that the task belongs to.
|
534
|
+
:param retry: Optional. A retry object used to retry requests. If `None` is specified, requests
|
535
|
+
will not be retried.
|
536
|
+
:param timeout: Optional. The amount of time, in seconds, to wait for the request to complete.
|
537
|
+
Note that if `retry` is specified, the timeout applies to each individual attempt.
|
538
|
+
:param metadata: Optional. Additional metadata that is provided to the method.
|
539
|
+
"""
|
540
|
+
client = self.get_dataplex_catalog_client()
|
541
|
+
_entry = (
|
542
|
+
deepcopy(entry_configuration)
|
543
|
+
if isinstance(entry_configuration, dict)
|
544
|
+
else Entry.to_dict(entry_configuration)
|
545
|
+
)
|
546
|
+
_entry["name"] = client.entry_path(project_id, location, entry_group_id, entry_id)
|
547
|
+
return client.update_entry(
|
548
|
+
request={
|
549
|
+
"entry": _entry,
|
550
|
+
"update_mask": FieldMask(paths=update_mask) if type(update_mask) is list else update_mask,
|
551
|
+
"allow_missing": allow_missing,
|
552
|
+
"delete_missing_aspects": delete_missing_aspects,
|
553
|
+
"aspect_keys": aspect_keys,
|
554
|
+
},
|
555
|
+
retry=retry,
|
556
|
+
timeout=timeout,
|
557
|
+
metadata=metadata,
|
558
|
+
)
|
559
|
+
|
560
|
+
@GoogleBaseHook.fallback_to_default_project_id
|
561
|
+
def create_aspect_type(
|
562
|
+
self,
|
563
|
+
location: str,
|
564
|
+
aspect_type_id: str,
|
565
|
+
aspect_type_configuration: AspectType | dict,
|
566
|
+
project_id: str = PROVIDE_PROJECT_ID,
|
567
|
+
validate_only: bool = False,
|
568
|
+
retry: Retry | _MethodDefault = DEFAULT,
|
569
|
+
timeout: float | None = None,
|
570
|
+
metadata: Sequence[tuple[str, str]] = (),
|
571
|
+
) -> Operation:
|
572
|
+
"""
|
573
|
+
Create an EntryType resource.
|
574
|
+
|
575
|
+
:param location: Required. The ID of the Google Cloud location that the task belongs to.
|
576
|
+
:param aspect_type_id: Required. AspectType identifier.
|
577
|
+
:param aspect_type_configuration: Required. AspectType configuration body.
|
578
|
+
:param project_id: Optional. The ID of the Google Cloud project that the task belongs to.
|
579
|
+
:param validate_only: Optional. If set, performs request validation, but does not actually execute
|
580
|
+
the create request.
|
581
|
+
:param retry: Optional. A retry object used to retry requests. If `None` is specified, requests
|
582
|
+
will not be retried.
|
583
|
+
:param timeout: Optional. The amount of time, in seconds, to wait for the request to complete.
|
584
|
+
Note that if `retry` is specified, the timeout applies to each individual attempt.
|
585
|
+
:param metadata: Optional. Additional metadata that is provided to the method.
|
586
|
+
"""
|
587
|
+
client = self.get_dataplex_catalog_client()
|
588
|
+
return client.create_aspect_type(
|
589
|
+
request={
|
590
|
+
"parent": client.common_location_path(project_id, location),
|
591
|
+
"aspect_type_id": aspect_type_id,
|
592
|
+
"aspect_type": aspect_type_configuration,
|
593
|
+
"validate_only": validate_only,
|
594
|
+
},
|
595
|
+
retry=retry,
|
596
|
+
timeout=timeout,
|
597
|
+
metadata=metadata,
|
598
|
+
)
|
599
|
+
|
600
|
+
@GoogleBaseHook.fallback_to_default_project_id
|
601
|
+
def get_aspect_type(
|
602
|
+
self,
|
603
|
+
location: str,
|
604
|
+
aspect_type_id: str,
|
605
|
+
project_id: str = PROVIDE_PROJECT_ID,
|
606
|
+
retry: Retry | _MethodDefault = DEFAULT,
|
607
|
+
timeout: float | None = None,
|
608
|
+
metadata: Sequence[tuple[str, str]] = (),
|
609
|
+
) -> AspectType:
|
610
|
+
"""
|
611
|
+
Get an AspectType resource.
|
612
|
+
|
613
|
+
:param location: Required. The ID of the Google Cloud location that the task belongs to.
|
614
|
+
:param aspect_type_id: Required. AspectType identifier.
|
615
|
+
:param project_id: Optional. The ID of the Google Cloud project that the task belongs to.
|
616
|
+
:param retry: Optional. A retry object used to retry requests. If `None` is specified, requests
|
617
|
+
will not be retried.
|
618
|
+
:param timeout: Optional. The amount of time, in seconds, to wait for the request to complete.
|
619
|
+
Note that if `retry` is specified, the timeout applies to each individual attempt.
|
620
|
+
:param metadata: Optional. Additional metadata that is provided to the method.
|
621
|
+
"""
|
622
|
+
client = self.get_dataplex_catalog_client()
|
623
|
+
return client.get_aspect_type(
|
624
|
+
request={
|
625
|
+
"name": client.aspect_type_path(project_id, location, aspect_type_id),
|
626
|
+
},
|
627
|
+
retry=retry,
|
628
|
+
timeout=timeout,
|
629
|
+
metadata=metadata,
|
630
|
+
)
|
631
|
+
|
632
|
+
@GoogleBaseHook.fallback_to_default_project_id
|
633
|
+
def create_entry_type(
|
634
|
+
self,
|
635
|
+
location: str,
|
636
|
+
entry_type_id: str,
|
637
|
+
entry_type_configuration: EntryType | dict,
|
638
|
+
project_id: str = PROVIDE_PROJECT_ID,
|
639
|
+
validate_only: bool = False,
|
640
|
+
retry: Retry | _MethodDefault = DEFAULT,
|
641
|
+
timeout: float | None = None,
|
642
|
+
metadata: Sequence[tuple[str, str]] = (),
|
643
|
+
) -> Operation:
|
644
|
+
"""
|
645
|
+
Create an EntryType resource.
|
646
|
+
|
647
|
+
:param location: Required. The ID of the Google Cloud location that the task belongs to.
|
648
|
+
:param entry_type_id: Required. EntryType identifier.
|
649
|
+
:param entry_type_configuration: Required. EntryType configuration body.
|
650
|
+
:param project_id: Optional. The ID of the Google Cloud project that the task belongs to.
|
651
|
+
:param validate_only: Optional. If set, performs request validation, but does not actually execute
|
652
|
+
the create request.
|
653
|
+
:param retry: Optional. A retry object used to retry requests. If `None` is specified, requests
|
654
|
+
will not be retried.
|
655
|
+
:param timeout: Optional. The amount of time, in seconds, to wait for the request to complete.
|
656
|
+
Note that if `retry` is specified, the timeout applies to each individual attempt.
|
657
|
+
:param metadata: Optional. Additional metadata that is provided to the method.
|
658
|
+
"""
|
659
|
+
client = self.get_dataplex_catalog_client()
|
660
|
+
return client.create_entry_type(
|
661
|
+
request={
|
662
|
+
"parent": client.common_location_path(project_id, location),
|
663
|
+
"entry_type_id": entry_type_id,
|
664
|
+
"entry_type": entry_type_configuration,
|
665
|
+
"validate_only": validate_only,
|
666
|
+
},
|
667
|
+
retry=retry,
|
668
|
+
timeout=timeout,
|
669
|
+
metadata=metadata,
|
670
|
+
)
|
671
|
+
|
672
|
+
@GoogleBaseHook.fallback_to_default_project_id
|
673
|
+
def get_entry_type(
|
674
|
+
self,
|
675
|
+
location: str,
|
676
|
+
entry_type_id: str,
|
677
|
+
project_id: str = PROVIDE_PROJECT_ID,
|
678
|
+
retry: Retry | _MethodDefault = DEFAULT,
|
679
|
+
timeout: float | None = None,
|
680
|
+
metadata: Sequence[tuple[str, str]] = (),
|
681
|
+
) -> EntryType:
|
682
|
+
"""
|
683
|
+
Get an EntryType resource.
|
684
|
+
|
685
|
+
:param location: Required. The ID of the Google Cloud location that the task belongs to.
|
686
|
+
:param entry_type_id: Required. EntryGroup identifier.
|
687
|
+
:param project_id: Optional. The ID of the Google Cloud project that the task belongs to.
|
688
|
+
:param retry: Optional. A retry object used to retry requests. If `None` is specified, requests
|
689
|
+
will not be retried.
|
690
|
+
:param timeout: Optional. The amount of time, in seconds, to wait for the request to complete.
|
691
|
+
Note that if `retry` is specified, the timeout applies to each individual attempt.
|
692
|
+
:param metadata: Optional. Additional metadata that is provided to the method.
|
693
|
+
"""
|
694
|
+
client = self.get_dataplex_catalog_client()
|
695
|
+
return client.get_entry_type(
|
696
|
+
request={
|
697
|
+
"name": client.entry_type_path(project_id, location, entry_type_id),
|
698
|
+
},
|
699
|
+
retry=retry,
|
700
|
+
timeout=timeout,
|
701
|
+
metadata=metadata,
|
702
|
+
)
|
703
|
+
|
704
|
+
@GoogleBaseHook.fallback_to_default_project_id
|
705
|
+
def delete_aspect_type(
|
706
|
+
self,
|
707
|
+
location: str,
|
708
|
+
aspect_type_id: str,
|
709
|
+
project_id: str = PROVIDE_PROJECT_ID,
|
710
|
+
retry: Retry | _MethodDefault = DEFAULT,
|
711
|
+
timeout: float | None = None,
|
712
|
+
metadata: Sequence[tuple[str, str]] = (),
|
713
|
+
) -> Operation:
|
714
|
+
"""
|
715
|
+
Delete an AspectType resource.
|
716
|
+
|
717
|
+
:param location: Required. The ID of the Google Cloud location that the task belongs to.
|
718
|
+
:param aspect_type_id: Required. AspectType identifier.
|
719
|
+
:param project_id: Optional. The ID of the Google Cloud project that the task belongs to.
|
720
|
+
:param retry: Optional. A retry object used to retry requests. If `None` is specified, requests
|
721
|
+
will not be retried.
|
722
|
+
:param timeout: Optional. The amount of time, in seconds, to wait for the request to complete.
|
723
|
+
Note that if `retry` is specified, the timeout applies to each individual attempt.
|
724
|
+
:param metadata: Optional. Additional metadata that is provided to the method.
|
725
|
+
"""
|
726
|
+
client = self.get_dataplex_catalog_client()
|
727
|
+
return client.delete_aspect_type(
|
728
|
+
request={
|
729
|
+
"name": client.aspect_type_path(project_id, location, aspect_type_id),
|
730
|
+
},
|
731
|
+
retry=retry,
|
732
|
+
timeout=timeout,
|
733
|
+
metadata=metadata,
|
734
|
+
)
|
735
|
+
|
736
|
+
@GoogleBaseHook.fallback_to_default_project_id
|
737
|
+
def list_aspect_types(
|
738
|
+
self,
|
739
|
+
location: str,
|
740
|
+
filter_by: str | None = None,
|
741
|
+
order_by: str | None = None,
|
742
|
+
page_size: int | None = None,
|
743
|
+
page_token: str | None = None,
|
744
|
+
project_id: str = PROVIDE_PROJECT_ID,
|
745
|
+
retry: Retry | _MethodDefault = DEFAULT,
|
746
|
+
timeout: float | None = None,
|
747
|
+
metadata: Sequence[tuple[str, str]] = (),
|
748
|
+
) -> ListAspectTypesPager:
|
749
|
+
"""
|
750
|
+
List AspectTypes resources from specific location.
|
751
|
+
|
752
|
+
:param location: Required. The ID of the Google Cloud location that the task belongs to.
|
753
|
+
:param filter_by: Optional. Filter to apply on the list results.
|
754
|
+
:param order_by: Optional. Fields to order the results by.
|
755
|
+
:param page_size: Optional. Maximum number of EntryGroups to return on one page.
|
756
|
+
:param page_token: Optional. Token to retrieve the next page of results.
|
757
|
+
:param project_id: Optional. The ID of the Google Cloud project that the task belongs to.
|
758
|
+
:param retry: Optional. A retry object used to retry requests. If `None` is specified, requests
|
759
|
+
will not be retried.
|
760
|
+
:param timeout: Optional. The amount of time, in seconds, to wait for the request to complete.
|
761
|
+
Note that if `retry` is specified, the timeout applies to each individual attempt.
|
762
|
+
:param metadata: Optional. Additional metadata that is provided to the method.
|
763
|
+
"""
|
764
|
+
client = self.get_dataplex_catalog_client()
|
765
|
+
return client.list_aspect_types(
|
766
|
+
request={
|
767
|
+
"parent": client.common_location_path(project_id, location),
|
768
|
+
"filter": filter_by,
|
769
|
+
"order_by": order_by,
|
770
|
+
"page_size": page_size,
|
771
|
+
"page_token": page_token,
|
772
|
+
},
|
773
|
+
retry=retry,
|
774
|
+
timeout=timeout,
|
775
|
+
metadata=metadata,
|
776
|
+
)
|
777
|
+
|
778
|
+
@GoogleBaseHook.fallback_to_default_project_id
|
779
|
+
def update_aspect_type(
|
780
|
+
self,
|
781
|
+
location: str,
|
782
|
+
aspect_type_id: str,
|
783
|
+
aspect_type_configuration: dict | AspectType,
|
784
|
+
project_id: str = PROVIDE_PROJECT_ID,
|
785
|
+
update_mask: list[str] | FieldMask | None = None,
|
786
|
+
validate_only: bool | None = False,
|
787
|
+
retry: Retry | _MethodDefault = DEFAULT,
|
788
|
+
timeout: float | None = None,
|
789
|
+
metadata: Sequence[tuple[str, str]] = (),
|
790
|
+
) -> Operation:
|
791
|
+
"""
|
792
|
+
Update an AspectType resource.
|
793
|
+
|
794
|
+
:param aspect_type_id: Required. ID of the AspectType to update.
|
795
|
+
:param aspect_type_configuration: Required. The updated configuration body of the AspectType.
|
796
|
+
:param location: Required. The ID of the Google Cloud location that the task belongs to.
|
797
|
+
:param update_mask: Optional. Names of fields whose values to overwrite on an entry group.
|
798
|
+
If this parameter is absent or empty, all modifiable fields are overwritten. If such
|
799
|
+
fields are non-required and omitted in the request body, their values are emptied.
|
800
|
+
:param project_id: Optional. The ID of the Google Cloud project that the task belongs to.
|
801
|
+
:param validate_only: Optional. The service validates the request without performing any mutations.
|
802
|
+
:param retry: Optional. A retry object used to retry requests. If `None` is specified, requests
|
803
|
+
will not be retried.
|
804
|
+
:param timeout: Optional. The amount of time, in seconds, to wait for the request to complete.
|
805
|
+
Note that if `retry` is specified, the timeout applies to each individual attempt.
|
806
|
+
:param metadata: Optional. Additional metadata that is provided to the method.
|
807
|
+
"""
|
808
|
+
client = self.get_dataplex_catalog_client()
|
809
|
+
_aspect_type = (
|
810
|
+
deepcopy(aspect_type_configuration)
|
811
|
+
if isinstance(aspect_type_configuration, dict)
|
812
|
+
else AspectType.to_dict(aspect_type_configuration)
|
813
|
+
)
|
814
|
+
_aspect_type["name"] = client.aspect_type_path(project_id, location, aspect_type_id)
|
815
|
+
return client.update_aspect_type(
|
816
|
+
request={
|
817
|
+
"aspect_type": _aspect_type,
|
818
|
+
"update_mask": FieldMask(paths=update_mask) if type(update_mask) is list else update_mask,
|
819
|
+
"validate_only": validate_only,
|
820
|
+
},
|
821
|
+
retry=retry,
|
822
|
+
timeout=timeout,
|
823
|
+
metadata=metadata,
|
824
|
+
)
|
825
|
+
|
826
|
+
@GoogleBaseHook.fallback_to_default_project_id
|
827
|
+
def delete_entry_type(
|
828
|
+
self,
|
829
|
+
location: str,
|
830
|
+
entry_type_id: str,
|
831
|
+
project_id: str = PROVIDE_PROJECT_ID,
|
832
|
+
retry: Retry | _MethodDefault = DEFAULT,
|
833
|
+
timeout: float | None = None,
|
834
|
+
metadata: Sequence[tuple[str, str]] = (),
|
835
|
+
) -> Operation:
|
836
|
+
"""
|
837
|
+
Delete an EntryType resource.
|
838
|
+
|
839
|
+
:param location: Required. The ID of the Google Cloud location that the task belongs to.
|
840
|
+
:param entry_type_id: Required. EntryType identifier.
|
841
|
+
:param project_id: Optional. The ID of the Google Cloud project that the task belongs to.
|
842
|
+
:param retry: Optional. A retry object used to retry requests. If `None` is specified, requests
|
843
|
+
will not be retried.
|
844
|
+
:param timeout: Optional. The amount of time, in seconds, to wait for the request to complete.
|
845
|
+
Note that if `retry` is specified, the timeout applies to each individual attempt.
|
846
|
+
:param metadata: Optional. Additional metadata that is provided to the method.
|
847
|
+
"""
|
848
|
+
client = self.get_dataplex_catalog_client()
|
849
|
+
return client.delete_entry_type(
|
850
|
+
request={
|
851
|
+
"name": client.entry_type_path(project_id, location, entry_type_id),
|
852
|
+
},
|
853
|
+
retry=retry,
|
854
|
+
timeout=timeout,
|
855
|
+
metadata=metadata,
|
856
|
+
)
|
857
|
+
|
858
|
+
@GoogleBaseHook.fallback_to_default_project_id
|
859
|
+
def list_entry_types(
|
860
|
+
self,
|
861
|
+
location: str,
|
862
|
+
filter_by: str | None = None,
|
863
|
+
order_by: str | None = None,
|
864
|
+
page_size: int | None = None,
|
865
|
+
page_token: str | None = None,
|
866
|
+
project_id: str = PROVIDE_PROJECT_ID,
|
867
|
+
retry: Retry | _MethodDefault = DEFAULT,
|
868
|
+
timeout: float | None = None,
|
869
|
+
metadata: Sequence[tuple[str, str]] = (),
|
870
|
+
) -> ListEntryTypesPager:
|
871
|
+
"""
|
872
|
+
List EntryTypes resources from specific location.
|
873
|
+
|
874
|
+
:param location: Required. The ID of the Google Cloud location that the task belongs to.
|
875
|
+
:param filter_by: Optional. Filter to apply on the list results.
|
876
|
+
:param order_by: Optional. Fields to order the results by.
|
877
|
+
:param page_size: Optional. Maximum number of EntryGroups to return on one page.
|
878
|
+
:param page_token: Optional. Token to retrieve the next page of results.
|
879
|
+
:param project_id: Optional. The ID of the Google Cloud project that the task belongs to.
|
880
|
+
:param retry: Optional. A retry object used to retry requests. If `None` is specified, requests
|
881
|
+
will not be retried.
|
882
|
+
:param timeout: Optional. The amount of time, in seconds, to wait for the request to complete.
|
883
|
+
Note that if `retry` is specified, the timeout applies to each individual attempt.
|
884
|
+
:param metadata: Optional. Additional metadata that is provided to the method.
|
885
|
+
"""
|
886
|
+
client = self.get_dataplex_catalog_client()
|
887
|
+
return client.list_entry_types(
|
888
|
+
request={
|
889
|
+
"parent": client.common_location_path(project_id, location),
|
890
|
+
"filter": filter_by,
|
891
|
+
"order_by": order_by,
|
892
|
+
"page_size": page_size,
|
893
|
+
"page_token": page_token,
|
894
|
+
},
|
895
|
+
retry=retry,
|
896
|
+
timeout=timeout,
|
897
|
+
metadata=metadata,
|
898
|
+
)
|
899
|
+
|
900
|
+
@GoogleBaseHook.fallback_to_default_project_id
|
901
|
+
def update_entry_type(
|
902
|
+
self,
|
903
|
+
location: str,
|
904
|
+
entry_type_id: str,
|
905
|
+
entry_type_configuration: dict | EntryType,
|
906
|
+
project_id: str = PROVIDE_PROJECT_ID,
|
907
|
+
update_mask: list[str] | FieldMask | None = None,
|
908
|
+
validate_only: bool | None = False,
|
909
|
+
retry: Retry | _MethodDefault = DEFAULT,
|
910
|
+
timeout: float | None = None,
|
911
|
+
metadata: Sequence[tuple[str, str]] = (),
|
912
|
+
) -> Operation:
|
913
|
+
"""
|
914
|
+
Update an EntryType resource.
|
915
|
+
|
916
|
+
:param entry_type_id: Required. ID of the EntryType to update.
|
917
|
+
:param entry_type_configuration: Required. The updated configuration body of the EntryType.
|
918
|
+
:param location: Required. The ID of the Google Cloud location that the task belongs to.
|
919
|
+
:param update_mask: Optional. Names of fields whose values to overwrite on an entry group.
|
920
|
+
If this parameter is absent or empty, all modifiable fields are overwritten. If such
|
921
|
+
fields are non-required and omitted in the request body, their values are emptied.
|
922
|
+
:param project_id: Optional. The ID of the Google Cloud project that the task belongs to.
|
923
|
+
:param validate_only: Optional. The service validates the request without performing any mutations.
|
924
|
+
:param retry: Optional. A retry object used to retry requests. If `None` is specified, requests
|
925
|
+
will not be retried.
|
926
|
+
:param timeout: Optional. The amount of time, in seconds, to wait for the request to complete.
|
927
|
+
Note that if `retry` is specified, the timeout applies to each individual attempt.
|
928
|
+
:param metadata: Optional. Additional metadata that is provided to the method.
|
929
|
+
"""
|
930
|
+
client = self.get_dataplex_catalog_client()
|
931
|
+
_entry_type = (
|
932
|
+
deepcopy(entry_type_configuration)
|
933
|
+
if isinstance(entry_type_configuration, dict)
|
934
|
+
else EntryType.to_dict(entry_type_configuration)
|
935
|
+
)
|
936
|
+
_entry_type["name"] = client.entry_type_path(project_id, location, entry_type_id)
|
937
|
+
return client.update_entry_type(
|
938
|
+
request={
|
939
|
+
"entry_type": _entry_type,
|
940
|
+
"update_mask": FieldMask(paths=update_mask) if type(update_mask) is list else update_mask,
|
941
|
+
"validate_only": validate_only,
|
942
|
+
},
|
943
|
+
retry=retry,
|
944
|
+
timeout=timeout,
|
945
|
+
metadata=metadata,
|
946
|
+
)
|
947
|
+
|
948
|
+
@GoogleBaseHook.fallback_to_default_project_id
|
949
|
+
def create_entry_group(
|
950
|
+
self,
|
951
|
+
location: str,
|
952
|
+
entry_group_id: str,
|
953
|
+
entry_group_configuration: EntryGroup | dict,
|
954
|
+
project_id: str = PROVIDE_PROJECT_ID,
|
955
|
+
validate_only: bool = False,
|
956
|
+
retry: Retry | _MethodDefault = DEFAULT,
|
957
|
+
timeout: float | None = None,
|
958
|
+
metadata: Sequence[tuple[str, str]] = (),
|
959
|
+
) -> Operation:
|
960
|
+
"""
|
961
|
+
Create an Entry resource.
|
962
|
+
|
963
|
+
:param location: Required. The ID of the Google Cloud location that the task belongs to.
|
964
|
+
:param entry_group_id: Required. EntryGroup identifier.
|
965
|
+
:param entry_group_configuration: Required. EntryGroup configuration body.
|
966
|
+
:param project_id: Optional. The ID of the Google Cloud project that the task belongs to.
|
967
|
+
:param validate_only: Optional. If set, performs request validation, but does not actually execute
|
968
|
+
the create request.
|
969
|
+
:param retry: Optional. A retry object used to retry requests. If `None` is specified, requests
|
970
|
+
will not be retried.
|
971
|
+
:param timeout: Optional. The amount of time, in seconds, to wait for the request to complete.
|
972
|
+
Note that if `retry` is specified, the timeout applies to each individual attempt.
|
973
|
+
:param metadata: Optional. Additional metadata that is provided to the method.
|
974
|
+
"""
|
975
|
+
client = self.get_dataplex_catalog_client()
|
976
|
+
return client.create_entry_group(
|
977
|
+
request={
|
978
|
+
"parent": client.common_location_path(project_id, location),
|
979
|
+
"entry_group_id": entry_group_id,
|
980
|
+
"entry_group": entry_group_configuration,
|
981
|
+
"validate_only": validate_only,
|
982
|
+
},
|
983
|
+
retry=retry,
|
984
|
+
timeout=timeout,
|
985
|
+
metadata=metadata,
|
986
|
+
)
|
987
|
+
|
988
|
+
@GoogleBaseHook.fallback_to_default_project_id
|
989
|
+
def get_entry_group(
|
990
|
+
self,
|
991
|
+
location: str,
|
992
|
+
entry_group_id: str,
|
993
|
+
project_id: str = PROVIDE_PROJECT_ID,
|
994
|
+
retry: Retry | _MethodDefault = DEFAULT,
|
995
|
+
timeout: float | None = None,
|
996
|
+
metadata: Sequence[tuple[str, str]] = (),
|
997
|
+
) -> EntryGroup:
|
998
|
+
"""
|
999
|
+
Get an EntryGroup resource.
|
1000
|
+
|
1001
|
+
:param location: Required. The ID of the Google Cloud location that the task belongs to.
|
1002
|
+
:param entry_group_id: Required. EntryGroup identifier.
|
1003
|
+
:param project_id: Optional. The ID of the Google Cloud project that the task belongs to.
|
1004
|
+
:param retry: Optional. A retry object used to retry requests. If `None` is specified, requests
|
1005
|
+
will not be retried.
|
1006
|
+
:param timeout: Optional. The amount of time, in seconds, to wait for the request to complete.
|
1007
|
+
Note that if `retry` is specified, the timeout applies to each individual attempt.
|
1008
|
+
:param metadata: Optional. Additional metadata that is provided to the method.
|
1009
|
+
"""
|
1010
|
+
client = self.get_dataplex_catalog_client()
|
1011
|
+
return client.get_entry_group(
|
1012
|
+
request={
|
1013
|
+
"name": client.entry_group_path(project_id, location, entry_group_id),
|
1014
|
+
},
|
1015
|
+
retry=retry,
|
1016
|
+
timeout=timeout,
|
1017
|
+
metadata=metadata,
|
1018
|
+
)
|
1019
|
+
|
1020
|
+
@GoogleBaseHook.fallback_to_default_project_id
|
1021
|
+
def delete_entry_group(
|
1022
|
+
self,
|
1023
|
+
location: str,
|
1024
|
+
entry_group_id: str,
|
1025
|
+
project_id: str = PROVIDE_PROJECT_ID,
|
1026
|
+
retry: Retry | _MethodDefault = DEFAULT,
|
1027
|
+
timeout: float | None = None,
|
1028
|
+
metadata: Sequence[tuple[str, str]] = (),
|
1029
|
+
) -> Operation:
|
1030
|
+
"""
|
1031
|
+
Delete an EntryGroup resource.
|
1032
|
+
|
1033
|
+
:param location: Required. The ID of the Google Cloud location that the task belongs to.
|
1034
|
+
:param entry_group_id: Required. EntryGroup identifier.
|
1035
|
+
:param project_id: Optional. The ID of the Google Cloud project that the task belongs to.
|
1036
|
+
:param retry: Optional. A retry object used to retry requests. If `None` is specified, requests
|
1037
|
+
will not be retried.
|
1038
|
+
:param timeout: Optional. The amount of time, in seconds, to wait for the request to complete.
|
1039
|
+
Note that if `retry` is specified, the timeout applies to each individual attempt.
|
1040
|
+
:param metadata: Optional. Additional metadata that is provided to the method.
|
1041
|
+
"""
|
1042
|
+
client = self.get_dataplex_catalog_client()
|
1043
|
+
return client.delete_entry_group(
|
1044
|
+
request={
|
1045
|
+
"name": client.entry_group_path(project_id, location, entry_group_id),
|
1046
|
+
},
|
1047
|
+
retry=retry,
|
1048
|
+
timeout=timeout,
|
1049
|
+
metadata=metadata,
|
1050
|
+
)
|
1051
|
+
|
1052
|
+
@GoogleBaseHook.fallback_to_default_project_id
|
1053
|
+
def list_entry_groups(
|
1054
|
+
self,
|
1055
|
+
location: str,
|
1056
|
+
filter_by: str | None = None,
|
1057
|
+
order_by: str | None = None,
|
1058
|
+
page_size: int | None = None,
|
1059
|
+
page_token: str | None = None,
|
1060
|
+
project_id: str = PROVIDE_PROJECT_ID,
|
1061
|
+
retry: Retry | _MethodDefault = DEFAULT,
|
1062
|
+
timeout: float | None = None,
|
1063
|
+
metadata: Sequence[tuple[str, str]] = (),
|
1064
|
+
) -> ListEntryGroupsPager:
|
1065
|
+
"""
|
1066
|
+
List EntryGroups resources from specific location.
|
1067
|
+
|
1068
|
+
:param location: Required. The ID of the Google Cloud location that the task belongs to.
|
1069
|
+
:param filter_by: Optional. Filter to apply on the list results.
|
1070
|
+
:param order_by: Optional. Fields to order the results by.
|
1071
|
+
:param page_size: Optional. Maximum number of EntryGroups to return on one page.
|
1072
|
+
:param page_token: Optional. Token to retrieve the next page of results.
|
1073
|
+
:param project_id: Optional. The ID of the Google Cloud project that the task belongs to.
|
1074
|
+
:param retry: Optional. A retry object used to retry requests. If `None` is specified, requests
|
1075
|
+
will not be retried.
|
1076
|
+
:param timeout: Optional. The amount of time, in seconds, to wait for the request to complete.
|
1077
|
+
Note that if `retry` is specified, the timeout applies to each individual attempt.
|
1078
|
+
:param metadata: Optional. Additional metadata that is provided to the method.
|
1079
|
+
"""
|
1080
|
+
client = self.get_dataplex_catalog_client()
|
1081
|
+
return client.list_entry_groups(
|
1082
|
+
request={
|
1083
|
+
"parent": client.common_location_path(project_id, location),
|
1084
|
+
"filter": filter_by,
|
1085
|
+
"order_by": order_by,
|
1086
|
+
"page_size": page_size,
|
1087
|
+
"page_token": page_token,
|
1088
|
+
},
|
1089
|
+
retry=retry,
|
1090
|
+
timeout=timeout,
|
1091
|
+
metadata=metadata,
|
1092
|
+
)
|
1093
|
+
|
1094
|
+
@GoogleBaseHook.fallback_to_default_project_id
|
1095
|
+
def update_entry_group(
|
1096
|
+
self,
|
1097
|
+
location: str,
|
1098
|
+
entry_group_id: str,
|
1099
|
+
entry_group_configuration: dict | EntryGroup,
|
1100
|
+
project_id: str = PROVIDE_PROJECT_ID,
|
1101
|
+
update_mask: list[str] | FieldMask | None = None,
|
1102
|
+
validate_only: bool | None = False,
|
1103
|
+
retry: Retry | _MethodDefault = DEFAULT,
|
1104
|
+
timeout: float | None = None,
|
1105
|
+
metadata: Sequence[tuple[str, str]] = (),
|
1106
|
+
) -> Operation:
|
1107
|
+
"""
|
1108
|
+
Update an EntryGroup resource.
|
1109
|
+
|
1110
|
+
:param entry_group_id: Required. ID of the EntryGroup to update.
|
1111
|
+
:param entry_group_configuration: Required. The updated configuration body of the EntryGroup.
|
1112
|
+
:param location: Required. The ID of the Google Cloud location that the task belongs to.
|
1113
|
+
:param update_mask: Optional. Names of fields whose values to overwrite on an entry group.
|
1114
|
+
If this parameter is absent or empty, all modifiable fields are overwritten. If such
|
1115
|
+
fields are non-required and omitted in the request body, their values are emptied.
|
1116
|
+
:param project_id: Optional. The ID of the Google Cloud project that the task belongs to.
|
1117
|
+
:param validate_only: Optional. The service validates the request without performing any mutations.
|
1118
|
+
:param retry: Optional. A retry object used to retry requests. If `None` is specified, requests
|
1119
|
+
will not be retried.
|
1120
|
+
:param timeout: Optional. The amount of time, in seconds, to wait for the request to complete.
|
1121
|
+
Note that if `retry` is specified, the timeout applies to each individual attempt.
|
1122
|
+
:param metadata: Optional. Additional metadata that is provided to the method.
|
1123
|
+
"""
|
1124
|
+
client = self.get_dataplex_catalog_client()
|
1125
|
+
_entry_group = (
|
1126
|
+
deepcopy(entry_group_configuration)
|
1127
|
+
if isinstance(entry_group_configuration, dict)
|
1128
|
+
else EntryGroup.to_dict(entry_group_configuration)
|
1129
|
+
)
|
1130
|
+
_entry_group["name"] = client.entry_group_path(project_id, location, entry_group_id)
|
1131
|
+
return client.update_entry_group(
|
1132
|
+
request={
|
1133
|
+
"entry_group": _entry_group,
|
1134
|
+
"update_mask": FieldMask(paths=update_mask) if type(update_mask) is list else update_mask,
|
1135
|
+
"validate_only": validate_only,
|
1136
|
+
},
|
1137
|
+
retry=retry,
|
1138
|
+
timeout=timeout,
|
1139
|
+
metadata=metadata,
|
1140
|
+
)
|
1141
|
+
|
121
1142
|
@GoogleBaseHook.fallback_to_default_project_id
|
122
1143
|
def create_task(
|
123
1144
|
self,
|