如何通过HTTP API获取Partition列表

17 阅读1分钟

本文介绍如何通过HTTP API获取Collection中所有Partition名称的列表。

前提条件

Method与URL

HTTP

GET https://{Endpoint}/v1/collections/{CollectionName}/partitions

使用示例

说明

  1. 需要使用您的api-key替换示例中的YOUR_API_KEY、您的Cluster Endpoint替换示例中的YOUR_CLUSTER_ENDPOINT,代码才能正常运行。

  2. 本示例需要参考新建Collection-使用示例提前创建好名称为quickstart的Collection

Shell

curl -H 'dashvector-auth-token: YOUR_API_KEY' \
 https://YOUR_CLUSTER_ENDPOINT/v1/collections/quickstart/partitions

# example output:
# {
#   "request_id": "89557fca-50ca-400d-9828-a6c9ba5a4228",
#   "code": 0,
#   "message": "",
#   "output": [
#     "default",
#     "shoes",
#   ]
# }