tccli batch help
NAMEbatchDESCRIPTIONbatch-2017-03-12USEAGEtccli batch <action> [--param...]OPTIONShelpshow the tccli batch help info--versionspecify a batch api versionAVAILABLE ACTIONDescribeComputeEnv用于查询计算环境的详细信息CreateTaskTemplate用于创建任务模板
tccli batch SubmitJob --version 2017-03-12 --Job '{"JobName": "TestJob", // 作业名称"JobDescription": "for test ", // 作业描述"Priority": "1", // 作业优先级"Tasks": [ // 任务列表(本例仅一个任务){"TaskName": "Task1", // 任务1名称"Application": { // 任务执行命令"DeliveryForm": "LOCAL", // 执行本地命令"Command": "python -c \\"fib=lambda n:1 if n<=2 else fib(n-1)+fib(n-2); print(fib(20))\\" " // 命令具体内容(斐波拉契求和)},"ComputeEnv": { // 计算环境配置"EnvType": "MANAGED", // 计算环境类型,托管型和非托管型"EnvData": { // 具体配置(当前托管型,可参照CVM 创建实例说明)"InstanceType": "S1.SMALL1", // CVM 实例类型"ImageId": "img-m4q71qnf", // CVM 镜像 ID(需替换)}},"RedirectInfo": { // 标准输出重定向配置"StdoutRedirectPath": "cos://dondonbatchv5-1251783334.cosgz.myqcloud.com/logs/", // 标准输出(需替换)"StderrRedirectPath": "cos://dondonbatchv5-1251783334.cosgz.myqcloud.com/logs/" // 标准错误(需替换)}}]}'--Placement'{"Zone": "ap-guangzhou-2" // 可用区(可能需替换)}'
tccli batch SubmitJob --version 2017-03-12 --Job '{"JobName": "TestJob", "JobDescription": "for test", "Priority": "1", "Tasks": [{"TaskName": "Task1", "TaskInstanceNum": 1, "Application": {"DeliveryForm": "LOCAL", "Command": "python -c \\"fib=lambda n:1 if n<=2 else fib(n-1)+fib(n-2); print(fib(20))\\" "}, "ComputeEnv": {"EnvType": "MANAGED", "EnvData": {"InstanceType": "S1.SMALL1", "ImageId": "待替换" } }, "RedirectInfo": {"StdoutRedirectPath": "待替换", "StderrRedirectPath": "待替换"}, "MaxRetryCount": 1 } ] }' --Placement '{"Zone": "ap-guangzhou-2"}'
参数 | 描述 |
version | 版本号,目前固定填写2017-03-12 |
Job | 作业配置,JSON 格式,详细字段意义见示例 |
Placement | 执行作业的可用区 |
"ImageId": "待替换"
"StdoutRedirectPath": "待替换", "StderrRedirectPath": "待替换"
--Placement '{"Zone": "ap-guangzhou-2"}'
{"RequestId": "db84b7f8-ff8e-4c11-81c1-9a3b02652a46","JobId": "job-cr8qyyh9"}
$ tccli batch DescribeJob --version 2017-03-12 --JobId job-cr8qyyh9{"EndTime": "2019-10-08T07:28:07Z","JobState": "SUCCEED","TaskInstanceMetrics": {...},"Zone": "ap-guangzhou-2","TaskMetrics": {...},"JobName": "TestJob","Priority": 1,"RequestId": "0e5c5ea5-ef25-4f90-b355-cfaa8057d473","TaskSet": [{...}],"StateReason": null,"JobId": "job-cr8qyyh9","DependenceSet": [],"CreateTime": "2019-10-08T07:27:17Z"}
$ tccli batch DescribeJobs --version 2017-03-12
本页内容是否解决了您的问题?