向量数据库VikingDB
/api/v1/fs/mv 接口用于在 OpenViking 文件系统中移动文件或目录,将资源从源 URI 移动到目标 URI。
完成 API 鉴权说明 页面的 API Key 获取后,可调用本接口移动资源。
URI | /api/v1/fs/mv | 统一资源标识符 |
|---|---|---|
请求方法 | POST | 客户端请求类型 |
请求头 | Content-Type: application/json | 请求消息类型 |
Authorization: Bearer | Bearer Token 鉴权 |
参数 | 类型 | 必选 | 默认值 | 备注 |
|---|---|---|---|---|
from_uri | string | 是 | -- | 源 Viking URI |
to_uri | string | 是 | -- | 目标 Viking URI |
字段 | 参数说明 |
|---|---|
status | 请求状态,成功为 |
result | 成功时返回的数据对象 |
result.from | 源 URI |
result.to | 目标 URI |
telemetry | 遥测信息,通常为 |
error | 失败时返回的错误对象 |
error.code | 错误码字符串,常见值见下表 |
error.message | 可读的错误描述 |
常见错误码:
error.code | 说明 |
|---|---|
UNAUTHENTICATED | 缺少或无效的 API Key |
PERMISSION_DENIED | 权限不足 |
INVALID_ARGUMENT | 无效参数 |
INVALID_URI | 无效的 Viking URI 格式 |
NOT_FOUND | 资源未找到 |
curl -X POST https://xxx/api/v1/fs/mv \ -H "X-Api-Key: your-api-key" \ -H "Content-Type: application/json" \ -d '{ "from_uri": "viking://resources/old-name/", "to_uri": "viking://resources/new-name/" }'
执行成功返回:
HTTP/1.1 200 OK Content-Type: application/json { "status": "ok", "result": { "from": "viking://resources/old-name/", "to": "viking://resources/new-name/" }, "error": null, "telemetry": null }