本文由簡體中文內容自動轉碼而成。阿里雲不保證此自動轉碼的準確性、完整性及時效性。本文内容請以簡體中文版本為準。
本文介紹如何通過HTTP API擷取一個已建立的Collection的狀態和Schema資訊。
前提條件
Method與URL
使用樣本
說明
需要使用您的api-key替換樣本中的YOUR_API_KEY、您的Cluster Endpoint替換樣本中的YOUR_CLUSTER_ENDPOINT,代碼才能正常運行。
本樣本需要參考建立Collection-使用樣本提前建立好名稱為quickstart
的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"
# }
# }
# }
入參描述
參數 | Location | 類型 | 必填 | 說明 |
{Endpoint} | path | str | 是 | Cluster的Endpoint,可在控制台Cluster詳情中查看 |
{CollectionName} | path | str | 是 | 您已建立的Collection名稱 |
dashvector-auth-token | header | str | 是 | api-key |
出參描述
欄位 | 類型 | 描述 | 樣本 |
code | int | 傳回值,參考返回狀態代碼說明 | 0 |
message | str | 返回訊息 | success |
request_id | str | 請求唯一id | 19215409-ea66-4db9-8764-26ce2eb5bb99 |
output | object | 參考CollectionMeta | |