airflow.providers.google.cloud.hooks.dataform¶
類¶
Google Cloud DataForm API 的 Hook。 |
模組內容¶
- class airflow.providers.google.cloud.hooks.dataform.DataformHook(gcp_conn_id='google_cloud_default', impersonation_chain=None, **kwargs)[source]¶
Bases:
airflow.providers.google.common.hooks.base_google.GoogleBaseHookGoogle Cloud DataForm API 的 Hook。
- wait_for_workflow_invocation(workflow_invocation_id, repository_id, project_id, region, wait_time=10, timeout=None)[source]¶
輪詢作業以檢查其是否完成。
- create_compilation_result(project_id, region, repository_id, compilation_result, retry=DEFAULT, timeout=None, metadata=())[source]¶
在指定的專案和位置中建立新的 CompilationResult。
- 引數:
project_id (str) – 必需。任務所屬的 Google Cloud 專案 ID。
region (str) – 必需。任務所屬的 Google Cloud 區域 ID。
repository_id (str) – 必需。任務所屬的 Dataform 倉庫 ID。
compilation_result (google.cloud.dataform_v1beta1.types.CompilationResult | dict) – 必需。要建立的編譯結果。
retry (google.api_core.retry.Retry | google.api_core.gapic_v1.method._MethodDefault) – 指定哪些錯誤(如果有)應該重試。
timeout (float | None) – 此請求的超時時間。
metadata (collections.abc.Sequence[tuple[str, str]]) – 應隨請求作為元資料傳送的字串。
- get_compilation_result(project_id, region, repository_id, compilation_result_id, retry=DEFAULT, timeout=None, metadata=())[source]¶
獲取單個 CompilationResult。
- 引數:
project_id (str) – 必需。任務所屬的 Google Cloud 專案 ID。
region (str) – 必需。任務所屬的 Google Cloud 區域 ID。
repository_id (str) – 必需。任務所屬的 Dataform 倉庫 ID。
compilation_result_id (str) – Dataform 編譯結果的 ID
retry (google.api_core.retry.Retry | google.api_core.gapic_v1.method._MethodDefault) – 指定哪些錯誤(如果有)應該重試。
timeout (float | None) – 此請求的超時時間。
metadata (collections.abc.Sequence[tuple[str, str]]) – 應隨請求作為元資料傳送的字串。
- create_workflow_invocation(project_id, region, repository_id, workflow_invocation, retry=DEFAULT, timeout=None, metadata=())[source]¶
在指定的倉庫中建立新的 WorkflowInvocation。
- 引數:
project_id (str) – 必需。任務所屬的 Google Cloud 專案 ID。
region (str) – 必需。任務所屬的 Google Cloud 區域 ID。
repository_id (str) – 必需。任務所屬的 Dataform 倉庫 ID。
workflow_invocation (google.cloud.dataform_v1beta1.types.WorkflowInvocation | dict) – 必需。要建立的工作流程呼叫資源。
retry (google.api_core.retry.Retry | google.api_core.gapic_v1.method._MethodDefault) – 指定哪些錯誤(如果有)應該重試。
timeout (float | None) – 此請求的超時時間。
metadata (collections.abc.Sequence[tuple[str, str]]) – 應隨請求作為元資料傳送的字串。
- get_workflow_invocation(project_id, region, repository_id, workflow_invocation_id, retry=DEFAULT, timeout=None, metadata=())[source]¶
獲取單個 WorkflowInvocation。
- 引數:
project_id (str) – 必需。任務所屬的 Google Cloud 專案 ID。
region (str) – 必需。任務所屬的 Google Cloud 區域 ID。
repository_id (str) – 必需。任務所屬的 Dataform 倉庫 ID。
workflow_invocation_id (str) – 必需。工作流程呼叫資源的 ID。
retry (google.api_core.retry.Retry | google.api_core.gapic_v1.method._MethodDefault) – 指定哪些錯誤(如果有)應該重試。
timeout (float | None) – 此請求的超時時間。
metadata (collections.abc.Sequence[tuple[str, str]]) – 應隨請求作為元資料傳送的字串。
- query_workflow_invocation_actions(project_id, region, repository_id, workflow_invocation_id, retry=DEFAULT, timeout=None, metadata=())[source]¶
獲取 WorkflowInvocation 操作。
- 引數:
project_id (str) – 必需。任務所屬的 Google Cloud 專案 ID。
region (str) – 必需。任務所屬的 Google Cloud 區域 ID。
repository_id (str) – 必需。任務所屬的 Dataform 倉庫 ID。
workflow_invocation_id (str) – 必需。工作流程呼叫資源的 ID。
retry (google.api_core.retry.Retry | google.api_core.gapic_v1.method._MethodDefault) – 指定哪些錯誤(如果有)應該重試。
timeout (float | None) – 此請求的超時時間。
metadata (collections.abc.Sequence[tuple[str, str]]) – 應隨請求作為元資料傳送的字串。
- cancel_workflow_invocation(project_id, region, repository_id, workflow_invocation_id, retry=DEFAULT, timeout=None, metadata=())[source]¶
請求取消正在執行的 WorkflowInvocation。
- 引數:
project_id (str) – 必需。任務所屬的 Google Cloud 專案 ID。
region (str) – 必需。任務所屬的 Google Cloud 區域 ID。
repository_id (str) – 必需。任務所屬的 Dataform 倉庫 ID。
workflow_invocation_id (str) – 必需。工作流程呼叫資源的 ID。
retry (google.api_core.retry.Retry | google.api_core.gapic_v1.method._MethodDefault) – 指定哪些錯誤(如果有)應該重試。
timeout (float | None) – 此請求的超時時間。
metadata (collections.abc.Sequence[tuple[str, str]]) – 應隨請求作為元資料傳送的字串。
- create_repository(*, project_id, region, repository_id, retry=DEFAULT, timeout=None, metadata=())[source]¶
建立倉庫。
- 引數:
project_id (str) – 必需。倉庫應所在的 Google Cloud 專案 ID。
region (str) – 必需。倉庫應所在的 Google Cloud 區域 ID。
repository_id (str) – 必需。新的 Dataform 倉庫 ID。
retry (google.api_core.retry.Retry | google.api_core.gapic_v1.method._MethodDefault) – 指定哪些錯誤(如果有)應該重試。
timeout (float | None) – 此請求的超時時間。
metadata (collections.abc.Sequence[tuple[str, str]]) – 應隨請求作為元資料傳送的字串。
- delete_repository(*, project_id, region, repository_id, force=True, retry=DEFAULT, timeout=None, metadata=())[source]¶
刪除倉庫。
- 引數:
project_id (str) – 必需。倉庫所在的 Google Cloud 專案 ID。
region (str) – 必需。倉庫所在的 Google Cloud 區域 ID。
repository_id (str) – 必需。要刪除的 Dataform 倉庫 ID。
force (bool) – 如果設定為 true,則此倉庫的任何子資源也將被刪除。
retry (google.api_core.retry.Retry | google.api_core.gapic_v1.method._MethodDefault) – 指定哪些錯誤(如果有)應該重試。
timeout (float | None) – 此請求的超時時間。
metadata (collections.abc.Sequence[tuple[str, str]]) – 應隨請求作為元資料傳送的字串。
- create_workspace(*, project_id, region, repository_id, workspace_id, retry=DEFAULT, timeout=None, metadata=())[source]¶
建立工作區。
- 引數:
project_id (str) – 必需。工作區應所在的 Google Cloud 專案 ID。
region (str) – 必需。工作區應所在的 Google Cloud 區域 ID。
repository_id (str) – 必需。工作區應所在的 Dataform 倉庫 ID。
workspace_id (str) – 必需。新的 Dataform 工作區 ID。
retry (google.api_core.retry.Retry | google.api_core.gapic_v1.method._MethodDefault) – 指定哪些錯誤(如果有)應該重試。
timeout (float | None) – 此請求的超時時間。
metadata (collections.abc.Sequence[tuple[str, str]]) – 應隨請求作為元資料傳送的字串。
- delete_workspace(*, project_id, region, repository_id, workspace_id, retry=DEFAULT, timeout=None, metadata=())[source]¶
刪除工作區。
- 引數:
project_id (str) – 必需。工作區所在的 Google Cloud 專案 ID。
region (str) – 必需。工作區所在的 Google Cloud 區域 ID。
repository_id (str) – 必需。工作區所在的 Dataform 倉庫 ID。
workspace_id (str) – 必需。要刪除的 Dataform 工作區 ID。
retry (google.api_core.retry.Retry | google.api_core.gapic_v1.method._MethodDefault) – 指定哪些錯誤(如果有)應該重試。
timeout (float | None) – 此請求的超時時間。
metadata (collections.abc.Sequence[tuple[str, str]]) – 應隨請求作為元資料傳送的字串。
- write_file(*, project_id, region, repository_id, workspace_id, filepath, contents, retry=DEFAULT, timeout=None, metadata=())[source]¶
將新檔案寫入指定的工作區。
- 引數:
project_id (str) – 必需。工作區所在的 Google Cloud 專案 ID。
region (str) – 必需。工作區所在的 Google Cloud 區域 ID。
repository_id (str) – 必需。工作區所在的 Dataform 倉庫 ID。
workspace_id (str) – 必需。應建立檔案的 Dataform 工作區 ID。
filepath (str) – 必需。檔案路徑,包括相對於工作區根目錄的檔名。
contents (bytes) – 必需。要寫入的檔案內容。
retry (google.api_core.retry.Retry | google.api_core.gapic_v1.method._MethodDefault) – 指定哪些錯誤(如果有)應該重試。
timeout (float | None) – 此請求的超時時間。
metadata (collections.abc.Sequence[tuple[str, str]]) – 應隨請求作為元資料傳送的字串。
- make_directory(*, project_id, region, repository_id, workspace_id, path, retry=DEFAULT, timeout=None, metadata=())[source]¶
在指定的工作區中建立新目錄。
- 引數:
project_id (str) – 必需。工作區所在的 Google Cloud 專案 ID。
region (str) – 必需。工作區所在的 Google Cloud 區域 ID。
repository_id (str) – 必需。工作區所在的 Dataform 倉庫 ID。
workspace_id (str) – 必需。應建立目錄的 Dataform 工作區 ID。
path (str) – 必需。目錄的完整路徑,包括新的目錄名,相對於工作區根目錄。
retry (google.api_core.retry.Retry | google.api_core.gapic_v1.method._MethodDefault) – 指定哪些錯誤(如果有)應該重試。
timeout (float | None) – 此請求的超時時間。
metadata (collections.abc.Sequence[tuple[str, str]]) – 應隨請求作為元資料傳送的字串。
- remove_directory(*, project_id, region, repository_id, workspace_id, path, retry=DEFAULT, timeout=None, metadata=())[source]¶
在指定的工作區中刪除目錄。
- 引數:
project_id (str) – 必需。工作區所在的 Google Cloud 專案 ID。
region (str) – 必需。工作區所在的 Google Cloud 區域 ID。
repository_id (str) – 必需。工作區所在的 Dataform 倉庫 ID。
workspace_id (str) – 必需。目錄所在的 Dataform 工作區 ID。
path (str) – 必需。目錄的完整路徑,包括目錄名,相對於工作區根目錄。
retry (google.api_core.retry.Retry | google.api_core.gapic_v1.method._MethodDefault) – 指定哪些錯誤(如果有)應該重試。
timeout (float | None) – 此請求的超時時間。
metadata (collections.abc.Sequence[tuple[str, str]]) – 應隨請求作為元資料傳送的字串。
- remove_file(*, project_id, region, repository_id, workspace_id, filepath, retry=DEFAULT, timeout=None, metadata=())[source]¶
在指定的工作區中刪除檔案。
- 引數:
project_id (str) – 必需。工作區所在的 Google Cloud 專案 ID。
region (str) – 必需。工作區所在的 Google Cloud 區域 ID。
repository_id (str) – 必需。工作區所在的 Dataform 倉庫 ID。
workspace_id (str) – 必需。目錄所在的 Dataform 工作區 ID。
filepath (str) – 必需。檔案的完整路徑,包括檔名,相對於工作區根目錄。
retry (google.api_core.retry.Retry | google.api_core.gapic_v1.method._MethodDefault) – 指定哪些錯誤(如果有)應該重試。
timeout (float | None) – 此請求的超時時間。
metadata (collections.abc.Sequence[tuple[str, str]]) – 應隨請求作為元資料傳送的字串。
- install_npm_packages(*, project_id, region, repository_id, workspace_id, retry=DEFAULT, timeout=None, metadata=())[source]¶
在提供的工作區中安裝 NPM 依賴項。
需要在工作區中建立“package.json”檔案。
- 引數:
project_id (str) – 必需。工作區所在的 Google Cloud 專案 ID。
region (str) – 必需。工作區所在的 Google Cloud 區域 ID。
repository_id (str) – 必需。工作區所在的 Dataform 倉庫 ID。
workspace_id (str) – 必需。Dataform 工作區 ID。
retry (google.api_core.retry.Retry | google.api_core.gapic_v1.method._MethodDefault) – 指定哪些錯誤(如果有)應該重試。
timeout (float | None) – 此請求的超時時間。
metadata (collections.abc.Sequence[tuple[str, str]]) – 應隨請求作為元資料傳送的字串。