刪除特徵群組

刪除特徵群組時,系統會自動取消註冊該特徵群組的任何 BigQuery 資料來源。如果特徵群組包含現有特徵,您可以使用 force 查詢參數刪除特徵群組。刪除特徵群組會從特徵註冊庫取消註冊 BigQuery 資料表或檢視區塊,且不會影響這些資料來源中包含的特徵資料。

事前準備

向 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. 依序點選「Delete」(刪除) 和「Confirm」(確認)

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"
  }
}

後續步驟