Retrieve all partition names in a DashVector collection through the HTTP API.
Prerequisites
Before you begin, ensure that you have:
A DashVector cluster
An API key
The latest version of the DashVector SDK
Endpoint
GET https://{Endpoint}/v1/collections/{CollectionName}/partitionsRequest parameters
| Parameter | Location | Type | Required | Description |
|---|---|---|---|---|
{Endpoint} | Path | String | Yes | The cluster endpoint. You can find it on the cluster details page in the console. |
{CollectionName} | Path | String | Yes | The name of the collection. |
dashvector-auth-token | Request header | String | Yes | The API key. |
Response parameters
| Parameter | Type | Description | Example |
|---|---|---|---|
code | Integer | Status code. 0 indicates success. For details, see Status codes. | 0 |
message | String | Status message. | success |
request_id | String | Unique request ID. | 19215409-ea66-4db9-8764-26ce2eb5bb99 |
output | Array | Partition names in the collection. | ["default", "shoes"] |
Example
Note
Replace <your-api-key> with your API key and <your-cluster-endpoint> with your cluster endpoint. This example uses a collection named quickstart. To create one, see Create a collection.
Request
curl -H 'dashvector-auth-token: <your-api-key>' \
https://<your-cluster-endpoint>/v1/collections/quickstart/partitionsResponse
{
"request_id": "89557fca-50ca-400d-9828-a6c9ba5a4228",
"code": 0,
"message": "",
"output": [
"default",
"shoes"
]
}该文章对您有帮助吗?