airflow.providers.google.cloud.hooks.alloy_db
¶
模組包含 Google Alloy DB Hook。
模組內容¶
類別¶
Google Alloy DB Hook。 |
- class airflow.providers.google.cloud.hooks.alloy_db.AlloyDbHook(*args, **kwargs)[原始碼]¶
基底類別:
airflow.providers.google.common.hooks.base_google.GoogleBaseHook
Google Alloy DB Hook。
- create_cluster(cluster_id, cluster, location, project_id=PROVIDE_PROJECT_ID, request_id=None, validate_only=False, retry=DEFAULT, timeout=None, metadata=())[原始碼]¶
建立 Alloy DB 叢集。
另請參閱
如需更多詳細資訊,請參閱 API 文件: https://cloud.google.com/python/docs/reference/alloydb/latest/google.cloud.alloydb_v1.types.CreateClusterRequest
- 參數
cluster_id (str) – 必填。要建立的叢集 ID。
cluster (google.cloud.alloydb_v1.Cluster | dict) – 必填。要建立的叢集。如需更多詳細資訊,請參閱 API 文件: https://cloud.google.com/python/docs/reference/alloydb/latest/google.cloud.alloydb_v1.types.Cluster
location (str) – 必填。叢集所在的 Google Cloud 區域 ID。
project_id (str) – 選填。叢集所在的 Google Cloud 專案 ID。
request_id (str | None) – 選填。現有請求物件的 ID。
validate_only (bool) – 選填。如果設定,則執行請求驗證,但實際上不執行建立請求。
retry (google.api_core.retry.Retry | google.api_core.gapic_v1.method._MethodDefault) – 選填。指定應重試哪些錯誤(如果有的話)。
timeout (float | None) – 選填。此請求的逾時時間。
metadata (collections.abc.Sequence[tuple[str, str]]) – 選填。應與請求一起傳送作為中繼資料的字串。
- create_secondary_cluster(cluster_id, cluster, location, project_id=PROVIDE_PROJECT_ID, request_id=None, validate_only=False, retry=DEFAULT, timeout=None, metadata=())[原始碼]¶
建立次要 Alloy DB 叢集。
另請參閱
如需更多詳細資訊,請參閱 API 文件: https://cloud.google.com/python/docs/reference/alloydb/latest/google.cloud.alloydb_v1.types.CreateClusterRequest
- 參數
cluster_id (str) – 必填。要建立的叢集 ID。
cluster (google.cloud.alloydb_v1.Cluster | dict) – 必填。要建立的叢集。如需更多詳細資訊,請參閱 API 文件: https://cloud.google.com/python/docs/reference/alloydb/latest/google.cloud.alloydb_v1.types.Cluster
location (str) – 必填。叢集所在的 Google Cloud 區域 ID。
project_id (str) – 選填。叢集所在的 Google Cloud 專案 ID。
request_id (str | None) – 選填。現有請求物件的 ID。
validate_only (bool) – 選填。如果設定,則執行請求驗證,但實際上不執行建立請求。
retry (google.api_core.retry.Retry | google.api_core.gapic_v1.method._MethodDefault) – 選填。指定應重試哪些錯誤(如果有的話)。
timeout (float | None) – 選填。此請求的逾時時間。
metadata (collections.abc.Sequence[tuple[str, str]]) – 選填。應與請求一起傳送作為中繼資料的字串。
- get_cluster(cluster_id, location, project_id=PROVIDE_PROJECT_ID, retry=DEFAULT, timeout=None, metadata=())[原始碼]¶
取得 Alloy DB 叢集。
另請參閱
如需更多詳細資訊,請參閱 API 文件: https://cloud.google.com/python/docs/reference/alloydb/latest/google.cloud.alloydb_v1.types.GetClusterRequest
- 參數
cluster_id (str) – 必填。要建立的叢集 ID。
location (str) – 必填。叢集所在的 Google Cloud 區域 ID。
project_id (str) – 選填。叢集所在的 Google Cloud 專案 ID。
retry (google.api_core.retry.Retry | google.api_core.gapic_v1.method._MethodDefault) – 選填。指定應重試哪些錯誤(如果有的話)。
timeout (float | None) – 選填。此請求的逾時時間。
metadata (collections.abc.Sequence[tuple[str, str]]) – 選填。應與請求一起傳送作為中繼資料的字串。
- 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=())[原始碼]¶
更新 Alloy DB 叢集。
另請參閱
如需更多詳細資訊,請參閱 API 文件: https://cloud.google.com/python/docs/reference/alloydb/latest/google.cloud.alloydb_v1.types.UpdateClusterRequest
- 參數
cluster_id (str) – 必填。要更新的叢集 ID。
cluster (google.cloud.alloydb_v1.Cluster | dict) – 必填。要建立的叢集。如需更多詳細資訊,請參閱 API 文件: https://cloud.google.com/python/docs/reference/alloydb/latest/google.cloud.alloydb_v1.types.Cluster
location (str) – 必填。叢集所在的 Google Cloud 區域 ID。
update_mask (google.protobuf.field_mask_pb2.FieldMask | dict | None) – 選填。欄位遮罩用於指定要由更新覆寫 Cluster 資源中的欄位。
request_id (str | None) – 選填。現有請求物件的 ID。
validate_only (bool) – 選填。如果設定,則執行請求驗證,但實際上不執行建立請求。
project_id (str) – 選填。叢集所在的 Google Cloud 專案 ID。
allow_missing (bool) – 選填。如果設定為 true,即使找不到叢集,更新也會成功。在這種情況下,將建立新的叢集,並忽略 update_mask。
retry (google.api_core.retry.Retry | google.api_core.gapic_v1.method._MethodDefault) – 選填。指定應重試哪些錯誤(如果有的話)。
timeout (float | None) – 選填。此請求的逾時時間。
metadata (collections.abc.Sequence[tuple[str, str]]) – 選填。應與請求一起傳送作為中繼資料的字串。
- 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=())[原始碼]¶
刪除 Alloy DB 叢集。
另請參閱
如需更多詳細資訊,請參閱 API 文件: https://cloud.google.com/python/docs/reference/alloydb/latest/google.cloud.alloydb_v1.types.DeleteClusterRequest
- 參數
cluster_id (str) – 必填。要刪除的叢集 ID。
location (str) – 必填。叢集所在的 Google Cloud 區域 ID。
project_id (str) – 選填。叢集所在的 Google Cloud 專案 ID。
request_id (str | None) – 選填。現有請求物件的 ID。
etag (str | None) – 選填。Cluster 目前的 etag。如果提供 etag 且與 Cluster 目前的 etag 不符,刪除將被封鎖並傳回 ABORTED 錯誤。
validate_only (bool) – 選填。如果設定,則執行請求驗證,但實際上不執行建立請求。
force (bool) – 選填。是否串聯刪除給定叢集的子執行個體。
retry (google.api_core.retry.Retry | google.api_core.gapic_v1.method._MethodDefault) – 選填。指定應重試哪些錯誤(如果有的話)。
timeout (float | None) – 選填。此請求的逾時時間。
metadata (collections.abc.Sequence[tuple[str, str]]) – 選填。應與請求一起傳送作為中繼資料的字串。