38
技術社區[雲棲]
表格存儲命令行工具CLT(Python)
由於之前使用駐雲科技的Cli,遇到較多的問題,關鍵是版本也沒有及時更新,使用起來比較吃力。所以我這邊利用業餘的寫了一個表格存儲的命令工具,提供給大家使用。
地址
使用樣例
1. 安裝SDK
2. 下載Clt工具
3. 啟動 "./ts"
4. 配置賬戶接入
tablestore> config --endpoint myinstance.cn-hangzhou.ots.aliyuncs.com --instance myinstance --accessid test_accessid --accesskey test_accesskey
5. 創建表
tablestore> ct --name mytable --primary_key uid:string,pid:integer
6. 遍曆表
tablestore> lt
7. 管理表,表必須被關聯才能進行數據的讀寫
tablestore> use --name mytable
關聯之後
tablestore@mytable>
8. 寫入兩行數據
tablestore@mytable> pr --primary_key redchen,0 --attribute name:string:redchen,address:string:china,weight:integer:70
tablestore@mytable> pr --primary_key redchen,1 --attribute name:string:redchen,address:string:china,weight:integer:70
9. 讀取這行數據
tablestore@mytable> gr --primary_key redchen,0
10. 遍曆整張表
tablestore@mytable> scan
11. 導出數據到本地
tablestore@mytable > export --file mytable.data
12. 加載本地的數據
tablestore@mytable> import --file mytable.data
13. 退出
tablestore@mytable> quit
文檔
當前支持的命令
命令
- help
- config
- create_table(ct)
- delete_table(dt)
- list_table(lt)
- get_table(gt)
- update_table(ut)
- use
- get_row(gr)
- put_row(pr)
- scan
- import
- export
- quit
最後更新:2017-11-11 23:35:32