airflow.providers.google.cloud.hooks.dataplex

This module contains Google Dataplex hook.

Module Contents

Classes

DataplexHook

Hook for Google Dataplex.

class airflow.providers.google.cloud.hooks.dataplex.DataplexHook(api_version='v1', gcp_conn_id='google_cloud_default', delegate_to=None, impersonation_chain=None)[source]

Bases: airflow.providers.google.common.hooks.base_google.GoogleBaseHook

Hook for Google Dataplex.

Parameters
  • api_version (str) -- The version of the api that will be requested for example 'v3'.

  • gcp_conn_id (str) -- The connection ID to use when fetching connection info.

  • delegate_to (Optional[str]) -- The account to impersonate, if any. For this to work, the service accountmaking the request must have domain-wide delegation enabled.

  • impersonation_chain (Optional[Union[str, Sequence[str]]]) -- Optional service account to impersonate using short-term credentials, or chained list of accounts required to get the access_token of the last account in the list, which will be impersonated in the request. If set as a string, the account must grant the originating account the Service Account Token Creator IAM role. If set as a sequence, the identities from the list must grant Service Account Token Creator IAM role to the directly preceding identity, with first account from the list granting this role to the originating account (templated).

get_dataplex_client(self)[source]

Returns DataplexServiceClient.

wait_for_operation(self, timeout, operation)[source]

Waits for long-lasting operation to complete.

create_task(self, project_id, region, lake_id, body, dataplex_task_id, validate_only=None, retry=DEFAULT, timeout=None, metadata=())[source]

Creates a task resource within a lake.

Parameters
  • project_id (str) -- Required. The ID of the Google Cloud project that the task belongs to.

  • region (str) -- Required. The ID of the Google Cloud region that the task belongs to.

  • lake_id (str) -- Required. The ID of the Google Cloud lake that the task belongs to.

  • body (Union[Dict[str, Any], google.cloud.dataplex_v1.types.Task]) -- Required. The Request body contains an instance of Task.

  • dataplex_task_id (str) -- Required. Task identifier.

  • validate_only (Optional[bool]) -- Optional. Only validate the request, but do not perform mutations. The default is false.

  • retry (Union[google.api_core.retry.Retry, google.api_core.gapic_v1.method._MethodDefault]) -- A retry object used to retry requests. If None is specified, requests will not be retried.

  • timeout (Optional[float]) -- The amount of time, in seconds, to wait for the request to complete. Note that if retry is specified, the timeout applies to each individual attempt.

  • metadata (Sequence[Tuple[str, str]]) -- Additional metadata that is provided to the method.

delete_task(self, project_id, region, lake_id, dataplex_task_id, retry=DEFAULT, timeout=None, metadata=())[source]

Delete the task resource.

Parameters
  • project_id (str) -- Required. The ID of the Google Cloud project that the task belongs to.

  • region (str) -- Required. The ID of the Google Cloud region that the task belongs to.

  • lake_id (str) -- Required. The ID of the Google Cloud lake that the task belongs to.

  • dataplex_task_id (str) -- Required. The ID of the Google Cloud task to be deleted.

  • retry (Union[google.api_core.retry.Retry, google.api_core.gapic_v1.method._MethodDefault]) -- A retry object used to retry requests. If None is specified, requests will not be retried.

  • timeout (Optional[float]) -- The amount of time, in seconds, to wait for the request to complete. Note that if retry is specified, the timeout applies to each individual attempt.

  • metadata (Sequence[Tuple[str, str]]) -- Additional metadata that is provided to the method.

list_tasks(self, project_id, region, lake_id, page_size=None, page_token=None, filter=None, order_by=None, retry=DEFAULT, timeout=None, metadata=())[source]

Lists tasks under the given lake.

Parameters
  • project_id (str) -- Required. The ID of the Google Cloud project that the task belongs to.

  • region (str) -- Required. The ID of the Google Cloud region that the task belongs to.

  • lake_id (str) -- Required. The ID of the Google Cloud lake that the task belongs to.

  • page_size (Optional[int]) -- Optional. Maximum number of tasks to return. The service may return fewer than this value. If unspecified, at most 10 tasks will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.

  • page_token (Optional[str]) -- Optional. Page token received from a previous ListZones call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to ListZones must match the call that provided the page token.

  • filter (Optional[str]) -- Optional. Filter request.

  • order_by (Optional[str]) -- Optional. Order by fields for the result.

  • retry (Union[google.api_core.retry.Retry, google.api_core.gapic_v1.method._MethodDefault]) -- A retry object used to retry requests. If None is specified, requests will not be retried.

  • timeout (Optional[float]) -- The amount of time, in seconds, to wait for the request to complete. Note that if retry is specified, the timeout applies to each individual attempt.

  • metadata (Sequence[Tuple[str, str]]) -- Additional metadata that is provided to the method.

get_task(self, project_id, region, lake_id, dataplex_task_id, retry=DEFAULT, timeout=None, metadata=())[source]

Get task resource.

Parameters
  • project_id (str) -- Required. The ID of the Google Cloud project that the task belongs to.

  • region (str) -- Required. The ID of the Google Cloud region that the task belongs to.

  • lake_id (str) -- Required. The ID of the Google Cloud lake that the task belongs to.

  • dataplex_task_id (str) -- Required. The ID of the Google Cloud task to be retrieved.

  • retry (Union[google.api_core.retry.Retry, google.api_core.gapic_v1.method._MethodDefault]) -- A retry object used to retry requests. If None is specified, requests will not be retried.

  • timeout (Optional[float]) -- The amount of time, in seconds, to wait for the request to complete. Note that if retry is specified, the timeout applies to each individual attempt.

  • metadata (Sequence[Tuple[str, str]]) -- Additional metadata that is provided to the method.

Was this entry helpful?