airflow.contrib.hooks.gcp_cloud_build_hook
¶
Hook for Google Cloud Build service
Module Contents¶
-
class
airflow.contrib.hooks.gcp_cloud_build_hook.
CloudBuildHook
(api_version='v1', gcp_conn_id='google_cloud_default', delegate_to=None)[source]¶ Bases:
airflow.contrib.hooks.gcp_api_base_hook.GoogleCloudBaseHook
Hook for the Google Cloud Build APIs.
All the methods in the hook where project_id is used must be called with keyword arguments rather than positional.
- Parameters
-
get_conn
(self)[source]¶ Retrieves the connection to Cloud Functions.
- Returns
Google Cloud Build services object.
-
create_build
(self, body, project_id=None)[source]¶ Starts a build with the specified configuration.
- Parameters
body (dict) – The request body. See: https://cloud.google.com/cloud-build/docs/api/reference/rest/Shared.Types/Build
project_id (str) – Optional, Google Cloud Project project_id where the function belongs. If set to None or missing, the default project_id from the GCP connection is used.
- Returns
None