Method: projects.locations.products.purge

Asynchronous API to delete all Products in a ProductSet or all Products that are in no ProductSet.

If a Product is a member of the specified ProductSet in addition to other ProductSets, the Product will still be deleted.

It 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.

It'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.

If 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.

The google.longrunning.Operation API can be used to keep track of the progress and results of the request. Operation.metadata contains BatchOperationMetadata. (progress)

HTTP request

POST https://vision.googleapis.com/v1p4beta1/{parent=projects/*/locations/*}/products:purge

The URL uses gRPC Transcoding syntax.

Path parameters

Parameters
parent

string

Required. The project and location in which the Products should be deleted.

Format is projects/PROJECT_ID/locations/LOC_ID.

Request body

The request body contains data with the following structure:

JSON representation
{
  "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.
}
Fields
force

boolean

The default value is false. Override this value to true to actually perform the purge.

Union field target. The Products to delete. target can be only one of the following:
productSetPurgeConfig

object (ProductSetPurgeConfig)

Specify which ProductSet contains the Products to be deleted.

deleteOrphanProducts

boolean

If deleteOrphanProducts is true, all Products that are not in any ProductSet will be deleted.

Response body

If successful, the response body contains an instance of Operation.

Authorization Scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/cloud-platform
  • https://www.googleapis.com/auth/cloud-vision

For more information, see the Authentication Overview.

ProductSetPurgeConfig

Config to control which ProductSet contains the Products to be deleted.

JSON representation
{
  "productSetId": string
}
Fields
productSetId

string

The ProductSet that contains the Products to delete. If a Product is a member of productSetId in addition to other ProductSets, the Product will still be deleted.

Try it!