列出在线存储区

您可以检索 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 的凭据。

    Install the Google Cloud CLI, then initialize it by running the following command:

    gcloud init

如需了解详情,请参阅 Google Cloud 身份验证文档中的使用 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
        }
      }
    }
  ]
}

后续步骤