跳至主要內容

storage

Andy HsuGuideADMINAPIGuide大约 6 分钟

storage

GET 列出存储列表

GET /api/admin/storage/list

请求参数

名称位置类型必选说明
pagequerystring页数
per_pagequerystring每页数目
Authorizationheaderstringtoken

返回示例

成功

{
  "code": 200,
  "message": "success",
  "data": {
    "content": [
      {
        "id": 1,
        "mount_path": "/lll",
        "order": 0,
        "driver": "Local",
        "cache_expiration": 0,
        "status": "work",
        "addition": "{\"root_folder_path\":\"/root/www\",\"thumbnail\":false,\"thumb_cache_folder\":\"\",\"show_hidden\":true,\"mkdir_perm\":\"777\"}",
        "remark": "",
        "modified": "2023-07-19T09:46:38.868739912+08:00",
        "disabled": false,
        "enable_sign": false,
        "order_by": "name",
        "order_direction": "asc",
        "extract_folder": "front",
        "web_proxy": false,
        "webdav_policy": "native_proxy",
        "down_proxy_url": ""
      }
    ],
    "total": 1
  }
}

返回结果

状态码状态码含义说明数据模型
200OKopen in new window成功Inline

返回数据结构

状态码 200

名称类型必选约束中文名说明
» codeintegertruenone状态码状态码
» messagestringtruenone信息信息
» dataobjecttruenonenone
»» content[object]truenonenone
»»» idintegerfalsenoneidid
»»» mount_pathstringfalsenone挂载路径挂载路径
»»» orderintegerfalsenone排序顺序
»»» driverstringfalsenone驱动驱动类型
»»» cache_expirationintegerfalsenone缓存过期时间缓存时间
»»» statusstringfalsenone状态状态
»»» additionstringfalsenone额外信息额外信息
»»» remarkstringfalsenone备注备注名
»»» modifiedstringfalsenone修改时间修改时间
»»» disabledbooleanfalsenone禁用是否被禁用
»»» enable_signbooleanfalsenone启用签名none
»»» order_bystringfalsenone排序排序方式
»»» order_directionstringfalsenone排序方向排序方向
»»» extract_folderstringfalsenone提取文件夹提取目录顺序
»»» web_proxybooleanfalsenoneweb代理http代理
»»» webdav_policystringfalsenonewebdav代理webdav策略
»»» down_proxy_urlstringfalsenone下载代理url下载代理url
»» totalintegertruenone总数none

POST 启用存储

POST /api/admin/storage/enable

请求参数

名称位置类型必选说明
idqueryinteger存储id
Authorizationheaderstringtoken

返回示例

成功

{
  "code": 200,
  "message": "success",
  "data": null
}

返回结果

状态码状态码含义说明数据模型
200OKopen in new window成功Inline

返回数据结构

状态码 200

名称类型必选约束中文名说明
» codeintegertruenone状态码状态码
» messagestringtruenone信息信息
» datanulltruenonedatadata

POST 禁用存储

POST /api/admin/storage/disable

请求参数

名称位置类型必选说明
idquerystring存储id
Authorizationheaderstringtoken

返回示例

成功

{
  "code": 200,
  "message": "success",
  "data": null
}

返回结果

状态码状态码含义说明数据模型
200OKopen in new window成功Inline

返回数据结构

状态码 200

名称类型必选约束中文名说明
» codeintegertruenone状态码状态码
» messagestringtruenone信息信息
» datanulltruenonedatadata

POST 创建存储

POST /api/admin/storage/create

Body 请求参数

{
  "mount_path": "/lll",
  "order": 0,
  "remark": "",
  "cache_expiration": 30,
  "web_proxy": false,
  "webdav_policy": "native_proxy",
  "down_proxy_url": "",
  "extract_folder": "front",
  "enable_sign": false,
  "driver": "Local",
  "order_by": "name",
  "order_direction": "asc",
  "addition": "{\"root_folder_path\":\"/\",\"thumbnail\":false,\"thumb_cache_folder\":\"\",\"show_hidden\":true,\"mkdir_perm\":\"777\"}"
}

请求参数

名称位置类型必选中文名说明
Authorizationheaderstringtoken
bodybodyobjectnone
» idbodystringIDnone
» mount_pathbodystring挂载路径none
» orderbodyinteger排序none
» driverbodystring驱动none
» remarkbodystring备注名none
» cache_expirationbodyinteger缓存过期时间none
» statusbodystringnone
» web_proxybodybooleanweb代理none
» webdav_policybodystringwebdav策略none
» down_proxy_urlbodystring下载代理none
» order_bybodystring排序方式none
» extract_folderbodystring提取目录none
» order_directionbodystring排序方向none
» additionbodystring额外信息none
» enable_signbodystring启用签名none

返回示例

成功

{
  "code": 200,
  "message": "success",
  "data": {
    "id": 7
  }
}

返回结果

