Method: projects.locations.products.purge
Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
API Asinkron untuk menghapus semua Product di ProductSet atau semua Product yang tidak ada di ProductSet.
Jika Product adalah anggota ProductSet yang ditentukan selain ProductSets lainnya, Product tersebut akan tetap dihapus.
Sebaiknya jangan menghapus ProductSet yang ditentukan hingga operasi ini selesai. Sebaiknya Anda juga tidak menambahkan Product apa pun yang terlibat dalam penghapusan batch ke ProductSet baru saat operasi ini berjalan karena Product tersebut mungkin tetap dihapus.
Operasi products.purge tidak dapat diurungkan. Oleh karena itu, sebaiknya simpan file csv yang digunakan di productSets.import (jika itu adalah cara Anda membuat Set Produk awalnya) sebelum memulai products.purge, jika Anda perlu mengimpor ulang data setelah dihapus.
Jika rencananya adalah untuk menghapus semua Product dari ProductSet, lalu menggunakan kembali ProductSet yang kosong untuk mengimpor ulang Product baru ke ProductSet yang kosong, Anda harus menunggu sampai operasi products.purge untuk ProductSet tersebut selesai.
API google.longrunning.Operation
dapat digunakan untuk melacak progres dan hasil permintaan. Operation.metadata
berisi BatchOperationMetadata
. (progres)
Permintaan HTTP
POST https://vision.googleapis.com/v1/{parent=projects/*/locations/*}/products:purge
URL menggunakan sintaks gRPC Transcoding.
Parameter jalur
Parameter |
parent |
string
Wajib. Project dan lokasi Product harus dihapus. Format adalah projects/PROJECT_ID/locations/LOC_ID .
|
Isi permintaan
Isi permintaan memuat data dengan struktur berikut:
Representasi JSON |
{
"force": boolean,
// Union field target can be only one of the following:
"productSetPurgeConfig": {
object (ProductSetPurgeConfig )
},
"deleteOrphanProducts": boolean
// End of list of possible types for union field target .
} |
Kolom |
force |
boolean
Nilai defaultnya adalah false. Ganti nilai ini ke benar untuk benar-benar menghapus permanen.
|
Kolom union target . Product yang akan dihapus. target hanya ada berupa salah satu diantara berikut: |
productSetPurgeConfig |
object (ProductSetPurgeConfig )
Tentukan ProductSet mana yang berisi Product yang akan dihapus.
|
deleteOrphanProducts |
boolean
Jika deleteOrphanProducts benar, semua Product yang tidak ada dalam ProductSet akan dihapus.
|
Isi respons
Jika berhasil, isi respons akan berisi instance Operation
.
Cakupan Otorisasi
Memerlukan salah satu cakupan OAuth berikut:
https://www.googleapis.com/auth/cloud-platform
https://www.googleapis.com/auth/cloud-vision
Untuk mengetahui informasi selengkapnya, lihat Ringkasan Autentikasi.
ProductSetPurgeConfig
Konfigurasi untuk mengontrol ProductSet mana yang berisi Product yang akan dihapus.
Representasi JSON |
{
"productSetId": string
} |
Kolom |
productSetId |
string
ProductSet yang berisi Product yang akan dihapus. Jika Product adalah anggota productSetId selain ProductSets lainnya, Product tersebut akan tetap dihapus.
|
Kecuali dinyatakan lain, konten di halaman ini dilisensikan berdasarkan Lisensi Creative Commons Attribution 4.0, sedangkan contoh kode dilisensikan berdasarkan Lisensi Apache 2.0. Untuk mengetahui informasi selengkapnya, lihat Kebijakan Situs Google Developers. Java adalah merek dagang terdaftar dari Oracle dan/atau afiliasinya.
Terakhir diperbarui pada 2025-07-30 UTC.
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Sulit dipahami","hardToUnderstand","thumb-down"],["Informasi atau kode contoh salah","incorrectInformationOrSampleCode","thumb-down"],["Informasi/contoh yang saya butuhkan tidak ada","missingTheInformationSamplesINeed","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 2025-07-30 UTC."],[],[],null,["# Method: projects.locations.products.purge\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Request body](#body.request_body)\n - [JSON representation](#body.request_body.SCHEMA_REPRESENTATION)\n- [Response body](#body.response_body)\n- [Authorization Scopes](#body.aspect)\n- [ProductSetPurgeConfig](#ProductSetPurgeConfig)\n - [JSON representation](#ProductSetPurgeConfig.SCHEMA_REPRESENTATION)\n\nAsynchronous API to delete all Products in a ProductSet or all Products that are in no ProductSet.\n\nIf a Product is a member of the specified ProductSet in addition to other ProductSets, the Product will still be deleted.\n\nIt is recommended to not delete the specified ProductSet until after this operation has completed. It is also recommended to not add any of the Products involved in the batch delete to a new ProductSet while this operation is running because those Products may still end up deleted.\n\nIt's not possible to undo the products.purge operation. Therefore, it is recommended to keep the csv files used in productSets.import (if that was how you originally built the Product Set) before starting products.purge, in case you need to re-import the data after deletion.\n\nIf the plan is to purge all of the Products from a ProductSet and then re-use the empty ProductSet to re-import new Products into the empty ProductSet, you must wait until the products.purge operation has finished for that ProductSet.\n\nThe [google.longrunning.Operation](/vision/product-search/docs/reference/rest/v1/locations.operations#Operation) API can be used to keep track of the progress and results of the request. `Operation.metadata` contains `BatchOperationMetadata`. (progress)\n\n### HTTP request\n\n`POST https://vision.googleapis.com/v1/{parent=projects/*/locations/*}/products:purge`\n\nThe URL uses [gRPC Transcoding](https://github.com/googleapis/googleapis/blob/master/google/api/http.proto) syntax.\n\n### Path parameters\n\n### Request body\n\nThe request body contains data with the following structure:\n\n### Response body\n\nIf successful, the response body contains an instance of [Operation](/vision/product-search/docs/reference/rest/v1/locations.operations#Operation).\n\n### Authorization Scopes\n\nRequires one of the following OAuth scopes:\n\n- `https://www.googleapis.com/auth/cloud-platform`\n- `https://www.googleapis.com/auth/cloud-vision`\n\nFor more information, see the [Authentication Overview](https://cloud.google.com/docs/authentication/).\n\nProductSetPurgeConfig\n---------------------\n\nConfig to control which ProductSet contains the Products to be deleted."]]