$ sudo pip install tccli
$ sudo pip install --upgrade tccli
tccli batch help
NAMEbatchDESCRIPTIONbatch-2017-03-12USEAGEtccli batch <action> [--param...]OPTIONShelpshow the tccli batch help info--versionspecify a batch api versionAVAILABLE ACTIONDescribeComputeEnv用于查询计算环境的详细信息CreateTaskTemplate用于创建任务模板
tccli configure
命令,并输入 TCCLI 配置信息,详情请参见 配置命令行工具。$ tccli configureTencentCloud API secretId[None]:TencentCloud API secretKey[None]:region[None]:output[json]:
https://batchdemo-xxxxxxxxx.cos.ap-guangzhou.myqcloud.com
,可通过 域名+文件夹
推算出在 创建 Bucket 及子文件夹 中创建的3个文件夹的访问域名。如下所示:cos://batchdemo-xxxxxxxxx.cos.ap-guangzhou.myqcloud.com/logs/
cos://batchdemo-xxxxxxxxx.cos.ap-guangzhou.myqcloud.com/input/
cos://batchdemo-xxxxxxxxx.cos.ap-guangzhou.myqcloud.com/output/
1_SimpleStart.py
中的自定义信息部分为例:# custom (Change to your info)imageId = "img-m4q71qnf"Application = {"DeliveryForm": "LOCAL","Command": " python -c \\"fib=lambda n:1 if n<=2 else fib(n-1)+fib(n-2); print(fib(20))\\" "}StdoutRedirectPath = "cos://batchdemo-xxxxxxxxxx.cos.ap-guangzhou.myqcloud.com/logs/"StderrRedirectPath = "cos://batchdemo-xxxxxxxxxx.cos.ap-guangzhou.myqcloud.com/logs/"
配置项 | 描述 |
imageId | |
StdoutRedirectPath | |
| StderrRedirectPath |
Application | 启动命令行,保持默认设置。 |
cmd = "tccli batch SubmitJob \\--version 2017-03-12 \\--Placement '{\\"Zone\\": \\"ap-guangzhou-2\\"}' \\--Job ' %s ' "%(json.dumps(testJob))
本页内容是否解决了您的问题?