列出特征组

您可以检索 Google Cloud 项目中为特定位置创建的所有特征组列表,以及与每个特征组关联的 BigQuery 源表或视图的 URI。

使用以下示例可检索项目中特定位置的所有特征组的列表。

控制台

请按照以下说明,使用 Google Cloud 控制台查看特定位置的特征组列表。

  1. 在 Google Cloud 控制台的“Vertex AI”部分,转到 Feature Store 页面。

    转到 Feature Store 页面

  2. 特征组部分中,您可以查看所选位置的所有特征组的列表。

REST

要检索项目中特定位置的所有 FeatureGroup 资源列表,请使用 featureGroups.list 方法发送 GET 请求。

在使用任何请求数据之前,请先进行以下替换:

  • LOCATION_ID:您要查看其特征组列表的区域,例如 us-central1
  • PROJECT_ID:您的项目 ID。

HTTP 方法和网址:

GET http://LOCATION_ID-aiplatform.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION_ID/featureGroups

如需发送请求,请选择以下方式之一:

curl

执行以下命令:

curl -X GET \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
"http://LOCATION_ID-aiplatform.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION_ID/featureGroups"

PowerShell

执行以下命令:

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

Invoke-WebRequest `
-Method GET `
-Headers $headers `
-Uri "http://LOCATION_ID-aiplatform.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION_ID/featureGroups" | Select-Object -Expand Content

您应该收到类似以下内容的 JSON 响应:

{
  "featureGroups": [
    {
      "name": "projects/PROJECT_NUMBER/locations/LOCATION_ID/featureGroups/FEATURE_GROUP_NAME_1",
      "createTime": "2023-09-07T00:57:00.142639Z",
      "updateTime": "2023-09-07T00:57:00.142639Z",
      "etag": "AMEw9yOY0byP8qKsDY0DoZyouAtX23zDru2l422C0affZZPYNFOGgIrONELNrM49uH4=",
      "bigQuery": {
        "bigQuerySource": {
          "inputUri": "BIGQUERY_URI_1"
        }
      }
    },
    {
      "name": "projects/PROJECT_NUMBER/locations/LOCATION_ID/featureGroups/FEATURE_GROUP_NAME_2",
      "createTime": "2023-09-06T23:14:30.795502Z",
      "updateTime": "2023-09-06T23:14:30.795502Z",
      "etag": "AMEw9yO5UfrPWobGR2Ry-PnbJUQoklW5lX0uW4JmKqj6OgQui6p-rMdUHfuENpQjbJ3t",
      "bigQuery": {
        "bigQuerySource": {
          "inputUri": "BIGQUERY_URI_2"
        }
      }
    }
  ]
}

后续步骤