Memperbarui label

Dengan Vertex AI Feature Store, Anda dapat menambahkan atau memperbarui label ke jenis resource berikut:

Anda dapat menambahkan label selama pembuatan resource atau menambahkan label ke resource yang sudah ada. Perhatikan bahwa penambahan label ke resource ini bersifat opsional.

Memperbarui label untuk grup fitur

Gunakan contoh berikut untuk memperbarui label untuk grup fitur yang ada.

REST

Untuk memperbarui label resource FeatureGroup yang ada, kirim permintaan PATCH menggunakan metode featureGroups.patch.

Sebelum menggunakan salah satu data permintaan, lakukan penggantian berikut:

  • LOCATION_ID: Region tempat grup fitur berada, misalnya us-central1.
  • PROJECT_ID: Project ID Anda.
  • FEATUREGROUP_NAME: Nama grup fitur yang ingin Anda perbarui.
  • LABELS_JSON: Label yang akan dilampirkan ke grup fitur sebagai key-value pair dalam format JSON. Contoh: {"label1_key": "label1_value", "label2_key": "label2_value", ...}

Metode HTTP dan URL:

PATCH https://LOCATION_ID-aiplatform.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION_ID/featureGroups?feature_group_id=FEATUREGROUP_NAME

Isi JSON permintaan:

{
  "labels": LABELS_JSON
}

Untuk mengirim permintaan Anda, pilih salah satu opsi berikut:

curl

Simpan isi permintaan dalam file bernama request.json, dan jalankan perintah berikut:

curl -X PATCH \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json; charset=utf-8" \
-d @request.json \
"https://LOCATION_ID-aiplatform.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION_ID/featureGroups?feature_group_id=FEATUREGROUP_NAME"

PowerShell

Simpan isi permintaan dalam file bernama request.json, dan jalankan perintah berikut:

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

Invoke-WebRequest `
-Method PATCH `
-Headers $headers `
-ContentType: "application/json; charset=utf-8" `
-InFile request.json `
-Uri "https://LOCATION_ID-aiplatform.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION_ID/featureGroups?feature_group_id=FEATUREGROUP_NAME" | Select-Object -Expand Content

Anda akan melihat respons JSON seperti berikut:

{
  "name": "projects/PROJECT_NUMBER/locations/LOCATION_ID/featureGroups/FEATUREGROUP_NAME/operations/OPERATION_ID",
  "metadata": {
    "@type": "type.googleapis.com/google.cloud.aiplatform.v1.UpdateFeatureGroupOperationMetadata",
    "genericMetadata": {
      "createTime": "2023-09-18T03:00:13.060636Z",
      "updateTime": "2023-09-18T03:00:13.060636Z"
    }
  },
  "done": true,
  "response": {
    "@type": "type.googleapis.com/google.cloud.aiplatform.v1.FeatureGroup",
    "name": "projects/PROJECT_NUMBER/locations/LOCATION_ID/featureGroups/FEATUREGROUP_NAME"
  }
}

Memperbarui label untuk fitur

Gunakan contoh berikut guna memperbarui label untuk fitur yang sudah ada.

REST

Untuk memperbarui label resource Feature yang ada, kirim permintaan PATCH menggunakan metode features.patch.

Sebelum menggunakan salah satu data permintaan, lakukan penggantian berikut:

  • LOCATION_ID: Region tempat grup fitur yang berisi fitur berada, seperti us-central1.
  • PROJECT_ID: Project ID Anda.
  • FEATUREGROUP_NAME: Nama grup fitur yang berisi fitur.
  • FEATURE_NAME: Nama fitur yang ingin Anda perbarui.
  • LABELS_JSON: Label yang akan dilampirkan ke fitur sebagai key-value pair dalam format JSON. Contoh: {"label1_key": "label1_value", "label2_key": "label2_value", ...}

Metode HTTP dan URL:

PATCH https://LOCATION_ID-aiplatform.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION_ID/featureGroups/FEATUREGROUP_NAME/features?feature_id=FEATURE_NAME

Isi JSON permintaan:

{
  "labels": LABELS_JSON
}

Untuk mengirim permintaan Anda, pilih salah satu opsi berikut:

curl

Simpan isi permintaan dalam file bernama request.json, dan jalankan perintah berikut:

curl -X PATCH \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json; charset=utf-8" \
-d @request.json \
"https://LOCATION_ID-aiplatform.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION_ID/featureGroups/FEATUREGROUP_NAME/features?feature_id=FEATURE_NAME"

PowerShell

Simpan isi permintaan dalam file bernama request.json, dan jalankan perintah berikut:

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

Invoke-WebRequest `
-Method PATCH `
-Headers $headers `
-ContentType: "application/json; charset=utf-8" `
-InFile request.json `
-Uri "https://LOCATION_ID-aiplatform.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION_ID/featureGroups/FEATUREGROUP_NAME/features?feature_id=FEATURE_NAME" | Select-Object -Expand Content

Anda akan melihat respons JSON seperti berikut:

{
  "name": "projects/PROJECT_NUMBER/locations/LOCATION_ID/featureGroups/FEATUREGROUP_NAME/features/FEATURE_NAME/operations/OPERATION_ID",
  "metadata": {
    "@type": "type.googleapis.com/google.cloud.aiplatform.v1.UpdateFeatureOperationMetadata",
    "genericMetadata": {
      "createTime": "2023-09-18T02:36:22.870679Z",
      "updateTime": "2023-09-18T02:36:22.870679Z"
    }
  },
  "done": true,
  "response": {
    "@type": "type.googleapis.com/google.cloud.aiplatform.v1.Feature",
    "name": "projects/PROJECT_NUMBER/locations/LOCATION_ID/featureGroups/FEATUREGROUP_NAME/features/FEATURE_NAME"
  }
}

