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:upload | tcb storage upload |
tcb storage:download | tcb storage download |
tcb storage:delete | tcb storage rm |
tcb storage:list | tcb storage list |
tcb storage:url | tcb storage url |
tcb storage:detail | tcb storage detail |
tcb storage get-acl | tcb permission |
tcb storage set-acl | tcb permission |
tcb storage:get-acl | tcb permission |
tcb storage:set-acl | tcb permission |