airflow.gcp.hooks.cloud_build
¶
Hook for Google Cloud Build service
Module Contents¶
-
class
airflow.gcp.hooks.cloud_build.
CloudBuildHook
(api_version:str='v1', gcp_conn_id:str='google_cloud_default', delegate_to:str=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:Dict, project_id:str=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
Dict