airflow.gcp.hooks.functions
¶
This module contains a Google Cloud Functions Hook.
Module Contents¶
-
class
airflow.gcp.hooks.functions.
GcfHook
(api_version:str, 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 Functions APIs.
All the methods in the hook where project_id is used must be called with keyword arguments rather than positional.
-
static
_full_location
(project_id:str, location:str)[source]¶ Retrieve full location of the function in the form of
projects/<GCP_PROJECT_ID>/locations/<GCP_LOCATION>
-
get_conn
(self)[source]¶ Retrieves the connection to Cloud Functions.
- Returns
Google Cloud Function services object.
- Return type
-
create_new_function
(self, location:str, body:Dict, project_id:str=None)[source]¶ Creates a new function in Cloud Function in the location specified in the body.
- Parameters
- Returns
None
-
update_function
(self, name:str, body:Dict, update_mask:List[str])[source]¶ Updates Cloud Functions according to the specified update mask.
-
upload_function_zip
(self, location:str, zip_path:str, project_id:str=None)[source]¶ Uploads zip file with sources.
- Parameters
- Returns
The upload URL that was returned by generateUploadUrl method.
- Return type
-
delete_function
(self, name:str)[source]¶ Deletes the specified Cloud Function.
- Parameters
name (str) – The name of the function.
- Returns
None
-
static