本文介紹如何通過HTTP API刪除Collection中一個已存在的Partition。
刪除Partition後,該Partition所有資料將刪除且不可恢複,請謹慎操作
前提條件
Method與URL
HTTP
DELETE https://{Endpoint}/v1/collections/{CollectionName}/partitions/{PartitionName}
使用樣本
需要使用您的api-key替換樣本中的YOUR_API_KEY、您的Cluster Endpoint替換樣本中的YOUR_CLUSTER_ENDPOINT,代碼才能正常運行。
本樣本需要參考建立Collection-使用樣本提前建立好名稱為
quickstart
的Collection本樣本需要參考建立Partition-使用樣本提前建立好名稱為
shoes
的Partition
Shell
curl -XDELETE -H 'dashvector-auth-token: YOUR_API_KEY' \
https://YOUR_CLUSTER_ENDPOINT/v1/collections/quickstart/partitions/shoes
# example output:
# {"request_id":"40a883e4-4101-4045-b9e5-c1996ffd1034","code":0,"message":""}
入參描述
參數 | Location | 類型 | 必填 | 說明 |
{Endpoint} | path | str | 是 | Cluster的Endpoint,可在控制台Cluster詳情中查看 |
{CollectionName} | path | str | 是 | Collection名稱 |
{PartitionName} | path | str | 是 | Partition名稱 |
dashvector-auth-token | header | str | 是 | api-key |
出參描述
欄位 | 類型 | 描述 | 樣本 |
code | int | 傳回值,參考返回狀態代碼說明 | 0 |
message | str | 返回訊息 | success |
request_id | str | 請求唯一id | 19215409-ea66-4db9-8764-26ce2eb5bb99 |