Manage serving controls

This page describes how to view, edit, delete, export, and import serving controls.

For general information about serving controls and instructions on how to create serving controls, see About serving controls and Create serving controls .

View and edit serving controls

You can view serving controls for Vertex AI Search for commerce using the console and the API.

View and edit serving controls in the console

The Serving Controlstab of the Controls page lists all of your serving controls and their associated serving configs. Click the Edit controlicon for a control to change its settings and associated serving configs in the Edit controlpanel. Click the Delete controlicon for a control to delete it, which also removes it from all serving configs.

You can also see and edit the controls for a specific serving config on the Serving Configspage . Click a serving config to see its Detailspage, which lists all serving controls for that configuration. Click the Edit controlicon for a control to change its settings in the Edit controlpanel. Click the Remove controlicon to dissociate the control from the serving config (this does not delete the control).

It takes a few minutes for newly created or updated controls to be ready to serve live traffic. You can test if your changes have been applied on the console Evaluatepage .

View serving controls inline

To see a single serving control inline, use Control.get .

For more about this method, see the Control.get API reference .

curl  
-X  
GET  
 \ 
-H  
 "Authorization: Bearer 
 $( 
gcloud  
auth  
application-default  
print-access-token ) 
 " 
  
 \ 
-H  
 "Content-Type: application/json; charset=utf-8" 
  
 \ 
 'https://retail.googleapis.com/v2beta/projects/ PROJECT_NUMBER 
/locations/global/catalogs/default_catalog/controls/ CONTROL_ID 
' 

To list multiple serving controls inline, use Controls.list .

Optionally, you can use the parameter pageSize to set a maximum number of results to return. If more results are available, the list response includes a page token. You can pass a page token in the pageToken parameter of a list request to retrieve the next page of results.

To list only the controls associated with a certain serving config, use the filter query parameter to specify the serving config ID.

For more about this method, see the Control.list API reference .

curl  
-X  
GET  
 \ 
-H  
 "Authorization: Bearer 
 $( 
gcloud  
auth  
application-default  
print-access-token ) 
 " 
  
 \ 
-H  
 "Content-Type: application/json; charset=utf-8" 
  
 \ 
 ' 
https://retail.googleapis.com/v2beta/projects/ PROJECT_NUMBER 
/locations/global/catalogs/default_catalog/controls?pageSize = 
 PAGE_SIZE 
 & 
 pageToken 
 = 
 PAGE_TOKEN 
 & 
 filter 
 = 
 servingConfig 
 = 
 SERVING_CONFIG_ID 

Patch serving controls inline

To update fields in a serving control, use Controls.patch and include an instance of Control in the request body. Specify the fields to update with the updateMask parameter, or leave it unset to update all supported fields.

For more about this method, see the Controls.patch API reference .

curl  
-X  
PATCH  
 \ 
-H  
 "Authorization: Bearer 
 $( 
gcloud  
auth  
application-default  
print-access-token ) 
 " 
  
 \ 
-H  
 "Content-Type: application/json; charset=utf-8" 
  
 \ 
-d  
 '{ 
 "name": "projects/ PROJECT_NUMBER 
/locations/global/catalogs/default_catalog/controls/ CONTROL_ID 
", 
 " FIELD_NAME_1 
": " NEW_FIELD_VALUE_1 
" 
 " FIELD_NAME_2 
": " NEW_FIELD_VALUE_2 
" 
 }' 
  
 \ 
 'https://retail.googleapis.com/v2beta/projects/ PROJECT_NUMBER 
/locations/global/catalogs/default_catalog/controls/ CONTROL_ID 
?updateMask= FIELD_NAME_1 
, FIELD_NAME_2 
' 

Add controls to serving configs inline

To add a control to a serving config, use ServingConfig.addControl .

For more about this method, see the ServingConfig.addControl API reference .

For an example of this method, see Manage serving configs .

Remove controls from serving configs inline

To remove a control from a serving config, use ServingConfig.removeControl .

For more about this method, see the ServingConfig.addControl API reference .

