apache-airflow-providers-google 14.0.0rc1__py3-none-any.whl → 14.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/3rd-party-licenses/LICENSES.txt +14 -0
- airflow/providers/google/3rd-party-licenses/NOTICE +15 -0
- airflow/providers/google/__init__.py +1 -1
- airflow/providers/google/_vendor/__init__.py +0 -0
- airflow/providers/google/_vendor/json_merge_patch.py +91 -0
- airflow/providers/google/ads/hooks/ads.py +12 -11
- airflow/providers/google/cloud/_internal_client/secret_manager_client.py +3 -2
- airflow/providers/google/cloud/hooks/alloy_db.py +2 -3
- airflow/providers/google/cloud/hooks/automl.py +7 -13
- airflow/providers/google/cloud/hooks/bigquery.py +21 -22
- airflow/providers/google/cloud/hooks/bigquery_dts.py +8 -8
- airflow/providers/google/cloud/hooks/bigtable.py +3 -2
- airflow/providers/google/cloud/hooks/cloud_batch.py +4 -3
- airflow/providers/google/cloud/hooks/cloud_build.py +7 -13
- airflow/providers/google/cloud/hooks/cloud_composer.py +7 -12
- airflow/providers/google/cloud/hooks/cloud_memorystore.py +4 -3
- airflow/providers/google/cloud/hooks/cloud_run.py +4 -3
- airflow/providers/google/cloud/hooks/cloud_sql.py +1 -1
- airflow/providers/google/cloud/hooks/cloud_storage_transfer_service.py +8 -9
- airflow/providers/google/cloud/hooks/compute.py +3 -3
- airflow/providers/google/cloud/hooks/datacatalog.py +4 -3
- airflow/providers/google/cloud/hooks/dataflow.py +12 -12
- airflow/providers/google/cloud/hooks/dataform.py +3 -2
- airflow/providers/google/cloud/hooks/datafusion.py +2 -2
- airflow/providers/google/cloud/hooks/dataplex.py +11 -10
- airflow/providers/google/cloud/hooks/dataproc.py +5 -4
- airflow/providers/google/cloud/hooks/dataproc_metastore.py +4 -3
- airflow/providers/google/cloud/hooks/dlp.py +4 -3
- airflow/providers/google/cloud/hooks/gcs.py +19 -12
- airflow/providers/google/cloud/hooks/kms.py +3 -2
- airflow/providers/google/cloud/hooks/kubernetes_engine.py +20 -14
- airflow/providers/google/cloud/hooks/life_sciences.py +1 -1
- airflow/providers/google/cloud/hooks/managed_kafka.py +227 -3
- airflow/providers/google/cloud/hooks/natural_language.py +3 -2
- airflow/providers/google/cloud/hooks/os_login.py +3 -2
- airflow/providers/google/cloud/hooks/pubsub.py +6 -6
- airflow/providers/google/cloud/hooks/secret_manager.py +3 -2
- airflow/providers/google/cloud/hooks/spanner.py +2 -2
- airflow/providers/google/cloud/hooks/speech_to_text.py +3 -2
- airflow/providers/google/cloud/hooks/stackdriver.py +4 -4
- airflow/providers/google/cloud/hooks/tasks.py +4 -3
- airflow/providers/google/cloud/hooks/text_to_speech.py +3 -2
- airflow/providers/google/cloud/hooks/translate.py +6 -15
- airflow/providers/google/cloud/hooks/vertex_ai/auto_ml.py +6 -12
- airflow/providers/google/cloud/hooks/vertex_ai/batch_prediction_job.py +6 -12
- airflow/providers/google/cloud/hooks/vertex_ai/custom_job.py +7 -13
- airflow/providers/google/cloud/hooks/vertex_ai/dataset.py +5 -12
- airflow/providers/google/cloud/hooks/vertex_ai/endpoint_service.py +4 -11
- airflow/providers/google/cloud/hooks/vertex_ai/feature_store.py +4 -3
- airflow/providers/google/cloud/hooks/vertex_ai/hyperparameter_tuning_job.py +6 -12
- airflow/providers/google/cloud/hooks/vertex_ai/model_service.py +6 -11
- airflow/providers/google/cloud/hooks/vertex_ai/pipeline_job.py +6 -12
- airflow/providers/google/cloud/hooks/vertex_ai/prediction_service.py +3 -2
- airflow/providers/google/cloud/hooks/video_intelligence.py +3 -2
- airflow/providers/google/cloud/hooks/vision.py +4 -3
- airflow/providers/google/cloud/hooks/workflows.py +3 -2
- airflow/providers/google/cloud/links/base.py +7 -1
- airflow/providers/google/cloud/links/datafusion.py +8 -2
- airflow/providers/google/cloud/links/dataproc.py +8 -1
- airflow/providers/google/cloud/links/kubernetes_engine.py +2 -1
- airflow/providers/google/cloud/links/managed_kafka.py +30 -0
- airflow/providers/google/cloud/log/gcs_task_handler.py +15 -7
- airflow/providers/google/cloud/log/stackdriver_task_handler.py +8 -6
- airflow/providers/google/cloud/openlineage/utils.py +4 -2
- airflow/providers/google/cloud/operators/alloy_db.py +6 -5
- airflow/providers/google/cloud/operators/automl.py +11 -9
- airflow/providers/google/cloud/operators/bigquery.py +8 -6
- airflow/providers/google/cloud/operators/bigquery_dts.py +10 -8
- airflow/providers/google/cloud/operators/bigtable.py +3 -1
- airflow/providers/google/cloud/operators/cloud_base.py +2 -1
- airflow/providers/google/cloud/operators/cloud_batch.py +4 -2
- airflow/providers/google/cloud/operators/cloud_build.py +5 -3
- airflow/providers/google/cloud/operators/cloud_composer.py +7 -5
- airflow/providers/google/cloud/operators/cloud_memorystore.py +6 -4
- airflow/providers/google/cloud/operators/cloud_run.py +5 -3
- airflow/providers/google/cloud/operators/compute.py +5 -4
- airflow/providers/google/cloud/operators/datacatalog.py +11 -9
- airflow/providers/google/cloud/operators/dataform.py +5 -3
- airflow/providers/google/cloud/operators/datafusion.py +1 -1
- airflow/providers/google/cloud/operators/dataplex.py +20 -18
- airflow/providers/google/cloud/operators/dataproc.py +34 -5
- airflow/providers/google/cloud/operators/dataproc_metastore.py +18 -7
- airflow/providers/google/cloud/operators/dlp.py +19 -17
- airflow/providers/google/cloud/operators/gcs.py +5 -4
- airflow/providers/google/cloud/operators/kubernetes_engine.py +54 -5
- airflow/providers/google/cloud/operators/managed_kafka.py +271 -4
- airflow/providers/google/cloud/operators/natural_language.py +5 -3
- airflow/providers/google/cloud/operators/pubsub.py +10 -8
- airflow/providers/google/cloud/operators/speech_to_text.py +5 -3
- airflow/providers/google/cloud/operators/stackdriver.py +5 -3
- airflow/providers/google/cloud/operators/tasks.py +6 -4
- airflow/providers/google/cloud/operators/text_to_speech.py +4 -2
- airflow/providers/google/cloud/operators/translate.py +5 -3
- airflow/providers/google/cloud/operators/translate_speech.py +4 -2
- airflow/providers/google/cloud/operators/vertex_ai/auto_ml.py +8 -6
- airflow/providers/google/cloud/operators/vertex_ai/batch_prediction_job.py +6 -4
- airflow/providers/google/cloud/operators/vertex_ai/custom_job.py +8 -6
- airflow/providers/google/cloud/operators/vertex_ai/dataset.py +6 -4
- airflow/providers/google/cloud/operators/vertex_ai/endpoint_service.py +6 -4
- airflow/providers/google/cloud/operators/vertex_ai/hyperparameter_tuning_job.py +6 -4
- airflow/providers/google/cloud/operators/vertex_ai/model_service.py +6 -4
- airflow/providers/google/cloud/operators/vertex_ai/pipeline_job.py +6 -4
- airflow/providers/google/cloud/operators/video_intelligence.py +5 -3
- airflow/providers/google/cloud/operators/vision.py +6 -4
- airflow/providers/google/cloud/operators/workflows.py +7 -5
- airflow/providers/google/cloud/secrets/secret_manager.py +2 -1
- airflow/providers/google/cloud/sensors/bigquery_dts.py +5 -3
- airflow/providers/google/cloud/sensors/bigtable.py +3 -2
- airflow/providers/google/cloud/sensors/cloud_composer.py +1 -1
- airflow/providers/google/cloud/sensors/dataplex.py +6 -4
- airflow/providers/google/cloud/sensors/dataproc.py +3 -2
- airflow/providers/google/cloud/sensors/dataproc_metastore.py +2 -1
- airflow/providers/google/cloud/sensors/gcs.py +4 -2
- airflow/providers/google/cloud/sensors/pubsub.py +3 -2
- airflow/providers/google/cloud/sensors/workflows.py +5 -3
- airflow/providers/google/cloud/transfers/bigquery_to_gcs.py +5 -3
- airflow/providers/google/cloud/transfers/gcs_to_bigquery.py +12 -10
- airflow/providers/google/cloud/triggers/bigquery_dts.py +2 -1
- airflow/providers/google/cloud/triggers/cloud_batch.py +2 -1
- airflow/providers/google/cloud/triggers/cloud_build.py +2 -1
- airflow/providers/google/cloud/triggers/cloud_composer.py +1 -1
- airflow/providers/google/cloud/triggers/cloud_storage_transfer_service.py +3 -2
- airflow/providers/google/cloud/triggers/dataflow.py +3 -2
- airflow/providers/google/cloud/triggers/dataplex.py +2 -1
- airflow/providers/google/cloud/triggers/dataproc.py +3 -2
- airflow/providers/google/cloud/triggers/kubernetes_engine.py +1 -1
- airflow/providers/google/cloud/triggers/pubsub.py +2 -1
- airflow/providers/google/cloud/triggers/vertex_ai.py +8 -7
- airflow/providers/google/cloud/utils/credentials_provider.py +4 -3
- airflow/providers/google/cloud/utils/external_token_supplier.py +0 -1
- airflow/providers/google/cloud/{example_dags/__init__.py → utils/validators.py} +27 -0
- airflow/providers/google/common/auth_backend/google_openid.py +14 -5
- airflow/providers/google/common/consts.py +2 -1
- airflow/providers/google/common/hooks/base_google.py +7 -8
- airflow/providers/google/common/hooks/operation_helpers.py +79 -0
- airflow/providers/google/get_provider_info.py +11 -6
- airflow/providers/google/marketing_platform/hooks/analytics_admin.py +3 -2
- airflow/providers/google/marketing_platform/hooks/search_ads.py +1 -1
- airflow/providers/google/marketing_platform/links/analytics_admin.py +10 -2
- airflow/providers/google/marketing_platform/operators/analytics_admin.py +7 -5
- {apache_airflow_providers_google-14.0.0rc1.dist-info → apache_airflow_providers_google-14.1.0rc1.dist-info}/METADATA +32 -35
- {apache_airflow_providers_google-14.0.0rc1.dist-info → apache_airflow_providers_google-14.1.0rc1.dist-info}/RECORD +144 -140
- {apache_airflow_providers_google-14.0.0rc1.dist-info → apache_airflow_providers_google-14.1.0rc1.dist-info}/WHEEL +1 -1
- airflow/providers/google/cloud/example_dags/example_cloud_task.py +0 -54
- {apache_airflow_providers_google-14.0.0rc1.dist-info → apache_airflow_providers_google-14.1.0rc1.dist-info}/entry_points.txt +0 -0
@@ -23,34 +23,19 @@ from collections.abc import MutableSequence, Sequence
|
|
23
23
|
from functools import cached_property
|
24
24
|
from typing import TYPE_CHECKING, Any
|
25
25
|
|
26
|
+
from google.protobuf.json_format import MessageToDict
|
27
|
+
|
26
28
|
from airflow.exceptions import AirflowException
|
27
29
|
from airflow.providers.google.cloud.triggers.dataplex import (
|
28
30
|
DataplexDataProfileJobTrigger,
|
29
31
|
DataplexDataQualityJobTrigger,
|
30
32
|
)
|
31
|
-
from google.protobuf.json_format import MessageToDict
|
32
33
|
|
33
34
|
if TYPE_CHECKING:
|
34
|
-
from airflow.utils.context import Context
|
35
35
|
from google.protobuf.field_mask_pb2 import FieldMask
|
36
36
|
|
37
|
-
from
|
37
|
+
from airflow.utils.context import Context
|
38
38
|
|
39
|
-
from airflow.configuration import conf
|
40
|
-
from airflow.providers.google.cloud.hooks.dataplex import AirflowDataQualityScanException, DataplexHook
|
41
|
-
from airflow.providers.google.cloud.links.dataplex import (
|
42
|
-
DataplexCatalogAspectTypeLink,
|
43
|
-
DataplexCatalogAspectTypesLink,
|
44
|
-
DataplexCatalogEntryGroupLink,
|
45
|
-
DataplexCatalogEntryGroupsLink,
|
46
|
-
DataplexCatalogEntryLink,
|
47
|
-
DataplexCatalogEntryTypeLink,
|
48
|
-
DataplexCatalogEntryTypesLink,
|
49
|
-
DataplexLakeLink,
|
50
|
-
DataplexTaskLink,
|
51
|
-
DataplexTasksLink,
|
52
|
-
)
|
53
|
-
from airflow.providers.google.cloud.operators.cloud_base import GoogleCloudBaseOperator
|
54
39
|
from google.api_core.exceptions import AlreadyExists, GoogleAPICallError, NotFound
|
55
40
|
from google.api_core.gapic_v1.method import DEFAULT, _MethodDefault
|
56
41
|
from google.api_core.retry import Retry, exponential_sleep_generator
|
@@ -72,6 +57,23 @@ from google.cloud.dataplex_v1.types import (
|
|
72
57
|
Task,
|
73
58
|
Zone,
|
74
59
|
)
|
60
|
+
from googleapiclient.errors import HttpError
|
61
|
+
|
62
|
+
from airflow.configuration import conf
|
63
|
+
from airflow.providers.google.cloud.hooks.dataplex import AirflowDataQualityScanException, DataplexHook
|
64
|
+
from airflow.providers.google.cloud.links.dataplex import (
|
65
|
+
DataplexCatalogAspectTypeLink,
|
66
|
+
DataplexCatalogAspectTypesLink,
|
67
|
+
DataplexCatalogEntryGroupLink,
|
68
|
+
DataplexCatalogEntryGroupsLink,
|
69
|
+
DataplexCatalogEntryLink,
|
70
|
+
DataplexCatalogEntryTypeLink,
|
71
|
+
DataplexCatalogEntryTypesLink,
|
72
|
+
DataplexLakeLink,
|
73
|
+
DataplexTaskLink,
|
74
|
+
DataplexTasksLink,
|
75
|
+
)
|
76
|
+
from airflow.providers.google.cloud.operators.cloud_base import GoogleCloudBaseOperator
|
75
77
|
|
76
78
|
|
77
79
|
class DataplexCreateTaskOperator(GoogleCloudBaseOperator):
|
@@ -30,6 +30,11 @@ from enum import Enum
|
|
30
30
|
from functools import cached_property
|
31
31
|
from typing import TYPE_CHECKING, Any
|
32
32
|
|
33
|
+
from google.api_core.exceptions import AlreadyExists, NotFound
|
34
|
+
from google.api_core.gapic_v1.method import DEFAULT, _MethodDefault
|
35
|
+
from google.api_core.retry import Retry, exponential_sleep_generator
|
36
|
+
from google.cloud.dataproc_v1 import Batch, Cluster, ClusterStatus, JobStatus
|
37
|
+
|
33
38
|
from airflow.configuration import conf
|
34
39
|
from airflow.exceptions import AirflowException, AirflowProviderDeprecationWarning
|
35
40
|
from airflow.providers.google.cloud.hooks.dataproc import (
|
@@ -61,19 +66,16 @@ from airflow.providers.google.cloud.utils.dataproc import DataprocOperationType
|
|
61
66
|
from airflow.providers.google.common.deprecated import deprecated
|
62
67
|
from airflow.providers.google.common.hooks.base_google import PROVIDE_PROJECT_ID
|
63
68
|
from airflow.utils import timezone
|
64
|
-
from google.api_core.exceptions import AlreadyExists, NotFound
|
65
|
-
from google.api_core.gapic_v1.method import DEFAULT, _MethodDefault
|
66
|
-
from google.api_core.retry import Retry, exponential_sleep_generator
|
67
|
-
from google.cloud.dataproc_v1 import Batch, Cluster, ClusterStatus, JobStatus
|
68
69
|
|
69
70
|
if TYPE_CHECKING:
|
70
|
-
from airflow.utils.context import Context
|
71
71
|
from google.api_core import operation
|
72
72
|
from google.api_core.retry_async import AsyncRetry
|
73
73
|
from google.protobuf.duration_pb2 import Duration
|
74
74
|
from google.protobuf.field_mask_pb2 import FieldMask
|
75
75
|
from google.type.interval_pb2 import Interval
|
76
76
|
|
77
|
+
from airflow.utils.context import Context
|
78
|
+
|
77
79
|
|
78
80
|
class PreemptibilityType(Enum):
|
79
81
|
"""Contains possible Type values of Preemptibility applicable for every secondary worker of Cluster."""
|
@@ -2528,6 +2530,8 @@ class DataprocCreateBatchOperator(GoogleCloudBaseOperator):
|
|
2528
2530
|
self.log.info("Automatic injection of OpenLineage information into Spark properties is enabled.")
|
2529
2531
|
self._inject_openlineage_properties_into_dataproc_batch(context)
|
2530
2532
|
|
2533
|
+
self.__update_batch_labels()
|
2534
|
+
|
2531
2535
|
try:
|
2532
2536
|
self.operation = self.hook.create_batch(
|
2533
2537
|
region=self.region,
|
@@ -2708,6 +2712,31 @@ class DataprocCreateBatchOperator(GoogleCloudBaseOperator):
|
|
2708
2712
|
exc_info=e,
|
2709
2713
|
)
|
2710
2714
|
|
2715
|
+
def __update_batch_labels(self):
|
2716
|
+
dag_id = re.sub(r"[.\s]", "_", self.dag_id.lower())
|
2717
|
+
task_id = re.sub(r"[.\s]", "_", self.task_id.lower())
|
2718
|
+
|
2719
|
+
labels_regex = re.compile(r"^[a-z][\w-]{0,63}$")
|
2720
|
+
if not labels_regex.match(dag_id) or not labels_regex.match(task_id):
|
2721
|
+
return
|
2722
|
+
|
2723
|
+
labels_limit = 32
|
2724
|
+
new_labels = {"airflow-dag-id": dag_id, "airflow-task-id": task_id}
|
2725
|
+
|
2726
|
+
if self._dag:
|
2727
|
+
dag_display_name = re.sub(r"[.\s]", "_", self._dag.dag_display_name.lower())
|
2728
|
+
if labels_regex.match(dag_id):
|
2729
|
+
new_labels["airflow-dag-display-name"] = dag_display_name
|
2730
|
+
|
2731
|
+
if isinstance(self.batch, Batch):
|
2732
|
+
if len(self.batch.labels) + len(new_labels) <= labels_limit:
|
2733
|
+
self.batch.labels.update(new_labels)
|
2734
|
+
elif "labels" not in self.batch:
|
2735
|
+
self.batch["labels"] = new_labels
|
2736
|
+
elif isinstance(self.batch.get("labels"), dict):
|
2737
|
+
if len(self.batch["labels"]) + len(new_labels) <= labels_limit:
|
2738
|
+
self.batch["labels"].update(new_labels)
|
2739
|
+
|
2711
2740
|
|
2712
2741
|
class DataprocDeleteBatchOperator(GoogleCloudBaseOperator):
|
2713
2742
|
"""
|
@@ -23,12 +23,6 @@ import time
|
|
23
23
|
from collections.abc import Sequence
|
24
24
|
from typing import TYPE_CHECKING
|
25
25
|
|
26
|
-
from airflow.exceptions import AirflowException
|
27
|
-
from airflow.models import BaseOperator, BaseOperatorLink
|
28
|
-
from airflow.models.xcom import XCom
|
29
|
-
from airflow.providers.google.cloud.hooks.dataproc_metastore import DataprocMetastoreHook
|
30
|
-
from airflow.providers.google.cloud.operators.cloud_base import GoogleCloudBaseOperator
|
31
|
-
from airflow.providers.google.common.links.storage import StorageLink
|
32
26
|
from google.api_core.exceptions import AlreadyExists
|
33
27
|
from google.api_core.gapic_v1.method import DEFAULT, _MethodDefault
|
34
28
|
from google.api_core.retry import Retry, exponential_sleep_generator
|
@@ -36,10 +30,27 @@ from google.cloud.metastore_v1 import MetadataExport, MetadataManagementActivity
|
|
36
30
|
from google.cloud.metastore_v1.types import Backup, MetadataImport, Service
|
37
31
|
from google.cloud.metastore_v1.types.metastore import DatabaseDumpSpec, Restore
|
38
32
|
|
33
|
+
from airflow.exceptions import AirflowException
|
34
|
+
from airflow.models import BaseOperator, BaseOperatorLink
|
35
|
+
from airflow.providers.google.cloud.hooks.dataproc_metastore import DataprocMetastoreHook
|
36
|
+
from airflow.providers.google.cloud.operators.cloud_base import GoogleCloudBaseOperator
|
37
|
+
from airflow.providers.google.common.links.storage import StorageLink
|
38
|
+
|
39
39
|
if TYPE_CHECKING:
|
40
|
+
from google.protobuf.field_mask_pb2 import FieldMask
|
41
|
+
|
42
|
+
from airflow.models import BaseOperator
|
40
43
|
from airflow.models.taskinstancekey import TaskInstanceKey
|
41
44
|
from airflow.utils.context import Context
|
42
|
-
|
45
|
+
|
46
|
+
from airflow.providers.google.version_compat import AIRFLOW_V_3_0_PLUS
|
47
|
+
|
48
|
+
if AIRFLOW_V_3_0_PLUS:
|
49
|
+
from airflow.sdk import BaseOperatorLink
|
50
|
+
from airflow.sdk.execution_time.xcom import XCom
|
51
|
+
else:
|
52
|
+
from airflow.models import XCom # type: ignore[no-redef]
|
53
|
+
from airflow.models.baseoperatorlink import BaseOperatorLink # type: ignore[no-redef]
|
43
54
|
|
44
55
|
|
45
56
|
BASE_LINK = "https://console.cloud.google.com"
|
@@ -22,22 +22,6 @@ from __future__ import annotations
|
|
22
22
|
from collections.abc import Sequence
|
23
23
|
from typing import TYPE_CHECKING
|
24
24
|
|
25
|
-
from airflow.providers.google.cloud.hooks.dlp import CloudDLPHook
|
26
|
-
from airflow.providers.google.cloud.links.data_loss_prevention import (
|
27
|
-
CloudDLPDeidentifyTemplateDetailsLink,
|
28
|
-
CloudDLPDeidentifyTemplatesListLink,
|
29
|
-
CloudDLPInfoTypeDetailsLink,
|
30
|
-
CloudDLPInfoTypesListLink,
|
31
|
-
CloudDLPInspectTemplateDetailsLink,
|
32
|
-
CloudDLPInspectTemplatesListLink,
|
33
|
-
CloudDLPJobDetailsLink,
|
34
|
-
CloudDLPJobsListLink,
|
35
|
-
CloudDLPJobTriggerDetailsLink,
|
36
|
-
CloudDLPJobTriggersListLink,
|
37
|
-
CloudDLPPossibleInfoTypesListLink,
|
38
|
-
)
|
39
|
-
from airflow.providers.google.cloud.operators.cloud_base import GoogleCloudBaseOperator
|
40
|
-
from airflow.providers.google.common.hooks.base_google import PROVIDE_PROJECT_ID
|
41
25
|
from google.api_core.exceptions import AlreadyExists, InvalidArgument, NotFound
|
42
26
|
from google.api_core.gapic_v1.method import DEFAULT, _MethodDefault
|
43
27
|
from google.cloud.dlp_v2.types import (
|
@@ -61,11 +45,29 @@ from google.cloud.dlp_v2.types import (
|
|
61
45
|
StoredInfoTypeConfig,
|
62
46
|
)
|
63
47
|
|
48
|
+
from airflow.providers.google.cloud.hooks.dlp import CloudDLPHook
|
49
|
+
from airflow.providers.google.cloud.links.data_loss_prevention import (
|
50
|
+
CloudDLPDeidentifyTemplateDetailsLink,
|
51
|
+
CloudDLPDeidentifyTemplatesListLink,
|
52
|
+
CloudDLPInfoTypeDetailsLink,
|
53
|
+
CloudDLPInfoTypesListLink,
|
54
|
+
CloudDLPInspectTemplateDetailsLink,
|
55
|
+
CloudDLPInspectTemplatesListLink,
|
56
|
+
CloudDLPJobDetailsLink,
|
57
|
+
CloudDLPJobsListLink,
|
58
|
+
CloudDLPJobTriggerDetailsLink,
|
59
|
+
CloudDLPJobTriggersListLink,
|
60
|
+
CloudDLPPossibleInfoTypesListLink,
|
61
|
+
)
|
62
|
+
from airflow.providers.google.cloud.operators.cloud_base import GoogleCloudBaseOperator
|
63
|
+
from airflow.providers.google.common.hooks.base_google import PROVIDE_PROJECT_ID
|
64
|
+
|
64
65
|
if TYPE_CHECKING:
|
65
|
-
from airflow.utils.context import Context
|
66
66
|
from google.api_core.retry import Retry
|
67
67
|
from google.protobuf.field_mask_pb2 import FieldMask
|
68
68
|
|
69
|
+
from airflow.utils.context import Context
|
70
|
+
|
69
71
|
|
70
72
|
class CloudDLPCancelDLPJobOperator(GoogleCloudBaseOperator):
|
71
73
|
"""
|
@@ -35,13 +35,14 @@ from airflow.providers.google.common.hooks.base_google import PROVIDE_PROJECT_ID
|
|
35
35
|
if TYPE_CHECKING:
|
36
36
|
from airflow.utils.context import Context
|
37
37
|
|
38
|
+
from google.api_core.exceptions import Conflict
|
39
|
+
from google.cloud.exceptions import GoogleCloudError
|
40
|
+
|
38
41
|
from airflow.exceptions import AirflowException, AirflowProviderDeprecationWarning
|
39
42
|
from airflow.providers.google.cloud.hooks.gcs import GCSHook
|
40
43
|
from airflow.providers.google.cloud.operators.cloud_base import GoogleCloudBaseOperator
|
41
44
|
from airflow.providers.google.common.links.storage import FileDetailsLink, StorageLink
|
42
45
|
from airflow.utils import timezone
|
43
|
-
from google.api_core.exceptions import Conflict
|
44
|
-
from google.cloud.exceptions import GoogleCloudError
|
45
46
|
|
46
47
|
|
47
48
|
class GCSCreateBucketOperator(GoogleCloudBaseOperator):
|
@@ -184,7 +185,7 @@ class GCSListObjectsOperator(GoogleCloudBaseOperator):
|
|
184
185
|
Service Account Token Creator IAM role to the directly preceding identity, with first
|
185
186
|
account from the list granting this role to the originating account (templated).
|
186
187
|
:param match_glob: (Optional) filters objects based on the glob pattern given by the string
|
187
|
-
(e.g, ``'
|
188
|
+
(e.g, ``'**/*.json'``)
|
188
189
|
|
189
190
|
**Example**:
|
190
191
|
The following Operator would list all the Avro files from ``sales/sales-2017``
|
@@ -194,7 +195,7 @@ class GCSListObjectsOperator(GoogleCloudBaseOperator):
|
|
194
195
|
task_id="GCS_Files",
|
195
196
|
bucket="data",
|
196
197
|
prefix="sales/sales-2017/",
|
197
|
-
match_glob="
|
198
|
+
match_glob="**/*.avro",
|
198
199
|
gcp_conn_id=google_cloud_conn_id,
|
199
200
|
)
|
200
201
|
"""
|
@@ -24,6 +24,7 @@ from collections.abc import Sequence
|
|
24
24
|
from functools import cached_property
|
25
25
|
from typing import TYPE_CHECKING, Any
|
26
26
|
|
27
|
+
from google.api_core.exceptions import AlreadyExists
|
27
28
|
from kubernetes.client import V1JobList, models as k8s
|
28
29
|
from packaging.version import parse as parse_version
|
29
30
|
|
@@ -60,7 +61,6 @@ from airflow.providers.google.common.deprecated import deprecated
|
|
60
61
|
from airflow.providers.google.common.hooks.base_google import PROVIDE_PROJECT_ID
|
61
62
|
from airflow.providers_manager import ProvidersManager
|
62
63
|
from airflow.utils.timezone import utcnow
|
63
|
-
from google.api_core.exceptions import AlreadyExists
|
64
64
|
|
65
65
|
try:
|
66
66
|
from airflow.providers.cncf.kubernetes.operators.job import KubernetesDeleteJobOperator
|
@@ -73,11 +73,11 @@ except ImportError:
|
|
73
73
|
)
|
74
74
|
|
75
75
|
if TYPE_CHECKING:
|
76
|
+
from google.cloud.container_v1.types import Cluster
|
76
77
|
from kubernetes.client.models import V1Job
|
77
78
|
from pendulum import DateTime
|
78
79
|
|
79
80
|
from airflow.utils.context import Context
|
80
|
-
from google.cloud.container_v1.types import Cluster
|
81
81
|
|
82
82
|
KUBE_CONFIG_ENV_VAR = "KUBECONFIG"
|
83
83
|
|
@@ -89,6 +89,7 @@ class GKEClusterAuthDetails:
|
|
89
89
|
:param cluster_name: The name of the Google Kubernetes Engine cluster.
|
90
90
|
:param project_id: The Google Developers Console project id.
|
91
91
|
:param use_internal_ip: Use the internal IP address as the endpoint.
|
92
|
+
:param use_dns_endpoint: Use the DNS address as the endpoint.
|
92
93
|
:param cluster_hook: airflow hook for working with kubernetes cluster.
|
93
94
|
"""
|
94
95
|
|
@@ -97,11 +98,13 @@ class GKEClusterAuthDetails:
|
|
97
98
|
cluster_name: str,
|
98
99
|
project_id: str,
|
99
100
|
use_internal_ip: bool,
|
101
|
+
use_dns_endpoint: bool,
|
100
102
|
cluster_hook: GKEHook,
|
101
103
|
):
|
102
104
|
self.cluster_name = cluster_name
|
103
105
|
self.project_id = project_id
|
104
106
|
self.use_internal_ip = use_internal_ip
|
107
|
+
self.use_dns_endpoint = use_dns_endpoint
|
105
108
|
self.cluster_hook = cluster_hook
|
106
109
|
self._cluster_url: str
|
107
110
|
self._ssl_ca_cert: str
|
@@ -113,10 +116,14 @@ class GKEClusterAuthDetails:
|
|
113
116
|
project_id=self.project_id,
|
114
117
|
)
|
115
118
|
|
116
|
-
if
|
117
|
-
self._cluster_url =
|
118
|
-
|
119
|
+
if self.use_dns_endpoint:
|
120
|
+
self._cluster_url = (
|
121
|
+
f"https://{cluster.control_plane_endpoints_config.dns_endpoint_config.endpoint}"
|
122
|
+
)
|
123
|
+
elif self.use_internal_ip:
|
119
124
|
self._cluster_url = f"https://{cluster.private_cluster_config.private_endpoint}"
|
125
|
+
else:
|
126
|
+
self._cluster_url = f"https://{cluster.endpoint}"
|
120
127
|
self._ssl_ca_cert = cluster.master_auth.cluster_ca_certificate
|
121
128
|
return self._cluster_url, self._ssl_ca_cert
|
122
129
|
|
@@ -130,6 +137,7 @@ class GKEOperatorMixin:
|
|
130
137
|
"location",
|
131
138
|
"cluster_name",
|
132
139
|
"use_internal_ip",
|
140
|
+
"use_dns_endpoint",
|
133
141
|
"project_id",
|
134
142
|
"gcp_conn_id",
|
135
143
|
"impersonation_chain",
|
@@ -151,6 +159,7 @@ class GKEOperatorMixin:
|
|
151
159
|
cluster_url=self.cluster_url,
|
152
160
|
ssl_ca_cert=self.ssl_ca_cert,
|
153
161
|
enable_tcp_keepalive=self.enable_tcp_keepalive,
|
162
|
+
use_dns_endpoint=self.use_dns_endpoint, # type: ignore[attr-defined]
|
154
163
|
)
|
155
164
|
|
156
165
|
@cached_property
|
@@ -160,6 +169,7 @@ class GKEOperatorMixin:
|
|
160
169
|
cluster_name=self.cluster_name, # type: ignore[attr-defined]
|
161
170
|
project_id=self.project_id, # type: ignore[attr-defined]
|
162
171
|
use_internal_ip=self.use_internal_ip, # type: ignore[attr-defined]
|
172
|
+
use_dns_endpoint=self.use_dns_endpoint, # type: ignore[attr-defined]
|
163
173
|
cluster_hook=self.cluster_hook,
|
164
174
|
)
|
165
175
|
return auth_details.fetch_cluster_info()
|
@@ -200,6 +210,7 @@ class GKEDeleteClusterOperator(GKEOperatorMixin, GoogleCloudBaseOperator):
|
|
200
210
|
cluster resides, e.g. 'us-central1-a'
|
201
211
|
:param cluster_name: The name of the Google Kubernetes Engine cluster.
|
202
212
|
:param use_internal_ip: Use the internal IP address as the endpoint.
|
213
|
+
:param use_dns_endpoint: Use the DNS address as the endpoint.
|
203
214
|
:param project_id: The Google Developers Console project id
|
204
215
|
:param gcp_conn_id: The Google cloud connection id to use. This allows for
|
205
216
|
users to specify a service account.
|
@@ -225,6 +236,7 @@ class GKEDeleteClusterOperator(GKEOperatorMixin, GoogleCloudBaseOperator):
|
|
225
236
|
self,
|
226
237
|
location: str,
|
227
238
|
use_internal_ip: bool = False,
|
239
|
+
use_dns_endpoint: bool = False,
|
228
240
|
project_id: str = PROVIDE_PROJECT_ID,
|
229
241
|
gcp_conn_id: str = "google_cloud_default",
|
230
242
|
impersonation_chain: str | Sequence[str] | None = None,
|
@@ -241,6 +253,7 @@ class GKEDeleteClusterOperator(GKEOperatorMixin, GoogleCloudBaseOperator):
|
|
241
253
|
self.location = location
|
242
254
|
self.cluster_name = cluster_name or name
|
243
255
|
self.use_internal_ip = use_internal_ip
|
256
|
+
self.use_dns_endpoint = use_dns_endpoint
|
244
257
|
self.project_id = project_id
|
245
258
|
self.gcp_conn_id = gcp_conn_id
|
246
259
|
self.impersonation_chain = impersonation_chain
|
@@ -347,6 +360,7 @@ class GKECreateClusterOperator(GKEOperatorMixin, GoogleCloudBaseOperator):
|
|
347
360
|
:param location: The name of the Google Kubernetes Engine zone or region in which the
|
348
361
|
cluster resides, e.g. 'us-central1-a'
|
349
362
|
:param use_internal_ip: Use the internal IP address as the endpoint.
|
363
|
+
:param use_dns_endpoint: Use the DNS address as the endpoint.
|
350
364
|
:param project_id: The Google Developers Console project id
|
351
365
|
:param gcp_conn_id: The Google cloud connection id to use. This allows for
|
352
366
|
users to specify a service account.
|
@@ -375,6 +389,7 @@ class GKECreateClusterOperator(GKEOperatorMixin, GoogleCloudBaseOperator):
|
|
375
389
|
body: dict | Cluster,
|
376
390
|
location: str,
|
377
391
|
use_internal_ip: bool = False,
|
392
|
+
use_dns_endpoint: bool = False,
|
378
393
|
project_id: str = PROVIDE_PROJECT_ID,
|
379
394
|
gcp_conn_id: str = "google_cloud_default",
|
380
395
|
impersonation_chain: str | Sequence[str] | None = None,
|
@@ -387,6 +402,7 @@ class GKECreateClusterOperator(GKEOperatorMixin, GoogleCloudBaseOperator):
|
|
387
402
|
self.body = body
|
388
403
|
self.location = location
|
389
404
|
self.use_internal_ip = use_internal_ip
|
405
|
+
self.use_dns_endpoint = use_dns_endpoint
|
390
406
|
self.cluster_name = body.get("name") if isinstance(body, dict) else getattr(body, "name", None)
|
391
407
|
self.project_id = project_id
|
392
408
|
self.gcp_conn_id = gcp_conn_id
|
@@ -519,6 +535,7 @@ class GKEStartKueueInsideClusterOperator(GKEOperatorMixin, KubernetesInstallKueu
|
|
519
535
|
cluster resides, e.g. 'us-central1-a'
|
520
536
|
:param cluster_name: The name of the Google Kubernetes Engine cluster.
|
521
537
|
:param use_internal_ip: Use the internal IP address as the endpoint.
|
538
|
+
:param use_dns_endpoint: Use the DNS address as the endpoint.
|
522
539
|
:param project_id: The Google Developers Console project id
|
523
540
|
:param gcp_conn_id: The Google cloud connection id to use. This allows for
|
524
541
|
users to specify a service account.
|
@@ -543,6 +560,7 @@ class GKEStartKueueInsideClusterOperator(GKEOperatorMixin, KubernetesInstallKueu
|
|
543
560
|
location: str,
|
544
561
|
cluster_name: str,
|
545
562
|
use_internal_ip: bool = False,
|
563
|
+
use_dns_endpoint: bool = False,
|
546
564
|
project_id: str = PROVIDE_PROJECT_ID,
|
547
565
|
gcp_conn_id: str = "google_cloud_default",
|
548
566
|
impersonation_chain: str | Sequence[str] | None = None,
|
@@ -555,6 +573,7 @@ class GKEStartKueueInsideClusterOperator(GKEOperatorMixin, KubernetesInstallKueu
|
|
555
573
|
self.cluster_name = cluster_name
|
556
574
|
self.gcp_conn_id = gcp_conn_id
|
557
575
|
self.use_internal_ip = use_internal_ip
|
576
|
+
self.use_dns_endpoint = use_dns_endpoint
|
558
577
|
self.impersonation_chain = impersonation_chain
|
559
578
|
|
560
579
|
def execute(self, context: Context):
|
@@ -592,6 +611,7 @@ class GKEStartPodOperator(GKEOperatorMixin, KubernetesPodOperator):
|
|
592
611
|
cluster resides, e.g. 'us-central1-a'
|
593
612
|
:param cluster_name: The name of the Google Kubernetes Engine cluster.
|
594
613
|
:param use_internal_ip: Use the internal IP address as the endpoint.
|
614
|
+
:param use_dns_endpoint: Use the DNS address as the endpoint.
|
595
615
|
:param project_id: The Google Developers Console project id
|
596
616
|
:param gcp_conn_id: The Google cloud connection id to use. This allows for
|
597
617
|
users to specify a service account.
|
@@ -628,6 +648,7 @@ class GKEStartPodOperator(GKEOperatorMixin, KubernetesPodOperator):
|
|
628
648
|
location: str,
|
629
649
|
cluster_name: str,
|
630
650
|
use_internal_ip: bool = False,
|
651
|
+
use_dns_endpoint: bool = False,
|
631
652
|
project_id: str = PROVIDE_PROJECT_ID,
|
632
653
|
gcp_conn_id: str = "google_cloud_default",
|
633
654
|
impersonation_chain: str | Sequence[str] | None = None,
|
@@ -661,6 +682,7 @@ class GKEStartPodOperator(GKEOperatorMixin, KubernetesPodOperator):
|
|
661
682
|
self.cluster_name = cluster_name
|
662
683
|
self.gcp_conn_id = gcp_conn_id
|
663
684
|
self.use_internal_ip = use_internal_ip
|
685
|
+
self.use_dns_endpoint = use_dns_endpoint
|
664
686
|
self.impersonation_chain = impersonation_chain
|
665
687
|
self._regional = regional
|
666
688
|
if is_delete_operator_pod is not None:
|
@@ -760,6 +782,7 @@ class GKEStartJobOperator(GKEOperatorMixin, KubernetesJobOperator):
|
|
760
782
|
cluster resides, e.g. 'us-central1-a'
|
761
783
|
:param cluster_name: The name of the Google Kubernetes Engine cluster.
|
762
784
|
:param use_internal_ip: Use the internal IP address as the endpoint.
|
785
|
+
:param use_dns_endpoint: Use the DNS address as the endpoint.
|
763
786
|
:param project_id: The Google Developers Console project id
|
764
787
|
:param gcp_conn_id: The Google cloud connection id to use. This allows for
|
765
788
|
users to specify a service account.
|
@@ -788,6 +811,7 @@ class GKEStartJobOperator(GKEOperatorMixin, KubernetesJobOperator):
|
|
788
811
|
location: str,
|
789
812
|
cluster_name: str,
|
790
813
|
use_internal_ip: bool = False,
|
814
|
+
use_dns_endpoint: bool = False,
|
791
815
|
project_id: str = PROVIDE_PROJECT_ID,
|
792
816
|
gcp_conn_id: str = "google_cloud_default",
|
793
817
|
impersonation_chain: str | Sequence[str] | None = None,
|
@@ -804,6 +828,7 @@ class GKEStartJobOperator(GKEOperatorMixin, KubernetesJobOperator):
|
|
804
828
|
self.cluster_name = cluster_name
|
805
829
|
self.gcp_conn_id = gcp_conn_id
|
806
830
|
self.use_internal_ip = use_internal_ip
|
831
|
+
self.use_dns_endpoint = use_dns_endpoint
|
807
832
|
self.impersonation_chain = impersonation_chain
|
808
833
|
|
809
834
|
# There is no need to manage the kube_config file, as it will be generated automatically.
|
@@ -860,6 +885,7 @@ class GKEDescribeJobOperator(GKEOperatorMixin, GoogleCloudBaseOperator):
|
|
860
885
|
cluster resides, e.g. 'us-central1-a'
|
861
886
|
:param cluster_name: The name of the Google Kubernetes Engine cluster.
|
862
887
|
:param use_internal_ip: Use the internal IP address as the endpoint.
|
888
|
+
:param use_dns_endpoint: Use the DNS address as the endpoint.
|
863
889
|
:param project_id: The Google Developers Console project id
|
864
890
|
:param gcp_conn_id: The Google cloud connection id to use. This allows for
|
865
891
|
users to specify a service account.
|
@@ -883,6 +909,7 @@ class GKEDescribeJobOperator(GKEOperatorMixin, GoogleCloudBaseOperator):
|
|
883
909
|
location: str,
|
884
910
|
cluster_name: str,
|
885
911
|
use_internal_ip: bool = False,
|
912
|
+
use_dns_endpoint: bool = False,
|
886
913
|
project_id: str = PROVIDE_PROJECT_ID,
|
887
914
|
gcp_conn_id: str = "google_cloud_default",
|
888
915
|
impersonation_chain: str | Sequence[str] | None = None,
|
@@ -898,6 +925,7 @@ class GKEDescribeJobOperator(GKEOperatorMixin, GoogleCloudBaseOperator):
|
|
898
925
|
self.cluster_name = cluster_name
|
899
926
|
self.gcp_conn_id = gcp_conn_id
|
900
927
|
self.use_internal_ip = use_internal_ip
|
928
|
+
self.use_dns_endpoint = use_dns_endpoint
|
901
929
|
self.impersonation_chain = impersonation_chain
|
902
930
|
self.job: V1Job | None = None
|
903
931
|
|
@@ -928,6 +956,7 @@ class GKEListJobsOperator(GKEOperatorMixin, GoogleCloudBaseOperator):
|
|
928
956
|
cluster resides, e.g. 'us-central1-a'
|
929
957
|
:param cluster_name: The name of the Google Kubernetes Engine cluster.
|
930
958
|
:param use_internal_ip: Use the internal IP address as the endpoint.
|
959
|
+
:param use_dns_endpoint: Use the DNS address as the endpoint.
|
931
960
|
:param project_id: The Google Developers Console project id
|
932
961
|
:param gcp_conn_id: The Google cloud connection id to use. This allows for
|
933
962
|
users to specify a service account.
|
@@ -951,6 +980,7 @@ class GKEListJobsOperator(GKEOperatorMixin, GoogleCloudBaseOperator):
|
|
951
980
|
location: str,
|
952
981
|
cluster_name: str,
|
953
982
|
use_internal_ip: bool = False,
|
983
|
+
use_dns_endpoint: bool = False,
|
954
984
|
project_id: str = PROVIDE_PROJECT_ID,
|
955
985
|
gcp_conn_id: str = "google_cloud_default",
|
956
986
|
impersonation_chain: str | Sequence[str] | None = None,
|
@@ -966,6 +996,7 @@ class GKEListJobsOperator(GKEOperatorMixin, GoogleCloudBaseOperator):
|
|
966
996
|
self.cluster_name = cluster_name
|
967
997
|
self.gcp_conn_id = gcp_conn_id
|
968
998
|
self.use_internal_ip = use_internal_ip
|
999
|
+
self.use_dns_endpoint = use_dns_endpoint
|
969
1000
|
self.impersonation_chain = impersonation_chain
|
970
1001
|
self.namespace = namespace
|
971
1002
|
self.do_xcom_push = do_xcom_push
|
@@ -1003,6 +1034,7 @@ class GKECreateCustomResourceOperator(GKEOperatorMixin, KubernetesCreateResource
|
|
1003
1034
|
cluster resides, e.g. 'us-central1-a'
|
1004
1035
|
:param cluster_name: The name of the Google Kubernetes Engine cluster.
|
1005
1036
|
:param use_internal_ip: Use the internal IP address as the endpoint.
|
1037
|
+
:param use_dns_endpoint: Use the DNS address as the endpoint.
|
1006
1038
|
:param project_id: The Google Developers Console project id
|
1007
1039
|
:param gcp_conn_id: The Google cloud connection id to use. This allows for
|
1008
1040
|
users to specify a service account.
|
@@ -1025,6 +1057,7 @@ class GKECreateCustomResourceOperator(GKEOperatorMixin, KubernetesCreateResource
|
|
1025
1057
|
location: str,
|
1026
1058
|
cluster_name: str,
|
1027
1059
|
use_internal_ip: bool = False,
|
1060
|
+
use_dns_endpoint: bool = False,
|
1028
1061
|
project_id: str = PROVIDE_PROJECT_ID,
|
1029
1062
|
gcp_conn_id: str = "google_cloud_default",
|
1030
1063
|
impersonation_chain: str | Sequence[str] | None = None,
|
@@ -1038,6 +1071,7 @@ class GKECreateCustomResourceOperator(GKEOperatorMixin, KubernetesCreateResource
|
|
1038
1071
|
self.cluster_name = cluster_name
|
1039
1072
|
self.gcp_conn_id = gcp_conn_id
|
1040
1073
|
self.use_internal_ip = use_internal_ip
|
1074
|
+
self.use_dns_endpoint = use_dns_endpoint
|
1041
1075
|
self.impersonation_chain = impersonation_chain
|
1042
1076
|
|
1043
1077
|
if self.gcp_conn_id is None:
|
@@ -1073,6 +1107,7 @@ class GKEDeleteCustomResourceOperator(GKEOperatorMixin, KubernetesDeleteResource
|
|
1073
1107
|
cluster resides, e.g. 'us-central1-a'
|
1074
1108
|
:param cluster_name: The name of the Google Kubernetes Engine cluster.
|
1075
1109
|
:param use_internal_ip: Use the internal IP address as the endpoint.
|
1110
|
+
:param use_dns_endpoint: Use the DNS address as the endpoint.
|
1076
1111
|
:param project_id: The Google Developers Console project id
|
1077
1112
|
:param gcp_conn_id: The Google cloud connection id to use. This allows for
|
1078
1113
|
users to specify a service account.
|
@@ -1095,6 +1130,7 @@ class GKEDeleteCustomResourceOperator(GKEOperatorMixin, KubernetesDeleteResource
|
|
1095
1130
|
location: str,
|
1096
1131
|
cluster_name: str,
|
1097
1132
|
use_internal_ip: bool = False,
|
1133
|
+
use_dns_endpoint: bool = False,
|
1098
1134
|
project_id: str = PROVIDE_PROJECT_ID,
|
1099
1135
|
gcp_conn_id: str = "google_cloud_default",
|
1100
1136
|
impersonation_chain: str | Sequence[str] | None = None,
|
@@ -1108,6 +1144,7 @@ class GKEDeleteCustomResourceOperator(GKEOperatorMixin, KubernetesDeleteResource
|
|
1108
1144
|
self.cluster_name = cluster_name
|
1109
1145
|
self.gcp_conn_id = gcp_conn_id
|
1110
1146
|
self.use_internal_ip = use_internal_ip
|
1147
|
+
self.use_dns_endpoint = use_dns_endpoint
|
1111
1148
|
self.impersonation_chain = impersonation_chain
|
1112
1149
|
|
1113
1150
|
if self.gcp_conn_id is None:
|
@@ -1132,6 +1169,7 @@ class GKEStartKueueJobOperator(GKEOperatorMixin, KubernetesStartKueueJobOperator
|
|
1132
1169
|
cluster resides, e.g. 'us-central1-a'
|
1133
1170
|
:param cluster_name: The name of the Google Kubernetes Engine cluster.
|
1134
1171
|
:param use_internal_ip: Use the internal IP address as the endpoint.
|
1172
|
+
:param use_dns_endpoint: Use the DNS address as the endpoint.
|
1135
1173
|
:param project_id: The Google Developers Console project id
|
1136
1174
|
:param gcp_conn_id: The Google cloud connection id to use. This allows for
|
1137
1175
|
users to specify a service account.
|
@@ -1154,6 +1192,7 @@ class GKEStartKueueJobOperator(GKEOperatorMixin, KubernetesStartKueueJobOperator
|
|
1154
1192
|
location: str,
|
1155
1193
|
cluster_name: str,
|
1156
1194
|
use_internal_ip: bool = False,
|
1195
|
+
use_dns_endpoint: bool = False,
|
1157
1196
|
project_id: str = PROVIDE_PROJECT_ID,
|
1158
1197
|
gcp_conn_id: str = "google_cloud_default",
|
1159
1198
|
impersonation_chain: str | Sequence[str] | None = None,
|
@@ -1166,6 +1205,7 @@ class GKEStartKueueJobOperator(GKEOperatorMixin, KubernetesStartKueueJobOperator
|
|
1166
1205
|
self.cluster_name = cluster_name
|
1167
1206
|
self.gcp_conn_id = gcp_conn_id
|
1168
1207
|
self.use_internal_ip = use_internal_ip
|
1208
|
+
self.use_dns_endpoint = use_dns_endpoint
|
1169
1209
|
self.impersonation_chain = impersonation_chain
|
1170
1210
|
|
1171
1211
|
|
@@ -1192,6 +1232,7 @@ class GKEDeleteJobOperator(GKEOperatorMixin, KubernetesDeleteJobOperator):
|
|
1192
1232
|
cluster resides, e.g. 'us-central1-a'
|
1193
1233
|
:param cluster_name: The name of the Google Kubernetes Engine cluster.
|
1194
1234
|
:param use_internal_ip: Use the internal IP address as the endpoint.
|
1235
|
+
:param use_dns_endpoint: Use the DNS address as the endpoint.
|
1195
1236
|
:param project_id: The Google Developers Console project id
|
1196
1237
|
:param gcp_conn_id: The Google cloud connection id to use. This allows for
|
1197
1238
|
users to specify a service account.
|
@@ -1214,6 +1255,7 @@ class GKEDeleteJobOperator(GKEOperatorMixin, KubernetesDeleteJobOperator):
|
|
1214
1255
|
location: str,
|
1215
1256
|
cluster_name: str,
|
1216
1257
|
use_internal_ip: bool = False,
|
1258
|
+
use_dns_endpoint: bool = False,
|
1217
1259
|
project_id: str = PROVIDE_PROJECT_ID,
|
1218
1260
|
gcp_conn_id: str = "google_cloud_default",
|
1219
1261
|
impersonation_chain: str | Sequence[str] | None = None,
|
@@ -1227,6 +1269,7 @@ class GKEDeleteJobOperator(GKEOperatorMixin, KubernetesDeleteJobOperator):
|
|
1227
1269
|
self.cluster_name = cluster_name
|
1228
1270
|
self.gcp_conn_id = gcp_conn_id
|
1229
1271
|
self.use_internal_ip = use_internal_ip
|
1272
|
+
self.use_dns_endpoint = use_dns_endpoint
|
1230
1273
|
self.impersonation_chain = impersonation_chain
|
1231
1274
|
|
1232
1275
|
if self.gcp_conn_id is None:
|
@@ -1255,6 +1298,7 @@ class GKESuspendJobOperator(GKEOperatorMixin, GoogleCloudBaseOperator):
|
|
1255
1298
|
cluster resides, e.g. 'us-central1-a'
|
1256
1299
|
:param cluster_name: The name of the Google Kubernetes Engine cluster.
|
1257
1300
|
:param use_internal_ip: Use the internal IP address as the endpoint.
|
1301
|
+
:param use_dns_endpoint: Use the DNS address as the endpoint.
|
1258
1302
|
:param project_id: The Google Developers Console project id
|
1259
1303
|
:param gcp_conn_id: The Google cloud connection id to use. This allows for
|
1260
1304
|
users to specify a service account.
|
@@ -1278,6 +1322,7 @@ class GKESuspendJobOperator(GKEOperatorMixin, GoogleCloudBaseOperator):
|
|
1278
1322
|
location: str,
|
1279
1323
|
cluster_name: str,
|
1280
1324
|
use_internal_ip: bool = False,
|
1325
|
+
use_dns_endpoint: bool = False,
|
1281
1326
|
project_id: str = PROVIDE_PROJECT_ID,
|
1282
1327
|
gcp_conn_id: str = "google_cloud_default",
|
1283
1328
|
impersonation_chain: str | Sequence[str] | None = None,
|
@@ -1293,6 +1338,7 @@ class GKESuspendJobOperator(GKEOperatorMixin, GoogleCloudBaseOperator):
|
|
1293
1338
|
self.cluster_name = cluster_name
|
1294
1339
|
self.gcp_conn_id = gcp_conn_id
|
1295
1340
|
self.use_internal_ip = use_internal_ip
|
1341
|
+
self.use_dns_endpoint = use_dns_endpoint
|
1296
1342
|
self.impersonation_chain = impersonation_chain
|
1297
1343
|
self.job: V1Job | None = None
|
1298
1344
|
|
@@ -1326,6 +1372,7 @@ class GKEResumeJobOperator(GKEOperatorMixin, GoogleCloudBaseOperator):
|
|
1326
1372
|
cluster resides, e.g. 'us-central1-a'
|
1327
1373
|
:param cluster_name: The name of the Google Kubernetes Engine cluster.
|
1328
1374
|
:param use_internal_ip: Use the internal IP address as the endpoint.
|
1375
|
+
:param use_dns_endpoint: Use the DNS address as the endpoint.
|
1329
1376
|
:param project_id: The Google Developers Console project id
|
1330
1377
|
:param gcp_conn_id: The Google cloud connection id to use. This allows for
|
1331
1378
|
users to specify a service account.
|
@@ -1349,6 +1396,7 @@ class GKEResumeJobOperator(GKEOperatorMixin, GoogleCloudBaseOperator):
|
|
1349
1396
|
location: str,
|
1350
1397
|
cluster_name: str,
|
1351
1398
|
use_internal_ip: bool = False,
|
1399
|
+
use_dns_endpoint: bool = False,
|
1352
1400
|
project_id: str = PROVIDE_PROJECT_ID,
|
1353
1401
|
gcp_conn_id: str = "google_cloud_default",
|
1354
1402
|
impersonation_chain: str | Sequence[str] | None = None,
|
@@ -1364,6 +1412,7 @@ class GKEResumeJobOperator(GKEOperatorMixin, GoogleCloudBaseOperator):
|
|
1364
1412
|
self.cluster_name = cluster_name
|
1365
1413
|
self.gcp_conn_id = gcp_conn_id
|
1366
1414
|
self.use_internal_ip = use_internal_ip
|
1415
|
+
self.use_dns_endpoint = use_dns_endpoint
|
1367
1416
|
self.impersonation_chain = impersonation_chain
|
1368
1417
|
self.job: V1Job | None = None
|
1369
1418
|
|