GetVectorIndex

调用GetVectorIndex接口获取向量索引的详细信息。

权限说明

阿里云账号默认拥有全部权限。阿里云账号下的RAM用户或RAM角色默认没有任何权限,需要阿里云账号或账号管理员通过RAM PolicyBucket Policy授予操作权限。

API

Action

说明

GetVectorIndex

oss:GetVectorIndex

获取向量索引信息。

请求语法

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

请求头

此接口仅涉及公共请求头。更多信息,请参见公共HTTP头定义

请求参数

名称

数据类型

是否必选

示例值

描述

indexName

字符串

my-vector-index

索引名称。

响应头

此接口仅涉及公共响应头。更多信息,请参见公共HTTP头定义

响应元素

名称

数据类型

示例值

描述

index

容器

-

保存向量索引信息的容器。

indexName

字符串

my-vector-index

索引名称。

父节点: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: exampebucket-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": "my-vector-index"
}

返回示例

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": "active"
   }
}