Describe a partition
This topic describes how to retrieve the status of a partition in a collection by using the DashVector SDK for Python.
Prerequisites
You have created a cluster: Create a cluster.
You have obtained an API key: API Key Management.
You have installed the latest version of the SDK: Install the DashVector SDK.
API definition
Collection.describe_partition(name: str) -> DashVectorResponseExample
To run the example code, replace YOUR_API_KEY and YOUR_CLUSTER_ENDPOINT with your API key and cluster endpoint.
Create a collection named
quickstart. For more information, see the example in Create a collection.Create a partition named
shoes. For more information, see the example in Create a partition.
import dashvector
client = dashvector.Client(
api_key='YOUR_API_KEY',
endpoint='YOUR_CLUSTER_ENDPOINT'
)
collection = client.get(name='quickstart')
ret = collection.describe_partition('shoes')
print(ret)
# example output:
# {"request_id":"296267a7-68e2-483a-87e6-5992d85a5806","code":0,"message":"","output":"SERVING"}Request parameters
Parameter | Type | Default | Description |
name | str | - | The name of the partition. |
Response parameters
The operation returns a DashVectorResponse object. The following table describes the fields in this object.
Field | Type | Description | Example |
code | int | The status code returned for the request. A value of 0 indicates success. For more information, see Status codes. | 0 |
message | str | The response message. | success |
request_id | str | The request ID. | 19215409-ea66-4db9-8764-26ce2eb5bb99 |
output | str | The status of the partition. For more information, see Status. | SERVING |