Storage
Authentication
Upload File
接口功能: 上传文件
Method & Path
-
POST {domain}/bp/ai/v2/storage
-
POST {domain}/bp/server/user/{user_id}/ai/v2/storage
Request
- content-type: "multipart/form-data"
Parameters | Type | Required | Desc |
---|---|---|---|
name | string | true | 文件名 |
data | file | true | 文件 |
full_url | boolean | false | 是否返回全路径,默认 false |
Response
- HTTP 状态码:200
json
{
"storage": {
"storage_id": "AISD7J7ZDUHRGVDO",
"path": "ai/storage/rabbit.png",
"created_time": "2023-11-10T12:22:10.311993+08:00",
"updated_time": "2023-11-10T12:22:10.311993+08:00"
}
}
- HTTP 状态码:4xx
json
{
"error": {
"error_type": "invalid_parameter",
"message": "xxxxx"
}
}
error_type:
- item_not_found(找不到条目)
- config_invalid (console 配置问题)
Delete File
接口功能: 删除文件
Method & Path
-
DELETE {domain}/bp/ai/v2/storage/{storage_id}
-
DELETE {domain}/bp/server/user/{user_id}/ai/v2/storage/{storage_id}
Get File
接口功能: 获取文件
Method & Path
-
GET {domain}/bp/ai/v2/storage/{storage_id}
-
GET {domain}/bp/server/user/{user_id}/ai/v2/storage/{storage_id}
Response
- HTTP 状态码:200
json
{
"storage": [
{
"storage_id": "AISD7J7ZDUHRGVDO",
"path": "ai/storage/rabbit.png",
"created_time": "2023-11-10T04:22:10.311993Z",
"updated_time": "2023-11-10T04:22:10.311993Z"
}
]
}
- HTTP 状态码:4xx
json
{
"error": {
"error_type": "invalid_parameter",
"message": "xxxxx"
}
}
error_type:
- item_not_found(找不到条目)
- config_invalid (console 配置问题)