airflow.contrib.hooks.gcp_function_hook
¶
Module Contents¶
-
class
airflow.contrib.hooks.gcp_function_hook.
GcfHook
(api_version, gcp_conn_id='google_cloud_default', delegate_to=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, location)[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, body, project_id=None)[source]¶ Creates a new function in Cloud Function in the location specified in the body.
- Parameters
- Returns
None
-
update_function
(self, name, body, update_mask)[source]¶ Updates Cloud Functions according to the specified update mask.
-
upload_function_zip
(self, location, zip_path, project_id=None)[source]¶ Uploads zip file with sources.
- Parameters
- Returns
The upload URL that was returned by generateUploadUrl method.
-
delete_function
(self, name)[source]¶ Deletes the specified Cloud Function.
- Parameters
name (str) – The name of the function.
- Returns
None
-
static