状态码状态码含义说明数据模型
200OKopen in new window成功Inline

返回数据结构

状态码 200

名称类型必选约束中文名说明
» codeintegertruenone状态码状态码
» messagestringtruenone信息信息
» dataobjecttruenonedatadata
»» idintegertruenonenone

POST 更新存储

POST /api/admin/storage/update

Body 请求参数

{
  "mount_path": "/lll",
  "order": 0,
  "remark": "",
  "cache_expiration": 30,
  "web_proxy": false,
  "webdav_policy": "native_proxy",
  "down_proxy_url": "",
  "extract_folder": "front",
  "enable_sign": false,
  "driver": "Local",
  "order_by": "name",
  "order_direction": "asc",
  "addition": "{\"root_folder_path\":\"/\",\"thumbnail\":false,\"thumb_cache_folder\":\"\",\"show_hidden\":true,\"mkdir_perm\":\"777\"}"
}

请求参数

名称位置类型必选中文名说明
Authorizationheaderstringtoken
bodybodyobjectnone
» idbodystringIDnone
» mount_pathbodystring挂载路径none
» orderbodyinteger排序none
» driverbodystring驱动none
» remarkbodystring备注名none
» cache_expirationbodyinteger缓存过期时间none
» statusbodystringnone
» web_proxybodybooleanweb代理none
» webdav_policybodystringwebdav策略none
» down_proxy_urlbodystring下载代理none
» order_bybodystring排序方式none
» extract_folderbodystring提取目录none
» order_directionbodystring排序方向none
» additionbodystring额外信息none
» enable_signbodystring启用签名none

返回示例

成功

{
  "code": 200,
  "message": "success",
  "data": {
    "id": 7
  }
}

返回结果

状态码状态码含义说明数据模型
200OKopen in new window成功Inline

返回数据结构

状态码 200

名称类型必选约束中文名说明
» codeintegertruenone状态码状态码
» messagestringtruenone信息信息
» dataobjecttruenonedatadata
»» idintegertruenonenone

GET 查询指定存储信息

GET /api/admin/storage/get

请求参数

名称位置类型必选中文名说明
idquerystring存储id
Authorizationheaderstringtoken

返回示例

成功

{
  "code": 200,
  "message": "success",
  "data": {
    "id": 2,
    "mount_path": "/aa",
    "order": 1,
    "driver": "Aliyundrive",
    "cache_expiration": 30,
    "status": "work",
    "addition": "{\"root_folder_id\":\"\",\"refresh_token\":\"\",\"order_by\":\"size\",\"order_direction\":\"ASC\",\"rapid_upload\":false}",
    "remark": "",
    "modified": "2022-11-26T21:50:44.142348853+08:00",
    "disabled": false,
    "order_by": "",
    "order_direction": "",
    "extract_folder": "front",
    "web_proxy": false,
    "webdav_policy": "302_redirect",
    "down_proxy_url": ""
  }
}

返回结果

状态码状态码含义说明数据模型
200OKopen in new window成功Inline

返回数据结构

状态码 200

名称类型必选约束中文名说明
» codeintegertruenone状态码none
» messagestringtruenone信息none
» dataobjecttruenonenone
»» idintegertruenoneidnone
»» mount_pathstringtruenone挂载路径none
»» orderintegertruenone排序none
»» driverstringtruenone驱动none
»» cache_expirationintegertruenone缓存过期时间none
»» statusstringtruenone状态none
»» additionstringtruenone额外信息none
»» remarkstringtruenone备注none
»» modifiedstringtruenone修改时间none
»» disabledbooleantruenone是否被禁用none
»» order_bystringtruenone排序方式none
»» order_directionstringtruenone排序方向none
»» extract_folderstringtruenone提取目录none
»» web_proxybooleantruenoneweb代理none
»» webdav_policystringtruenonewebdav策略none
»» down_proxy_urlstringtruenone下载代理none

POST 删除指定存储

POST /api/admin/storage/delete

请求参数

名称位置类型必选中文名说明
idquerystring存储id
Authorizationheaderstringtoken

返回示例

成功

{
  "code": 200,
  "message": "success",
  "data": null
}

返回结果

状态码状态码含义说明数据模型
200OKopen in new window成功Inline

返回数据结构

状态码 200

名称类型必选约束中文名说明
» codeintegertruenone状态码状态码
» messagestringtruenone信息信息
» datanulltruenonedatadata

POST 重新加载所有存储

POST /api/admin/storage/load_all

请求参数

名称位置类型必选中文名说明
Authorizationheaderstringnone

返回示例

成功

{
  "code": 200,
  "message": "success",
  "data": null
}

返回结果

状态码状态码含义说明数据模型
200OKopen in new window成功Inline

返回数据结构

状态码 200

名称类型必选约束中文名说明
» codeintegertruenone状态码none
» messagestringtruenone信息none
» datanulltruenonenone