Describe a collection
This topic describes how to use the HTTP API to retrieve the status and schema information of a collection.
Prerequisites
A cluster has been created. For more information, see Create a cluster.
You have obtained an API key. For more information, see Manage API keys.
Method and URL
GET https://{Endpoint}/v1/collections/{CollectionName}Example
To run the code, replace YOUR_API_KEY with your API key and YOUR_CLUSTER_ENDPOINT with your cluster Endpoint.
Before you run this example, create a collection named
quickstart. For more information, see the example in Create a collection.
curl -H 'dashvector-auth-token: YOUR_API_KEY' \
https://YOUR_CLUSTER_ENDPOINT/v1/collections/quickstart
# example output:
# {
# "request_id": "8d3ac14e-5382-4736-b77c-4318761ddfab",
# "code": 0,
# "message": "",
# "output": {
# "name": "quickstart",
# "dimension": 4,
# "dtype": "FLOAT",
# "metric": "dotproduct",
# "fields_schema": {
# "name": "STRING",
# "age": "INT",
# "height": "FLOAT"
# },
# "status": "SERVING",
# "partitions": {
# "shoes": "SERVING",
# "default": "SERVING"
# }
# }
# }Request parameters
Parameter | Location | Type | Required | Description |
{Endpoint} | path | str | Yes | The Endpoint of the cluster. You can find the Endpoint on the Cluster Details page in the console. For more information, see Cluster details. |
{CollectionName} | path | str | Yes | The name of the collection. |
dashvector-auth-token | header | str | Yes | API key |
Response parameters
Field | Type | Description | Example |
code | int | The return value. For more information, see Status codes. | 0 |
message | str | The returned message. | success |
request_id | str | The unique ID of the request. | 19215409-ea66-4db9-8764-26ce2eb5bb99 |
output | object | For more information, see CollectionMeta. |