airflow.providers.google.cloud.hooks.alloy_db

Module contains a Google Alloy DB Hook.

Module Contents

Classes

AlloyDbHook

Google Alloy DB Hook.

class airflow.providers.google.cloud.hooks.alloy_db.AlloyDbHook(*args, **kwargs)[source]

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

Google Alloy DB Hook.

get_alloy_db_admin_client()[source]

Retrieve AlloyDB client.

wait_for_operation(timeout, operation)[source]

Wait for long-lasting operation to complete.

create_cluster(cluster_id, cluster, location, project_id=PROVIDE_PROJECT_ID, request_id=None, validate_only=False, retry=DEFAULT, timeout=None, metadata=())[source]

Create an Alloy DB cluster.

Parameters
  • cluster_id (str) – Required. ID of the cluster to create.

  • cluster (google.cloud.alloydb_v1.Cluster | dict) – Required. Cluster to create. For more details please see API documentation: https://cloud.google.com/python/docs/reference/alloydb/latest/google.cloud.alloydb_v1.types.Cluster

  • location (str) – Required. The ID of the Google Cloud region where the cluster is located.

  • project_id (str) – Optional. The ID of the Google Cloud project where the cluster is located.

  • request_id (str | None) – Optional. The ID of an existing request object.

  • validate_only (bool) – Optional. If set, performs request validation, but does not actually execute the create request.

  • retry (google.api_core.retry.Retry | google.api_core.gapic_v1.method._MethodDefault) – Optional. Designation of what errors, if any, should be retried.

  • timeout (float | None) – Optional. The timeout for this request.

  • metadata (collections.abc.Sequence[tuple[str, str]]) – Optional. Strings which should be sent along with the request as metadata.

create_secondary_cluster(cluster_id, cluster, location, project_id=PROVIDE_PROJECT_ID, request_id=None, validate_only=False, retry=DEFAULT, timeout=None, metadata=())[source]

Create a secondary Alloy DB cluster.

Parameters
  • cluster_id (str) – Required. ID of the cluster to create.

  • cluster (google.cloud.alloydb_v1.Cluster | dict) – Required. Cluster to create. For more details please see API documentation: https://cloud.google.com/python/docs/reference/alloydb/latest/google.cloud.alloydb_v1.types.Cluster

  • location (str) – Required. The ID of the Google Cloud region where the cluster is located.

  • project_id (str) – Optional. The ID of the Google Cloud project where the cluster is located.

  • request_id (str | None) – Optional. The ID of an existing request object.

  • validate_only (bool) – Optional. If set, performs request validation, but does not actually execute the create request.

  • retry (google.api_core.retry.Retry | google.api_core.gapic_v1.method._MethodDefault) – Optional. Designation of what errors, if any, should be retried.

  • timeout (float | None) – Optional. The timeout for this request.

  • metadata (collections.abc.Sequence[tuple[str, str]]) – Optional. Strings which should be sent along with the request as metadata.

get_cluster(cluster_id, location, project_id=PROVIDE_PROJECT_ID, retry=DEFAULT, timeout=None, metadata=())[source]

Retrieve an Alloy DB cluster.

Parameters
  • cluster_id (str) – Required. ID of the cluster to create.

  • location (str) – Required. The ID of the Google Cloud region where the cluster is located.

  • project_id (str) – Optional. The ID of the Google Cloud project where the cluster is located.

  • retry (google.api_core.retry.Retry | google.api_core.gapic_v1.method._MethodDefault) – Optional. Designation of what errors, if any, should be retried.

  • timeout (float | None) – Optional. The timeout for this request.

  • metadata (collections.abc.Sequence[tuple[str, str]]) – Optional. Strings which should be sent along with the request as metadata.

update_cluster(cluster_id, cluster, location, update_mask=None, project_id=PROVIDE_PROJECT_ID, allow_missing=False, request_id=None, validate_only=False, retry=DEFAULT, timeout=None, metadata=())[source]

Update an Alloy DB cluster.

Parameters
  • cluster_id (str) – Required. ID of the cluster to update.

  • cluster (google.cloud.alloydb_v1.Cluster | dict) – Required. Cluster to create. For more details please see API documentation: https://cloud.google.com/python/docs/reference/alloydb/latest/google.cloud.alloydb_v1.types.Cluster

  • location (str) – Required. The ID of the Google Cloud region where the cluster is located.

  • update_mask (google.protobuf.field_mask_pb2.FieldMask | dict | None) – Optional. Field mask is used to specify the fields to be overwritten in the Cluster resource by the update.

  • request_id (str | None) – Optional. The ID of an existing request object.

  • validate_only (bool) – Optional. If set, performs request validation, but does not actually execute the create request.

  • project_id (str) – Optional. The ID of the Google Cloud project where the cluster is located.

  • allow_missing (bool) – Optional. If set to true, update succeeds even if cluster is not found. In that case, a new cluster is created and update_mask is ignored.

  • retry (google.api_core.retry.Retry | google.api_core.gapic_v1.method._MethodDefault) – Optional. Designation of what errors, if any, should be retried.

  • timeout (float | None) – Optional. The timeout for this request.

  • metadata (collections.abc.Sequence[tuple[str, str]]) – Optional. Strings which should be sent along with the request as metadata.

delete_cluster(cluster_id, location, project_id=PROVIDE_PROJECT_ID, request_id=None, etag=None, validate_only=False, force=False, retry=DEFAULT, timeout=None, metadata=())[source]

Delete an Alloy DB cluster.

Parameters
  • cluster_id (str) – Required. ID of the cluster to delete.

  • location (str) – Required. The ID of the Google Cloud region where the cluster is located.

  • project_id (str) – Optional. The ID of the Google Cloud project where the cluster is located.

  • request_id (str | None) – Optional. The ID of an existing request object.

  • etag (str | None) – Optional. The current etag of the Cluster. If an etag is provided and does not match the current etag of the Cluster, deletion will be blocked and an ABORTED error will be returned.

  • validate_only (bool) – Optional. If set, performs request validation, but does not actually execute the create request.

  • force (bool) – Optional. Whether to cascade delete child instances for given cluster.

  • retry (google.api_core.retry.Retry | google.api_core.gapic_v1.method._MethodDefault) – Optional. Designation of what errors, if any, should be retried.

  • timeout (float | None) – Optional. The timeout for this request.

  • metadata (collections.abc.Sequence[tuple[str, str]]) – Optional. Strings which should be sent along with the request as metadata.

Was this entry helpful?