You can only delete a schema if all the documents associated with the schema
are already deleted. Otherwise, the request fails with the error Active documents
exists for schema SCHEMA_NAME. Please clean up all the documents first. To
delete the documents, see Purge data from a data
store.
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 Gemini Enterprise 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"Replace the following:
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 Gemini Enterprise quickstart using client libraries. For more information, see the Gemini Enterprise C# API reference documentation.
To authenticate to Gemini 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 Gemini Enterprise quickstart using client libraries. For more information, see the Gemini Enterprise Go API reference documentation.
To authenticate to Gemini 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 Gemini Enterprise quickstart using client libraries. For more information, see the Gemini Enterprise Java API reference documentation.
To authenticate to Gemini 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 Gemini Enterprise quickstart using client libraries. For more information, see the Gemini Enterprise Python API reference documentation.
To authenticate to Gemini 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 Gemini Enterprise quickstart using client libraries. For more information, see the Gemini Enterprise Ruby API reference documentation.
To authenticate to Gemini Enterprise, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.