如何通过HTTP API获取Collection列表

32 阅读1分钟

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


前提条件

Method与URL

HTTP示例:

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

使用示例

说明

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

Shell示例:

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

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

入参描述

参数Location类型必填说明
{Endpoint}pathstrCluster的Endpoint,可在控制台Cluster详情中查看
dashvector-auth-tokenheaderstrapi-key

出参描述

字段类型描述示例
codeint返回值,参考返回状态码说明0
messagestr返回消息success
request_idstr请求唯一id
outputarray所有Collection名称列表['my_collection1', 'my_collection2']