airflow.providers.google.cloud.hooks.datafusion¶
This module contains Google DataFusion hook.
Module Contents¶
Classes¶
| Data Fusion pipeline states | |
| Hook for Google DataFusion. | |
| Class to get asynchronous hook for DataFusion | 
Attributes¶
- class airflow.providers.google.cloud.hooks.datafusion.PipelineStates[source]¶
- Data Fusion pipeline states 
- class airflow.providers.google.cloud.hooks.datafusion.DataFusionHook(api_version='v1beta1', gcp_conn_id='google_cloud_default', impersonation_chain=None, **kwargs)[source]¶
- Bases: - airflow.providers.google.common.hooks.base_google.GoogleBaseHook- Hook for Google DataFusion. - wait_for_pipeline_state(pipeline_name, pipeline_id, instance_url, namespace='default', success_states=None, failure_states=None, timeout=5 * 60)[source]¶
- Polls pipeline state and raises an exception if the state is one of failure_states or the operation timed_out. 
 - restart_instance(instance_name, location, project_id)[source]¶
- Restart a single Data Fusion instance. At the end of an operation instance is fully restarted. 
 - delete_instance(instance_name, location, project_id)[source]¶
- Deletes a single Date Fusion instance. 
 - create_instance(instance_name, instance, location, project_id=PROVIDE_PROJECT_ID)[source]¶
- Creates a new Data Fusion instance in the specified project and location. - Parameters
- instance_name (str) – The name of the instance to create. 
- instance (dict[str, Any]) – An instance of Instance. https://cloud.google.com/data-fusion/docs/reference/rest/v1beta1/projects.locations.instances#Instance 
- location (str) – The Cloud Data Fusion location in which to handle the request. 
- project_id (str) – The ID of the Google Cloud project that the instance belongs to. 
 
 
 - get_instance(instance_name, location, project_id)[source]¶
- Gets details of a single Data Fusion instance. 
 - patch_instance(instance_name, instance, update_mask, location, project_id=PROVIDE_PROJECT_ID)[source]¶
- Updates a single Data Fusion instance. - Parameters
- instance_name (str) – The name of the instance to create. 
- instance (dict[str, Any]) – An instance of Instance. https://cloud.google.com/data-fusion/docs/reference/rest/v1beta1/projects.locations.instances#Instance 
- update_mask (str) – Field mask is used to specify the fields that the update will overwrite in an instance resource. The fields specified in the updateMask are relative to the resource, not the full request. A field will be overwritten if it is in the mask. If the user does not provide a mask, all the supported fields (labels and options currently) will be overwritten. A comma-separated list of fully qualified names of fields. Example: “user.displayName,photo”. https://developers.google.com/protocol-buffers/docs/reference/google.protobuf?_ga=2.205612571.-968688242.1573564810#google.protobuf.FieldMask 
- location (str) – The Cloud Data Fusion location in which to handle the request. 
- project_id (str) – The ID of the Google Cloud project that the instance belongs to. 
 
 
 - create_pipeline(pipeline_name, pipeline, instance_url, namespace='default')[source]¶
- Creates a Cloud Data Fusion pipeline. - Parameters
- pipeline_name (str) – Your pipeline name. 
- pipeline (dict[str, Any]) – The pipeline definition. For more information check: https://docs.cdap.io/cdap/current/en/developer-manual/pipelines/developing-pipelines.html#pipeline-configuration-file-format 
- instance_url (str) – Endpoint on which the REST APIs is accessible for the instance. 
- namespace (str) – if your pipeline belongs to a Basic edition instance, the namespace ID is always default. If your pipeline belongs to an Enterprise edition instance, you can create a namespace. 
 
 
 - delete_pipeline(pipeline_name, instance_url, version_id=None, namespace='default')[source]¶
- Deletes a Cloud Data Fusion pipeline. - Parameters
- pipeline_name (str) – Your pipeline name. 
- version_id (str | None) – Version of pipeline to delete 
- instance_url (str) – Endpoint on which the REST APIs is accessible for the instance. 
- namespace (str) – f your pipeline belongs to a Basic edition instance, the namespace ID is always default. If your pipeline belongs to an Enterprise edition instance, you can create a namespace. 
 
 
 - list_pipelines(instance_url, artifact_name=None, artifact_version=None, namespace='default')[source]¶
- Lists Cloud Data Fusion pipelines. - Parameters
- artifact_version (str | None) – Artifact version to filter instances 
- artifact_name (str | None) – Artifact name to filter instances 
- instance_url (str) – Endpoint on which the REST APIs is accessible for the instance. 
- namespace (str) – f your pipeline belongs to a Basic edition instance, the namespace ID is always default. If your pipeline belongs to an Enterprise edition instance, you can create a namespace. 
 
 
 - start_pipeline(pipeline_name, instance_url, namespace='default', runtime_args=None)[source]¶
- Starts a Cloud Data Fusion pipeline. Works for both batch and stream pipelines. - Parameters
- pipeline_name (str) – Your pipeline name. 
- instance_url (str) – Endpoint on which the REST APIs is accessible for the instance. 
- runtime_args (dict[str, Any] | None) – Optional runtime JSON args to be passed to the pipeline 
- namespace (str) – if your pipeline belongs to a Basic edition instance, the namespace ID is always default. If your pipeline belongs to an Enterprise edition instance, you can create a namespace. 
 
 
 - stop_pipeline(pipeline_name, instance_url, namespace='default')[source]¶
- Stops a Cloud Data Fusion pipeline. Works for both batch and stream pipelines. - Parameters
- pipeline_name (str) – Your pipeline name. 
- instance_url (str) – Endpoint on which the REST APIs is accessible for the instance. 
- namespace (str) – f your pipeline belongs to a Basic edition instance, the namespace ID is always default. If your pipeline belongs to an Enterprise edition instance, you can create a namespace. 
 
 
 
- class airflow.providers.google.cloud.hooks.datafusion.DataFusionAsyncHook(**kwargs)[source]¶
- Bases: - airflow.providers.google.common.hooks.base_google.GoogleBaseAsyncHook- Class to get asynchronous hook for DataFusion - async get_pipeline_status(pipeline_name, instance_url, pipeline_id, namespace='default', success_states=None)[source]¶
- Gets a Cloud Data Fusion pipeline status asynchronously. - Parameters
- pipeline_name (str) – Your pipeline name. 
- instance_url (str) – Endpoint on which the REST APIs is accessible for the instance. 
- pipeline_id (str) – Unique pipeline ID associated with specific pipeline 
- namespace (str) – if your pipeline belongs to a Basic edition instance, the namespace ID is always default. If your pipeline belongs to an Enterprise edition instance, you can create a namespace. 
- success_states (list[str] | None) – If provided the operator will wait for pipeline to be in one of the provided states. 
 
 
 
