全部產品
Search
文件中心

Object Storage Service:GetVectorIndex

更新時間:Sep 25, 2025

調用GetVectorIndex介面擷取向量索引的詳細資料。

許可權說明

阿里雲帳號預設擁有全部許可權。阿里雲帳號下的RAM使用者或RAM角色預設沒有任何許可權,需要阿里雲帳號或帳號管理員通過RAM PolicyBucket Policy授予操作許可權。

API

Action

說明

GetVectorIndex

oss:GetVectorIndex

擷取向量索引資訊。

請求文法

POST /?getVectorIndex HTTP/1.1
Host: examplebucket-123***456.cn-hangzhou.oss-vectors.aliyuncs.com
Date: GMT Date
Authorization: SignatureValue
{
   "indexName": "string"
}

要求標頭

此介面僅涉及公用要求標頭。更多資訊,請參見公用HTTP頭定義

請求參數

名稱

資料類型

是否必選

樣本值

描述

indexName

字串

vectorindex1

索引名稱。

回應標頭

此介面僅涉及公用回應標頭。更多資訊,請參見公用HTTP頭定義

響應元素

名稱

資料類型

樣本值

描述

index

容器

-

儲存向量索引資訊的容器。

indexName

字串

vectorindex1

索引名稱。

父節點:index

createTime

字串

2025-04-17T10:56:21.000Z

索引的建立時間,格式為GMT時間。

父節點:index

dataType

字串

float32

向量資料類型。

父節點:index

dimension

整型

1024

向量維度。

父節點:index

distanceMetric

字串

euclidean

距離度量函數。

父節點:index

metadata

容器

-

中繼資料配置。

父節點:index

nonFilterableMetadataKeys

字串數組

["category", "timestamp"]

非過濾中繼資料欄位列表。

父節點:metadata

status

字串

enable

索引當前的狀態。取值:

  • creating(建立中)

  • enable(可用)

  • deleting(刪除中)

樣本

請求樣本

POST /?getVectorIndex HTTP/1.1
Host: examplebucket-123***456.cn-hangzhou.oss-vectors.aliyuncs.com
Date: Thu, 17 Apr 2025 01:33:47 GMT
Authorization: OSS4-HMAC-SHA256 Credential=LTAI********************/20250417/cn-hangzhou/oss/aliyun_v4_request,Signature=a7c3554c729d71929e0b84489addee6b2e8d5cb48595adfc51868c299c0c218

{
   "indexName": "vectorindex1"
}

返回樣本

HTTP/1.1 200 OK
x-oss-request-id: 534B371674E88A4D8906****
Date: Thu, 17 Apr 2025 01:33:47 GMT
Connection: keep-alive
Server: AliyunOSS
Content-type: application/json

{
   "index": { 
      "createTime": "2025-04-17T10:56:21.000Z",
      "dataType": "float32",
      "dimension": 1024,
      "distanceMetric": "euclidean",
      "metadata": { 
         "nonFilterableMetadataKeys": ["category", "timestamp"]
      },
      "status": "enable"
   }
}

錯誤碼

錯誤碼

HTTP狀態代碼

描述

VectorIndexParameterInvalid

400

請求中提供的向量索引參數不合法。

MalformedJson

400

請求體中的 JSON 格式不符合規範。

AccessDenied

403

返回該錯誤的可能原因如下:

  • 發起請求時沒有傳入使用者驗證資訊。

  • 沒有操作許可權。

NoSuchVectorIndex

404

目標向量索引不存在。