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 = "your cos path"StderrRedirectPath = "your cos path"
配置项 | 描述 |
DeliveryForm | 应用程序的交付方式,包括软件打包、容器镜像、CVM 内部直接运行三种,这里 LOCAL 代表的是 CVM 内部直接运行。 |
Command | 任务启动命令,这里执行的是一段 Python 脚本。以1为起点,将斐波拉契数列的前20个数字求和并输出到 StdOutput 里。 |
python 1_SimpleStart.py
{"RequestId": "393292f4-5583-48ad-a9f5-f673138ea637","JobId": "job-o0xxxxxq7"}
$ tccli batch DescribeJob --version 2017-03-12 --JobId job-xxx
{"EndTime": "2019-10-08T04:06:58Z","JobState": "SUCCEED","TaskInstanceMetrics": {...},"Zone": "ap-guangzhou-2","TaskMetrics": {...},"JobName": "TestJob","Priority": 1,"RequestId": "7a5f4c94-1357-486c-9c48-8286ba01b5b2","TaskSet": [...],"StateReason": null,"JobId": "job-o0xxxxxq7","DependenceSet": [],"CreateTime": "2019-10-08T04:05:54Z"}
6765
/bin/sh: -c: line 0: syntax error near unexpected token `('/bin/sh: -c: line 0: ` python -c \\"fib=lambda n:1 if n<=2 else fib(n-1)+fib(n-2); print(fib(20))\\" '
本页内容是否解决了您的问题?