4 saastool工具
saastool 是提供给客户的便捷命令行工具,使客户在不开发或少开发的情况下即可实现【数据管理】【策略管理】的对应功能。
开发者也可以参考该工具的功能源码(golang),实现贴合自身业务的处理逻辑。
源码:saastool
4.1 命令行模式
saastool help
Usage: saastool COMMAND [OPTIONS]
Commands:
info Saas Info
write Write user's 'bytes / uint32s / flags'
read Read user's 'bytes / uint32s / flags'
columnwrite Write columns for 'deviceid / openid' users
convert Convert data to write format
task Task commands
target Target commands
bind Bind commands
grant Grant commands
script Script commands
exp Exp commands
daemon Run in daemon mode
"help" is the default command.
Use "saastool COMMAND -help" for more information about a command.
4.1.1 cfg.toml配置文件
saastool需要一个配置文件,其中可填写自己的Account、Token。使用配置文件可实现多账号多环境的区分。
该配置文件默认名称为 cfg.toml,请置于saastool 同目录下。也可以通过 -cfg 参数指定别的配置文件,例如 saastool -cfg my.toml。
# 样例
[auth]
account = "2000"
token = "test"
[apiurls]
baseurl = "https://api.rta.qq.com" # 正式环境
#baseurl = "https://srta.algo.com.cn" # 演示环境
4.1.2 task(任务管理)命令列表
saastool task help
Usage: saastool task COMMAND [OPTIONS]
Commands:
make Make file hash for upload task
create Create a task on server
list List tasks on server
run Run a task on server
delete Delete a task on server
info Get a task info on server
upload Upload task's file block to server
download Download task's file block to local
"help" is the default command.
Use "saastool task COMMAND -help" for more information about a command.
4.1.3 target(策略列表)命令列表
saastool target help
Usage: saastoola target COMMAND [OPTIONS]
Commands:
list List targets
create Create a new target
delete Delete an existing target
"help" is the default command.
Use "saastool target COMMAND -help" for more information about a command.
4.1.4 bind(策略绑定)命令列表
saastool bind help
Usage: saastoola bind COMMAND [OPTIONS]
Commands:
setaccount Set Account binds
setad Set AdGroup binds
delete Delete binds
"help" is the default command.
Use "saastool bind COMMAND -help" for more information about a command.