Loading...
Loading...
Create FunctionGraph functions on Huawei Cloud. Use this skill when users ask to create, deploy, or upload cloud functions, serverless functions, or FunctionGraph functions. Triggered by keywords like "create function", "deploy function", "upload function", "create cloud function", "创建函数", "部署函数", "上传函数", "创建云函数", "FunctionGraph function", "serverless function".
npx skill4agent add huaweicloud/huaweicloud-skills huawei-cloud-functiongraph-function-createpython --versionpip install huaweicloudsdkfunctiongraphexport HUAWEI_AK="your-access-key"
export HUAWEI_SK="your-secret-key"
export HUAWEI_REGION="cn-north-4"
export HUAWEI_PROJECT_ID="your-project-id"functiongraph:function:createfunctiongraph:function:getfunctiongraph:function:listcd scripts
python create_function.py --name <function_name> --runtime <runtime> --han
dler <handler> --code <code_content> --memory <memory_size> --timeout <timeout>function_nameruntimecode_contenthandlermemory_sizetimeoutdescriptiondef handler(event, context):exports.handler = (event, context) => {}## Verify function exists using SDK
from huaweicloudsdkfunctiongraph.v2.functiongraph_client import FunctionGraphClient
from huaweicloudsdkfunctiongraph.v2.model import ListFunctionsRequest
# List functions to verify creation
client = FunctionGraphClient.new_builder().build()
request = ListFunctionsRequest()
response = client.list_functions(request)
print(f"Total functions: {len(response.functions)}")function_urnfunction_nameruntimememory_sizetimeouthandlerdescription{
"function_urn": "urn:fss:cn-north-4:project_id:function:default:my_function",
"function_name": "my_function",
"runtime": "Python3.9",
"memory_size": 128,
"timeout": 3,
"handler": "index.handler",
"description": "Test function created by skill"
}