airflow.providers.google.cloud.sensors.cloud_sql¶
This module contains Google Cloud SQL sensors.
Exceptions¶
Raised when the Cloud SQL operations check fails (for example, the instance is missing or access is denied). |
Classes¶
Wait until a Cloud SQL instance has no administrative operation in progress. |
Module Contents¶
- exception airflow.providers.google.cloud.sensors.cloud_sql.CloudSQLOperationError[source]¶
Bases:
airflow.providers.common.compat.sdk.AirflowExceptionRaised when the Cloud SQL operations check fails (for example, the instance is missing or access is denied).
- class airflow.providers.google.cloud.sensors.cloud_sql.CloudSQLNoOperationInProgressSensor(*, instance, project_id=PROVIDE_PROJECT_ID, gcp_conn_id='google_cloud_default', api_version='v1beta4', impersonation_chain=None, deferrable=conf.getboolean('operators', 'default_deferrable', fallback=False), **kwargs)[source]¶
Bases:
airflow.providers.common.compat.sdk.BaseSensorOperatorWait until a Cloud SQL instance has no administrative operation in progress.
Cloud SQL serializes administrative operations per instance: only one import, export, backup or similar operation can run at a time. Submitting another while one is in flight fails with HTTP 409
operationInProgress. Place this sensor upstream ofCloudSQLImportInstanceOperator/CloudSQLExportInstanceOperator(or between mutually exclusive admin operators) to serialize work against the same instance.The sensor is operation-agnostic: it polls
sqladmin.operations.listfor the instance and succeeds once no operation is in a non-terminal (PENDING/RUNNING) state. It is best-effort – a new operation could still start between the sensor passing and the next operator submitting.See also
For more information on how to use this sensor, take a look at the guide: CloudSQLNoOperationInProgressSensor
- Parameters:
instance (str) – Name of the Cloud SQL instance to watch.
project_id (str) – Optional, Google Cloud Project ID. If not provided the default project is used.
gcp_conn_id (str) – The connection ID used to connect to Google Cloud.
api_version (str) – API version used (e.g. v1beta4).
impersonation_chain (str | collections.abc.Sequence[str] | None) – Optional service account to impersonate using short-term credentials, or chained list of accounts required to get the access_token of the last account in the list, which will be impersonated in the request.
deferrable (bool) – Run the sensor in deferrable mode.
- template_fields: collections.abc.Sequence[str] = ('project_id', 'instance', 'impersonation_chain')[source]¶