向量数据库VikingDB
/api/v1/fs 接口用于删除 OpenViking 文件系统中的文件或目录。rm 是幂等操作:删除一个合法但不存在的 URI 仍会成功。URI 格式非法、scheme 不支持或使用非公开作用域时返回 INVALID_URI。
完成 API 鉴权说明 页面的 API Key 获取后,可调用本接口删除资源。
URI | /api/v1/fs | 统一资源标识符 |
|---|---|---|
请求方法 | DELETE | 客户端请求类型 |
请求头 | Authorization: Bearer | Bearer Token 鉴权 |
参数 | 类型 | 必选 | 默认值 | 备注 |
|---|---|---|---|---|
uri | string | 是 | -- | 要删除的 Viking URI |
recursive | bool | 否 | false | 递归删除 |
字段 | 参数说明 |
|---|---|
status | 请求状态,成功为 |
result | 成功时返回的数据对象 |
result.uri | 被删除资源的 URI |
telemetry | 遥测信息,通常为 |
error | 失败时返回的错误对象 |
error.code | 错误码字符串,常见值见下表 |
error.message | 可读的错误描述 |
常见错误码:
error.code | 说明 |
|---|---|
UNAUTHENTICATED | 缺少或无效的 API Key |
PERMISSION_DENIED | 权限不足 |
INVALID_URI | URI 格式非法、scheme 不支持或使用非公开作用域 |
curl -X DELETE "https://xxx/api/v1/fs?uri=viking://resources/docs/old.md" \ -H "X-Api-Key: your-api-key"
执行成功返回:
HTTP/1.1 200 OK Content-Type: application/json { "status": "ok", "result": { "uri": "viking://resources/docs/old.md" }, "error": null, "telemetry": null }
curl -X DELETE "https://xxx/api/v1/fs?uri=viking://resources/old-project/&recursive=true" \ -H "X-Api-Key: your-api-key"
执行成功返回:
{ "status": "ok", "result": { "uri": "viking://resources/old-project/" }, "error": null, "telemetry": null }