功能描述
查询命名空间的 Schema。命名空间由路径中的
:namespace 指定,向量桶由 Host 指定。授权说明
请求
请求示例
POST /_native/<namespace>/_get_namespace HTTP/1.1Host: <bucket>.vectors.<Region>.coslake.comDate: GMT DateContent-Type: application/jsonContent-Length: 0Authorization: Auth String
说明:
Host:
<bucket>.vectors.<Region>.coslake.com,其中 <Region> 为可用地域。向量桶:向量桶名称采用
<name>-<appid> 格式,例如 examplebucket-1250000000。名称支持小写字母、数字和短横线(-),首尾必须是小写字母或数字,总长度为3 - 63字节,不得包含 ..,末尾必须为数字 APPID。目标向量桶必须为增强型(ENHANCED)。命名空间:由小写字母、数字、短横线(-)和点(.)组成,首尾必须是小写字母或数字,长度为3 - 63字节,不得包含
..。Authorization:Auth String,详情请参见 请求签名 文档。
请求参数
此接口无请求参数。
请求头
请求体
请求体可为空或
{},不接受其他字段。目标不存在时返回 NotFoundException。响应
响应头
响应体
{"namespace": {"bucketName": "examplebucket-1250000000","namespaceName": "products","schema": {"primary_key": "id","fields": {"id": {"type": "string", "filterable": true},"title": {"type": "text", "full_text_search": {"enabled": true}}}}}}
节点名称(关键字) | 父节点 | 描述 | 类型 |
namespace | 无 | 命名空间详情 | object |
namespace 包含以下字段:
节点名称(关键字) | 父节点 | 描述 | 类型 |
bucketName | namespace | 所属向量桶名称,采用 <name>-<appid> 格式,例如 examplebucket-1250000000 | string |
namespaceName | namespace | 命名空间名称 | string |
schema | namespace | object |
错误码
实际案例
案例一:查询命名空间详情
请求
POST /_native/products/_get_namespace HTTP/1.1Host: examplebucket-1250000000.vectors.ap-guangzhou.coslake.comDate: Tue, 08 Sep 2026 10:00:00 GMTContent-Type: application/jsonContent-Length: 0Authorization: q-sign-algorithm=sha1&q-ak=************************************&q-sign-time=...
响应
HTTP/1.1 200 OKContent-Type: application/jsonContent-Length: Content LengthDate: Tue, 08 Sep 2026 10:00:00 GMTx-cos-request-id: Njhk****{"namespace": {"bucketName": "examplebucket-1250000000","namespaceName": "products","schema": {"primary_key": "id","fields": {"id": {"type": "string", "filterable": true},"title": {"type": "text", "full_text_search": {"enabled": true}},"price": {"type": "float64", "filterable": true},"embedding": {"type": "vector","dimension": 4,"data_type": "float32","distance_metric": "cosine","ann": true}}}}}
案例二:查询不存在的命名空间
请求
POST /_native/not-exist/_get_namespace HTTP/1.1Host: examplebucket-1250000000.vectors.ap-guangzhou.coslake.comDate: Tue, 08 Sep 2026 10:00:00 GMTContent-Type: application/jsonContent-Length: 0Authorization: q-sign-algorithm=sha1&q-ak=************************************&q-sign-time=...
响应
目标命名空间不存在时返回 NotFoundException。
HTTP/1.1 404 Not FoundContent-Type: application/jsonContent-Length: Content LengthDate: Tue, 08 Sep 2026 10:00:00 GMTx-cos-request-id: Njhk****x-cos-error-code: NotFoundException{"message": "namespace not found"}