删除特征视图

删除特征视图不会取消正在进行的在线传送操作。您需要从要删除的特征视图中停止当前处于活动状态的所有在线传送操作。否则,在线传送操作会在您删除特征视图后失败。

准备工作

向 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

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

删除特征视图实例

使用以下示例可从项目中的在线存储区中删除特征视图。

控制台

请按照以下说明使用 Google Cloud 控制台删除特征视图。

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

    转到 Feature Store 页面

  2. 点击在线存储区

  3. 点击在线存储区的名称,在在线存储区详情页面上查看其详细信息。

  4. 特征视图部分中,选择要删除的特征视图旁边的复选框。

  5. 点击删除,然后点击确认

REST

如需删除 FeatureView 实例,请使用 featureViews.delete 方法发送 DELETE 请求。

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

  • LOCATION_ID:在线存储区所在的区域,例如 us-central1
  • PROJECT_ID:您的项目 ID。
  • FEATUREONLINESTORE_NAME:包含特征视图的在线存储区的名称。
  • FEATUREVIEW_NAME:要删除的特征视图的名称。

HTTP 方法和网址:

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

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

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/featureOnlineStores/FEATUREONLINESTORE_NAME/featureViews/FEATUREVIEW_NAME"

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/featureOnlineStores/FEATUREONLINESTORE_NAME/featureViews/FEATUREVIEW_NAME" | Select-Object -Expand Content

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

{
  "name": "projects/PROJECT_NUMBER/locations/LOCATION_ID/featureOnlineStores/FEATUREONLINESTORE_NAME/operations/OPERATION_ID",
  "metadata": {
    "@type": "type.googleapis.com/google.cloud.aiplatform.v1.DeleteOperationMetadata",
    "genericMetadata": {
      "createTime": "2023-09-15T17:30:31.741064Z",
      "updateTime": "2023-09-15T17:30:31.741064Z"
    }
  }
}

后续步骤