函数工作流 FUNCTIONGRAPH-示例2:上传代码到OBS桶,并使用OBS链接创建函数:步骤1:创建函数工程
时间:2025-05-28 09:46:56
步骤1:创建函数工程
- 编写打印helloworld的代码。
打开文本编辑器,编写helloworld函数,代码如下,文件命名为“helloworld.py”,保存文件。
def printhello(): print 'Hello world!'
- 定义FunctionGraph函数。
打开文本编辑器,定义函数,代码如下,文件命名为“index.py”,保存文件(与“helloworld.py”保存在同一文件夹下)。
import json import helloworld def handler (event, context): output =json.dumps(event) helloworld.printhello() return output
support.huaweicloud.com/api-functiongraph/functiongraph_06_0204.html