blob: 7da41b840c896596bcd42b86d7308f19032dbc04 [file] [log] [blame]
:py:mod:`airflow.providers.google.cloud.hooks.bigquery_dts`
===========================================================
.. py:module:: airflow.providers.google.cloud.hooks.bigquery_dts
.. autoapi-nested-parse::
This module contains a BigQuery Hook.
Module Contents
---------------
Classes
~~~~~~~
.. autoapisummary::
airflow.providers.google.cloud.hooks.bigquery_dts.BiqQueryDataTransferServiceHook
Functions
~~~~~~~~~
.. autoapisummary::
airflow.providers.google.cloud.hooks.bigquery_dts.get_object_id
.. py:function:: get_object_id(obj)
Returns unique id of the object.
.. py:class:: BiqQueryDataTransferServiceHook(gcp_conn_id = 'google_cloud_default', delegate_to = None, location = None, impersonation_chain = None)
Bases: :py:obj:`airflow.providers.google.common.hooks.base_google.GoogleBaseHook`
Hook for Google Bigquery Transfer API.
All the methods in the hook where ``project_id`` is used must be called with
keyword arguments rather than positional.
.. py:method:: get_conn()
Retrieves connection to Google Bigquery.
:return: Google Bigquery API client
:rtype: google.cloud.bigquery_datatransfer_v1.DataTransferServiceClient
.. py:method:: create_transfer_config(transfer_config, project_id = PROVIDE_PROJECT_ID, authorization_code = None, retry = DEFAULT, timeout = None, metadata = ())
Creates a new data transfer configuration.
:param transfer_config: Data transfer configuration to create.
:param project_id: The BigQuery project id where the transfer configuration should be
created. If set to None or missing, the default project_id from the Google Cloud connection
is used.
:param authorization_code: authorization code to use with this transfer configuration.
This is required if new credentials are needed.
:param retry: A retry object used to retry requests. If `None` is
specified, requests will not be retried.
:param timeout: 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.
:param metadata: Additional metadata that is provided to the method.
:return: A ``google.cloud.bigquery_datatransfer_v1.types.TransferConfig`` instance.
.. py:method:: delete_transfer_config(transfer_config_id, project_id = PROVIDE_PROJECT_ID, retry = DEFAULT, timeout = None, metadata = ())
Deletes transfer configuration.
:param transfer_config_id: Id of transfer config to be used.
:param project_id: The BigQuery project id where the transfer configuration should be
created. If set to None or missing, the default project_id from the Google Cloud connection
is used.
:param retry: A retry object used to retry requests. If `None` is
specified, requests will not be retried.
:param timeout: 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.
:param metadata: Additional metadata that is provided to the method.
:return: None
.. py:method:: start_manual_transfer_runs(transfer_config_id, project_id = PROVIDE_PROJECT_ID, requested_time_range = None, requested_run_time = None, retry = DEFAULT, timeout = None, metadata = ())
Start manual transfer runs to be executed now with schedule_time equal
to current time. The transfer runs can be created for a time range where
the run_time is between start_time (inclusive) and end_time
(exclusive), or for a specific run_time.
:param transfer_config_id: Id of transfer config to be used.
:param requested_time_range: Time range for the transfer runs that should be started.
If a dict is provided, it must be of the same form as the protobuf
message `~google.cloud.bigquery_datatransfer_v1.types.TimeRange`
:param requested_run_time: Specific run_time for a transfer run to be started. The
requested_run_time must not be in the future. If a dict is provided, it
must be of the same form as the protobuf message
`~google.cloud.bigquery_datatransfer_v1.types.Timestamp`
:param project_id: The BigQuery project id where the transfer configuration should be
created. If set to None or missing, the default project_id from the Google Cloud connection
is used.
:param retry: A retry object used to retry requests. If `None` is
specified, requests will not be retried.
:param timeout: 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.
:param metadata: Additional metadata that is provided to the method.
:return: An ``google.cloud.bigquery_datatransfer_v1.types.StartManualTransferRunsResponse`` instance.
.. py:method:: get_transfer_run(run_id, transfer_config_id, project_id = PROVIDE_PROJECT_ID, retry = DEFAULT, timeout = None, metadata = ())
Returns information about the particular transfer run.
:param run_id: ID of the transfer run.
:param transfer_config_id: ID of transfer config to be used.
:param project_id: The BigQuery project id where the transfer configuration should be
created. If set to None or missing, the default project_id from the Google Cloud connection
is used.
:param retry: A retry object used to retry requests. If `None` is
specified, requests will not be retried.
:param timeout: 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.
:param metadata: Additional metadata that is provided to the method.
:return: An ``google.cloud.bigquery_datatransfer_v1.types.TransferRun`` instance.