列出線上商店

您可以擷取 Google Cloud 專案中為特定地點建立的所有網路商店執行個體清單,以及每個網路商店的線上服務設定。

事前準備

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

Select the tab for how you plan to use the samples on this page:

Console

When you use the Google Cloud console to access Google Cloud services and APIs, you don't need to set up authentication.

REST

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

    安裝 Google Cloud CLI。 安裝完成後,執行下列指令初始化 Google Cloud CLI:

    gcloud init

    如果您使用外部識別資訊提供者 (IdP),請先 使用聯合身分登入 gcloud CLI

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

列出網路商店執行個體

使用下列範例,擷取專案中特定位置的所有網路商店執行個體清單。

控制台

請按照下列操作說明,使用 Google Cloud 控制台查看特定地點的線上商店清單。

  1. 在 Google Cloud 控制台的 Vertex AI 專區中,前往「Feature Store」頁面。

    前往 Feature Store 頁面

  2. 按一下「網路商店」

  3. 在「線上商店」部分,你可以查看所選地點的所有線上商店清單。

REST

如要擷取專案中所有 FeatureOnlineStore 資源的清單,請使用 featureOnlineStores.list 方法傳送 GET 要求。

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

  • LOCATION_ID:要查看線上商店清單的區域,例如 us-central1
  • PROJECT_ID:您的專案 ID。

HTTP 方法和網址:

GET https://LOCATION_ID-aiplatform.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION_ID/featureOnlineStores

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

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"

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" | Select-Object -Expand Content

畫面會顯示類似以下的輸出。您可以使用回應中的 OPERATION_ID取得作業狀態

{
  "featureOnlineStores": [
    {
      "name": "projects/PROJECT_NUMBER/locations/LOCATION_ID/featureOnlineStores/FEATUREONLINESTORE_NAME_1",
      "createTime": "2023-09-06T23:25:04.256314Z",
      "updateTime": "2023-09-06T23:25:04.256314Z",
      "etag": "AMEw9yMgoV0bAsYuKwVxz4Y7lOmxV7riNVHg217KaQAKORqvdqGCrQ1DIt8yHgoGXf8=",
      "bigtable": {
        "autoScaling": {
          "minNodeCount": 1,
          "maxNodeCount": 4,
          "cpuUtilizationTarget": 70
        }
      }
    },
    {
      "name": "projects/PROJECT_NUMBER/locations/LOCATION_ID/featureOnlineStores/FEATUREONLINESTORE_NAME_2",
      "createTime": "2023-07-21T14:24:20.206446Z",
      "updateTime": "2023-07-21T14:24:20.206446Z",
      "etag": "AMEw9yPTfvIHvpFD-mbtMVKG4Sp_y08aDFZiZl4m_97VvC0YiyEVj-sbDo_NkVueeBo=",
      "bigtable": {
        "autoScaling": {
          "minNodeCount": 1,
          "maxNodeCount": 4,
          "cpuUtilizationTarget": 70
        }
      }
    }
  ]
}

後續步驟