Skip to content

DELETE /api/v1/projects/{projectId}/storages/{storageId}

DELETE/api/v1/projects/{projectId}/storages/{storageId}

删除存储(需 admin 及以上,API Key 不可用;级联解除域名绑定)

projectoperationId: projectStorageDelete

请求参数

名称类型位置必填说明
projectIdstringpath是项目 ID(UUID)。携带 `X-API-Key` 时按 API Key scope 鉴权,否则按 JWT + 项目成员角色鉴权
storageIdstringpath是—

请求示例

cURL
curl -X DELETE 'http://localhost:8080/api/v1/projects/{projectId}/storages/{storageId}' \
  -H 'Accept: application/json' \
  -H 'X-API-Key: <PROJECT_API_KEY>'
# 也可使用登录会话:-H 'Authorization: Bearer <JWT>'
JavaScript
const res = await fetch('http://localhost:8080/api/v1/projects/{projectId}/storages/{storageId}', {
  method: 'DELETE',
  headers: {
    'Accept': 'application/json',
    'X-API-Key': '<PROJECT_API_KEY>'
  },
});
const data = await res.json();
Python
import requests

res = requests.delete(
    'http://localhost:8080/api/v1/projects/{projectId}/storages/{storageId}',
    headers={'Accept': 'application/json', 'X-API-Key': '<PROJECT_API_KEY>'}
)
print(res.json())

响应

204成功(无内容)
403无权限(未通过 RBAC 或 2FA)

application/json

{
  "type": "object",
  "properties": {
    "code": {
      "type": "string",
      "example": "not_found"
    },
    "message": {
      "type": "string",
      "example": "资源不存在"
    }
  }
}

在线调试

在线调试
凭证仅保存在当前页面内存中
自定义请求 Header