列出同步處理作業

您可以查看特定功能檢視畫面執行的資料同步作業清單。如果您想確認資料是否已從 BigQuery 資料來源成功同步處理,或是資料同步處理是否正在進行中,這項功能就非常實用。

事前準備

向 Vertex AI 進行驗證 (如果尚未完成)。

如要在本機開發環境中使用本頁的 REST API 範例,請使用您提供給 gcloud CLI 的憑證。

    After installing the Google Cloud CLI, initialize it by running the following command:

    gcloud init

    If you're using an external identity provider (IdP), you must first sign in to the gcloud CLI with your federated identity.

詳情請參閱 Google Cloud 驗證說明文件中的「Authenticate for using REST」。

列出特徵檢視區塊中的同步作業

使用下列範例,查看為特徵檢視區塊執行的所有同步作業清單。

REST

如要查看 FeatureView 執行個體中的資料同步作業清單,請使用 featureViewSyncs.list 方法傳送 GET 要求。

使用任何要求資料之前,請先替換以下項目:

  • LOCATION_ID:線上商店所在的區域,例如 us-central1
  • PROJECT_ID:您的專案 ID。
  • FEATUREONLINESTORE_NAME:包含特徵檢視區塊的網路商店名稱。
  • FEATUREVIEW_NAME:您要查看資料同步作業清單的特徵檢視區塊名稱。

HTTP 方法和網址:

GET https://LOCATION_ID-aiplatform.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION_ID/featureOnlineStores/FEATUREONLINESTORE_NAME/featureViews/FEATUREVIEW_NAME/featureViewSyncs

如要傳送要求,請選擇以下其中一個選項:

curl

執行下列指令:

curl -X GET \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
"https://LOCATION_ID-aiplatform.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION_ID/featureOnlineStores/FEATUREONLINESTORE_NAME/featureViews/FEATUREVIEW_NAME/featureViewSyncs"

PowerShell

執行下列指令:

$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }

Invoke-WebRequest `
-Method GET `
-Headers $headers `
-Uri "https://LOCATION_ID-aiplatform.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION_ID/featureOnlineStores/FEATUREONLINESTORE_NAME/featureViews/FEATUREVIEW_NAME/featureViewSyncs" | Select-Object -Expand Content

您應該會收到如下的 JSON 回應:

{
  "featureViewSyncs": [
    {
      "name": "PROJECT_ID/locations/LOCATION_ID/featureOnlineStores/FEATUREONLINESTORE_NAME/featureViews/FEATUREVIEW_NAME/featureViewSyncs/OPERATION_ID_1",
      "createTime": "2023-09-11T15:33:24.906716Z",
      "dataTransfer": {
        "endTime": "2023-09-11T15:33:43.615598Z"
      },
      "finalStatus": {
        "code": 13
      },
      "runTime": {
        "endTime": "2023-09-11T15:33:43.615598Z"
      }
    },
    {
      "name": "PROJECT_ID/locations/LOCATION_ID/featureOnlineStores/FEATUREONLINESTORE_NAME/featureViews/FEATUREVIEW_NAME/featureViewSyncs/OPERATION_ID_2",
      "createTime": "2023-09-06T23:48:00.670844Z",
      "dataTransfer": {
        "endTime": "2023-09-06T23:48:19.086848Z"
      },
      "finalStatus": {
        "code": 13
      },
      "runTime": {
        "endTime": "2023-09-06T23:48:19.086848Z"
      }
    }
  ]
}

後續步驟