You can only delete a schema if all of the documents associated with the schema
are deleted. Otherwise, the attempt fails. After you delete a schema, you can
call the schemas.create
method to create a new one.
To delete a schema for structured data, follow these steps:
REST
Find your data store ID. If you already have your data store ID, skip to the next step.
In the Google Cloud console, go to the Agentspace page and in the navigation menu, click Data Stores.
Click the name of your data store.
On the Data page for your data store, get the data store ID.
Delete your schema.
curl -X DELETE \ -H "Authorization: Bearer $(gcloud auth print-access-token)" \ -H "Content-Type: application/json" \ "https://discoveryengine.googleapis.com/v1beta/projects/PROJECT_ID/locations/global/collections/default_collection/dataStores/DATA_STORE_ID/schemas/default_schema"
- PROJECT_ID: the ID of your project.
- DATA_STORE_ID: the ID of the data store.
C#
Before trying this sample, follow the C# setup instructions in the Agentspace Enterprise quickstart using client libraries. For more information, see the Agentspace Enterprise C# API reference documentation.
To authenticate to Agentspace Enterprise, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Go
Before trying this sample, follow the Go setup instructions in the Agentspace Enterprise quickstart using client libraries. For more information, see the Agentspace Enterprise Go API reference documentation.
To authenticate to Agentspace Enterprise, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Java
Before trying this sample, follow the Java setup instructions in the Agentspace Enterprise quickstart using client libraries. For more information, see the Agentspace Enterprise Java API reference documentation.
To authenticate to Agentspace Enterprise, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Python
Before trying this sample, follow the Python setup instructions in the Agentspace Enterprise quickstart using client libraries. For more information, see the Agentspace Enterprise Python API reference documentation.
To authenticate to Agentspace Enterprise, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Ruby
Before trying this sample, follow the Ruby setup instructions in the Agentspace Enterprise quickstart using client libraries. For more information, see the Agentspace Enterprise Ruby API reference documentation.
To authenticate to Agentspace Enterprise, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.