airflow.providers.google.cloud.hooks.gdm

Module Contents

class airflow.providers.google.cloud.hooks.gdm.GoogleDeploymentManagerHook(gcp_conn_id: str = 'google_cloud_default', delegate_to: Optional[str] = None, impersonation_chain: Optional[Union[str, Sequence[str]]] = None)[source]

Bases: airflow.providers.google.common.hooks.base_google.GoogleBaseHook

Interact with Google Cloud Deployment Manager using the Google Cloud connection. This allows for scheduled and programmatic inspection and deletion fo resources managed by GDM.

get_conn(self)[source]

Returns a Google Deployment Manager service object.

Return type

googleapiclient.discovery.Resource

list_deployments(self, project_id: Optional[str] = None, deployment_filter: Optional[str] = None, order_by: Optional[str] = None)[source]

Lists deployments in a google cloud project.

Parameters
  • project_id (str) -- The project ID for this request.

  • deployment_filter (str) -- A filter expression which limits resources returned in the response.

  • order_by (Optional[str]) -- A field name to order by, ex: "creationTimestamp desc"

Return type

list

delete_deployment(self, project_id: Optional[str], deployment: Optional[str] = None, delete_policy: Optional[str] = None)[source]

Deletes a deployment and all associated resources in a google cloud project.

Parameters
  • project_id (str) -- The project ID for this request.

  • deployment (str) -- The name of the deployment for this request.

  • delete_policy (string) -- Sets the policy to use for deleting resources. (ABANDON | DELETE)

Return type

None

Was this entry helpful?