For an example of this method, see Manage serving configs .

Delete a serving control

You can delete a serving control from the console or inline using the Controls.delete method.

Delete a serving control in the console

Delete a serving control to remove that control from all serving configs that are using it.

  1. Go to the Controls page in the Search for commerce console.

    Go to the Controls page

  2. In the table row of the control you plan to remove, click Delete.

  3. In the confirmation window, click Deleteto complete the deletion.

Delete a serving control inline

To delete serving controls inline, use Controls.delete .

For more about this method, see the Controls.delete API reference .

curl  
-X  
DELETE  
 \ 
-H  
 "Authorization: Bearer 
 $( 
gcloud  
auth  
application-default  
print-access-token ) 
 " 
  
 \ 
-H  
 "Content-Type: application/json; charset=utf-8" 
  
 \ 
 'https://retail.googleapis.com/v2beta/projects/ PROJECT_NUMBER 
/locations/global/catalogs/default_catalog/controls/ SERVING_CONTROL_ID 
' 

Export serving controls

Preview

This feature is subject to the "Pre-GA Offerings Terms" in the General Service Terms section of the Service Specific Terms . Pre-GA features are available "as is" and might have limited support. For more information, see the launch stage descriptions .

You can export your serving controls to a file in a Cloud Storage bucket.

There are two reasons that you might want to export and import serving controls:

  • To move serving controls from one project to another.

  • To perform a bulk edit on all or some serving controls. Export the serving controls, edit the exported file, and then import the file to change or add serving controls.

You can export and import through the Search for commerce console. When you export serving controls, you export all the serving controls in the project.

To export serving controls, do the following:

  1. Go to the Controls page in the Search for commerce console.

    Go to the Controls page

  2. On the Serving controlstab, click Export controls.

  3. In the Export Serving Controlswindow, select the Cloud Storage bucket to which you want to export the controls file.

  4. Click Export.

    The exported controls are saved to a NDJSON file in the selected bucket with a name in the following format:

    projects_ PROJECT_ID 
    _ TIMESTAMP 
    _exported_controls.ndjson
  5. After the export operation completes, you can see the operation status in the Bulk import, export, delete activitieslist in the Export activitywindow. Open the Export activitywindow by clicking Showin the message window or by following the instructions in See status for a specific integration operation .

Import serving controls

Preview

This feature is subject to the "Pre-GA Offerings Terms" in the General Service Terms section of the Service Specific Terms . Pre-GA features are available "as is" and might have limited support. For more information, see the launch stage descriptions .

To add serving controls or modify existing ones in bulk, you can make your changes in an exported controls file. You can then import them into the original project or into a different project.

Things to know about importing serving controls:

  • You can't import a serving control file if it contains both search and recommendations serving controls.

  • When you import serving controls, all the serving controls in the file become associated with the serving config that you specify on import. If a serving control is already associated with another serving config in the project, that association is also maintained.

To import serving controls, do the following:

  1. Edit and review an exported serving control file and place the file in a Cloud Storage bucket. (To export serving controls, see the preceding task Export serving controls .)

    Ensure that the file contains only search serving controls or only recommendations serving controls. You cannot import a file that contains both types.

  2. Go to the Controls page in the Search for commerce console.

    Go to the Controls page

  3. On the Serving controlstab, click Import controls.

  4. In the Import Serving Controlswindow:

    1. Browse and select the Cloud Storage bucket and NDJSON file that contains the controls that you want to import.

    2. Select the serving config that you want to associate the imported serving controls with.

    3. Review the Import Preview plan. The controls that will be created are displayed on the Newtab and the controls that will be modified are displayed on the Modifiedtab.

  5. Click Import.

    A long-running operation is started to import the new and modified controls.

  6. After the import operation completes, you can see the operation status in the Controlstab of the Activity statuswindow. Open the Activity statuswindow by clicking Showin the message window or by following the instructions in See status for a specific integration operation .

Create a Mobile Website
View Site in Mobile | Classic
Share by: