Delete a partition and all its data from a DashVector collection through the HTTP API.
Deleting a partition is irreversible. All vectors and data in the partition are permanently deleted and cannot be recovered.
Prerequisites
Before you begin, make sure that you have:
A DashVector cluster. For more information, see Create a cluster
An API key. For more information, see Manage API keys
The latest version of the DashVector SDK. For more information, see Install DashVector SDK
Request syntax
DELETE https://{Endpoint}/v1/collections/{CollectionName}/partitions/{PartitionName}Request parameters
| Parameter | Location | Type | Required | Description |
|---|---|---|---|---|
{Endpoint} | Path | String | Yes | The cluster endpoint. Find this on the cluster details page in the console. |
{CollectionName} | Path | String | Yes | The collection name. |
{PartitionName} | Path | String | Yes | The partition name. |
dashvector-auth-token | Header | String | Yes | The API key. |
Response parameters
| Parameter | Type | Description | Example |
|---|---|---|---|
code | Integer | The status code. 0 indicates success. For other values, see Status codes. | 0 |
message | String | The response message. Empty on success. | "" |
request_id | String | The unique request ID. Use this for troubleshooting. | 19215409-ea66-4db9-8764-26ce2eb5bb99 |
Example
This example deletes a partition named shoes from the quickstart collection.
Before running this example, make sure that you have:
Created a collection named
quickstart. See the "Example" section of Create a collection.Created a partition named
shoes. See the "Example" section of Create a partition.
Replace the placeholders with your actual values:
| Placeholder | Description |
|---|---|
<your-api-key> | API key for your DashVector cluster |
<your-cluster-endpoint> | Endpoint of your DashVector cluster |
Request
curl -X DELETE \
-H 'dashvector-auth-token: <your-api-key>' \
https://<your-cluster-endpoint>/v1/collections/quickstart/partitions/shoesResponse
A successful response returns code: 0:
{
"request_id": "40a883e4-4101-4045-b9e5-c1996ffd1034",
"code": 0,
"message": ""
}What's next
List partitions -- Confirm the partition no longer exists.
Create a partition -- Add a new partition to a collection.
Status codes -- API response code reference.