刪除地圖項目

您可以從特徵群組中刪除特定特徵。刪除特徵會從特徵註冊庫取消註冊特徵資料欄,且不會影響已註冊 BigQuery 來源資料表或檢視表中資料欄的資料。如有需要,您可以在任何特徵群組中建立其他特徵,再次註冊相同資料欄。

事前準備

向 Vertex AI 進行驗證 (如果尚未完成)。

如要在本機開發環境中使用本頁的 REST API 範例,請使用您提供給 gcloud CLI 的憑證。

    After installing the Google Cloud CLI, initialize it by running the following command:

    gcloud init

    If you're using an external identity provider (IdP), you must first sign in to the gcloud CLI with your federated identity.

詳情請參閱 Google Cloud 驗證說明文件中的「Authenticate for using REST」。

刪除特徵

使用下列範例從特徵群組中刪除特徵。

REST

如要刪除 Feature 資源,請使用 features.delete 方法傳送 DELETE 要求。

使用任何要求資料之前,請先替換以下項目:

  • LOCATION_ID:特徵群組所在的區域,例如 us-central1
  • PROJECT_ID:您的專案 ID。
  • FEATURE_GROUP_NAME:包含特徵的特徵群組名稱。
  • FEATURE_NAME:要刪除的功能名稱。

HTTP 方法和網址:

DELETE https://LOCATION_ID-aiplatform.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION_ID/featureGroups/FEATURE_GROUP_NAME/features/FEATURE_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/featureGroups/FEATURE_GROUP_NAME/features/FEATURE_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/featureGroups/FEATURE_GROUP_NAME/features/FEATURE_NAME" | 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-25T18:52:42.092928Z",
      "updateTime": "2023-09-25T18:52:42.092928Z"
    }
  },
  "done": true,
  "response": {
    "@type": "type.googleapis.com/google.protobuf.Empty"
  }
}

後續步驟