Memperbarui label untuk toko online

Gunakan contoh berikut guna memperbarui label untuk instance toko online yang ada.

REST

Untuk memperbarui label resource FeatureOnlineStore yang ada, kirim permintaan PATCH menggunakan metode featureOnlineStores.patch.

Sebelum menggunakan salah satu data permintaan, lakukan penggantian berikut:

  • REGION_ID: Region tempat toko online berada, seperti us-central1.
  • PROJECT_ID: Project ID Anda.
  • FEATUREONLINESTORE_NAME: Nama toko online yang ingin Anda perbarui.
  • LABELS_JSON: Label yang akan dilampirkan ke toko online sebagai key-value pair dalam format JSON. Contoh: {"label1_key": "label1_value", "label2_key": "label2_value", ...}

Metode HTTP dan URL:

PATCH https://REGION_ID-aiplatform.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION_ID/featureOnlineStores?feature_online_store_id=FEATUREONLINESTORE_NAME

Isi JSON permintaan:

{
  "labels": LABELS_JSON
}

Untuk mengirim permintaan Anda, pilih salah satu opsi berikut:

curl

Simpan isi permintaan dalam file bernama request.json, dan jalankan perintah berikut:

curl -X PATCH \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json; charset=utf-8" \
-d @request.json \
"https://REGION_ID-aiplatform.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION_ID/featureOnlineStores?feature_online_store_id=FEATUREONLINESTORE_NAME"

PowerShell

Simpan isi permintaan dalam file bernama request.json, dan jalankan perintah berikut:

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

Invoke-WebRequest `
-Method PATCH `
-Headers $headers `
-ContentType: "application/json; charset=utf-8" `
-InFile request.json `
-Uri "https://REGION_ID-aiplatform.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION_ID/featureOnlineStores?feature_online_store_id=FEATUREONLINESTORE_NAME" | Select-Object -Expand Content

Anda akan menerima respons JSON yang mirip seperti berikut:

{
  "name": "projects/PROJECT_NUMBER/locations/LOCATION_ID/featureOnlineStores/FEATUREONLINESTORE_NAME/operations/OPERATION_ID",
  "metadata": {
    "@type": "type.googleapis.com/google.cloud.aiplatform.v1.CreateFeatureOnlineStoreOperationMetadata",
    "genericMetadata": {
      "createTime": "2023-09-18T17:49:23.847496Z",
      "updateTime": "2023-09-18T17:49:23.847496Z"
    }
  },
  "done": true,
  "response": {
    "@type": "type.googleapis.com/google.cloud.aiplatform.v1.FeatureView",
    "name": "projects/PROJECT_NUMBER/locations/LOCATION_ID/featureOnlineStores/FEATUREONLINESTORE_NAME"
  }
}

Memperbarui label untuk tampilan fitur

Gunakan contoh berikut guna memperbarui label untuk tampilan fitur yang sudah ada.

REST

Untuk memperbarui label resource FeatureView yang ada, kirim permintaan PATCH menggunakan metode featureViews.patch.

Sebelum menggunakan data permintaan mana pun, lakukan beberapa penggantian berikut:

  • LOCATION_ID: Region tempat toko online berada, seperti us-central1.
  • PROJECT_ID: Project ID Anda.
  • FEATUREONLINESTORE_NAME: Nama penyimpanan online yang berisi tampilan fitur.
  • FEATUREVIEW_NAME: Nama tampilan fitur yang ingin Anda perbarui.
  • LABELS_JSON: Label yang akan dilampirkan ke tampilan fitur sebagai key-value pair dalam format JSON. Contoh: {"label1_key": "label1_value", "label2_key": "label2_value", ...}

Metode HTTP dan URL:

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

Isi JSON permintaan:

{
  "labels": LABELS_JSON
}

Untuk mengirim permintaan Anda, pilih salah satu opsi berikut:

curl

Simpan isi permintaan dalam file bernama request.json, dan jalankan perintah berikut:

curl -X PATCH \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json; charset=utf-8" \
-d @request.json \
"https://LOCATION_ID-aiplatform.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION_ID/featureOnlineStores/FEATUREONLINESTORE_NAME/featureViews/FEATUREVIEW_NAME"

PowerShell

Simpan isi permintaan dalam file bernama request.json, dan jalankan perintah berikut:

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

Invoke-WebRequest `
-Method PATCH `
-Headers $headers `
-ContentType: "application/json; charset=utf-8" `
-InFile request.json `
-Uri "https://LOCATION_ID-aiplatform.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION_ID/featureOnlineStores/FEATUREONLINESTORE_NAME/featureViews/FEATUREVIEW_NAME" | Select-Object -Expand Content

Anda akan melihat respons JSON yang mirip dengan berikut ini:

{
  "name": "projects/PROJECT_NUMBER/locations/LOCATION_ID/featureOnlineStores/FEATUREONLINESTORE_NAME/featureViews/FEATUREVIEW_NAME/operations/OPERATION_ID",
  "metadata": {
    "@type": "type.googleapis.com/google.cloud.aiplatform.v1.UpdateFeatureViewOperationMetadata",
    "genericMetadata": {
      "createTime": "2023-09-15T04:53:34.832192Z",
      "updateTime": "2023-09-15T04:53:34.832192Z"
    }
  },
  "done": true,
  "response": {
    "@type": "type.googleapis.com/google.cloud.aiplatform.v1.FeatureView",
    "name": "projects/PROJECT_NUMBER/locations/LOCATION_ID/featureOnlineStores/FEATUREONLINESTORE_NAME/featureViews/FEATUREVIEW_NAME"
  }
}

Langkah selanjutnya