Skip to main content
Drives

清空 Drive

清空指定 Identity 的 Drive。

Drive 目前为 Beta 功能,接口定义、响应结构和行为可能发生变化。请关注文档更新,并在生产环境使用前完成兼容性验证。
DELETE /api/v1/forward/drives

请求头

Header是否必填说明
Authorization是Bearer <PAT 或 SAT>

查询参数

参数类型是否必填说明
identity_idstring是当前认证范围内的 Identity ID,只能出现一次;Identity 级 SAT 只能选择其绑定的 Identity。

示例请求

curl --silent --show-error --fail-with-body -X DELETE \
  "https://api.qoder.com/api/v1/forward/drives?identity_id=idn_xxx" \
  -H "Authorization: Bearer $QODER_ACCESS_TOKEN"

示例响应

HTTP 200 OK
{
  "deleted_count": 12
}

响应字段

字段类型说明
deleted_countinteger本次确认删除的存储对象数;Drive 已为空时为 0。

错误

HTTPCode触发条件
400—请求体包含不支持的字段或格式错误。
400invalid_drive_pathIdentity 标识格式不合法。
400invalid_identity_ididentity_id 缺失、为空或重复传入。
401—凭证缺失或无效;Service Account Key 需先换取 SAT。
403identity_mismatchIdentity 级 SAT 选择了其他 Identity。
404identity_not_found当前认证范围内未找到 Identity。
413—请求体超过服务限制。
500—服务内部错误。
503drive_delete_partial清空未全部完成;error.deleted_count 给出本次已确认删除数量,可重试原请求。
503drive_unavailableDrive 存储、签名或依赖能力暂不可用。

HTTP 错误响应

{
  "type": "error",
  "request_id": "req_xxx",
  "error": {
    "type": "invalid_request_error",
    "code": "invalid_identity_id",
    "message": "identity_id is required exactly once"
  }
}

响应字段

字段类型说明
typestring固定为 error。
request_idstring请求追踪 ID,可用时返回。
error.typestring错误大类,如 invalid_request_error、authentication_error、permission_error、not_found_error、conflict_error、api_error。
error.codestring业务错误码,部分公共错误不返回此字段。
error.messagestring错误描述。
error.deleted_countinteger仅 drive_delete_partial 返回,表示本次已确认删除的对象数,也可能为 0。
drive_delete_partial 表示删除未全部完成;已删除的文件不会恢复,重试只处理剩余文件。 入口鉴权错误可能使用不同的响应结构。

相关