删除特征组

删除特征组时,系统会自动取消注册针对该特征组注册的所有 BigQuery 数据源。如果特征组包含现有特征,您可以使用 force 查询参数删除特征组。删除特征组会从 Feature Registry 中取消注册 BigQuery 表或视图,且不会影响这些数据源中包含的特征数据。

准备工作

向 Gemini Enterprise Agent Platform 进行身份验证,除非您已完成此操作。

选择标签页以了解您打算如何使用本页面上的示例:

控制台

当您使用 Cloud de Confiance 控制台访问 Cloud de Confiance by S3NS 服务和 API 时,无需设置身份验证。

REST

如需在本地开发环境中使用本页面上的 REST API 示例,请使用您提供给 gcloud CLI 的凭证。

    安装 Google Cloud CLI,然后 使用联合身份登录 gcloud CLI。

如需了解详情,请参阅 Cloud de Confiance 身份验证文档中的使用 REST 时进行身份验证。

删除特征组

使用以下示例可删除特征组及其特征。

控制台

按照以下说明使用 Cloud de Confiance 控制台删除特征组及其所有特征。

  1. 在 Cloud de Confiance 控制台的 Agent Platform 部分中,前往 Feature Store 页面。

    转到 Feature Store 页面

  2. 在特征组部分中,选中要删除的特征组旁边的复选框。

  3. 点击删除,然后点击确认。

REST

如需删除 FeatureGroup 资源,请使用 featureGroups.delete 方法发送 DELETE 请求。

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

  • LOCATION_ID:特征组所在的区域,例如 us-central1。
  • PROJECT_ID:您的项目 ID。
  • FEATURE_GROUP_NAME:您要删除的特征组的名称。
  • BOOLEAN(可选):要删除特征组(即使它包含特征),请输入 true。默认值为 false。

HTTP 方法和网址:

DELETE https://LOCATION_ID-aiplatform.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION_ID/featureGroups/FEATURE_GROUP_NAME?force=BOOLEAN

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

curl

执行以下命令:

curl -X DELETE \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
"https://LOCATION_ID-aiplatform.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION_ID/featureGroups/FEATURE_GROUP_NAME?force=BOOLEAN"

PowerShell

执行以下命令:

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

Invoke-WebRequest `
-Method DELETE `
-Headers $headers `
-Uri "https://LOCATION_ID-aiplatform.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION_ID/featureGroups/FEATURE_GROUP_NAME?force=BOOLEAN" | Select-Object -Expand Content

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

{
  "name": "projects/PROJECT_NUMBER/locations/LOCATION_ID/operations/OPERATION_ID",
  "metadata": {
    "@type": "type.googleapis.com/google.cloud.aiplatform.v1.DeleteOperationMetadata",
    "genericMetadata": {
      "createTime": "2023-09-15T04:54:03.632646Z",
      "updateTime": "2023-09-15T04:54:03.632646Z"
    }
  },
  "done": true,
  "response": {
    "@type": "type.googleapis.com/google.protobuf.Empty"
  }
}

后续步骤