跳到主要内容

tcb storage

tcb storage 提供两套命令:PG 模式操作 storage schema 的存储桶与对象,传统模式操作 cloudPath 路径下的文件。

命令索引​

PG 模式​

命令用途
tcb storage buckets list列出存储桶
tcb storage policies list查看 storage schema 的 RLS 策略
tcb storage objects list列出对象
tcb storage objects stat查询对象元信息
tcb storage objects upload上传对象
tcb storage objects download下载对象
tcb storage objects cp复制对象
tcb storage objects mv移动对象
tcb storage objects sign生成临时下载或上传链接
tcb storage objects rm删除对象

PG 模式存储命令自 @cloudbase/cli@3.4.0 起提供,环境需为 PG 模式。

传统模式​

命令用途
tcb storage list列出文件
tcb storage search搜索文件
tcb storage upload上传文件或目录
tcb storage download下载文件或目录
tcb storage cp复制或移动文件
tcb storage rm删除文件
tcb storage url获取访问链接
tcb storage detail获取文件信息
tcb storage rules get获取权限规则
tcb storage rules update更新权限规则

说明​

  • 两套命令不重叠,按环境模式选对应页面
  • PG 模式的对象命令需要 -b <bucketId> 指定存储桶,也可用环境变量 TCB_BUCKET_ID
  • 传统模式的路径以 / 开头表示根目录,其余按相对路径处理
  • PG 模式的权限用 RLS 策略,传统模式用 tcb storage rules;资源级权限统一走 tcb permission

已废弃​

命令替代
tcb storage:uploadtcb storage upload
tcb storage:downloadtcb storage download
tcb storage:deletetcb storage rm
tcb storage:listtcb storage list
tcb storage:urltcb storage url
tcb storage:detailtcb storage detail
tcb storage get-acltcb permission
tcb storage set-acltcb permission
tcb storage:get-acltcb permission
tcb storage:set-acltcb permission