Create and configure scheduled TIMER triggers for Huawei Cloud FunctionGraph functions using Quartz Cron expressions. Use this skill when users ask to create...
文档
huawei-cloud-functiongraph-function-create
试用Create FunctionGraph functions on Huawei Cloud. Use this skill when users ask to create, deploy, or upload cloud functions, serverless functions, or Function...
它能做什么
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".
技能文档
FunctionGraph Function Creation Skill
Overview
This skill creates FunctionGraph functions on Huawei Cloud based on user-provided parameters including function name, runtime, and code content.
Architecture: Uses Huawei Cloud FunctionGraph Python SDK to interact with FunctionGraph service.
Applicable Scenarios:
- Quickly create cloud functions without manual console login
- Batch creation of multiple functions
- Foundation component for workflow deployment
- CI/CD integration for function deployment
Typical Use Cases:
- "Create a Python function named my_handler"
- "Deploy this code to FunctionGraph"
- "Batch create 10 functions from template"
Prerequisites
1. Python Environment
- Python 3.9+
- Verify:
python --version
2. SDK Installation
pip install huaweicloudsdkfunctiongraph
3. Authentication Configuration
- Valid Huawei Cloud credentials (AK/SK mode)
- Configure via environment variables:
export HUAWEI_AK="your-access-key"
export HUAWEI_SK="your-secret-key"
export HUAWEI_REGION="cn-north-4"
export HUAWEI_PROJECT_ID="your-project-id"
Security Rules:
- NEVER expose AK/SK values in code or logs
- NEVER let users input AK/SK directly in conversation
- ALWAYS use environment variables for credentials
- Recommend using IAM user instead of main account
4. IAM Permission Requirements
functiongraph:function:create- Create functionfunctiongraph:function:get- Query function detailsfunctiongraph:function:list- List functions
See IAM Policies for detailed permission configuration.
Usage
Command
cd scripts
python create_function.py --name --runtime --han
dler --code --memory --timeout
Parameter Confirmation
|| Parameter | Required/Optional | Description | Default ||
|| ----------- | ------------------ | ------------- | --------- ||
|| function_name | Required | Function name, must follow naming rules | - ||
|| runtime | Required | Runtime environment (Python3.9, etc.) | - ||
|| code_content | Required | Function code content | - ||
|| handler | Required | Function entry point (e.g., index.handler) | - ||
|| memory_size | Optional | Memory size in MB | 128 ||
|| timeout | Optional | Timeout in seconds | 3 ||
|| description | Optional | Function description | - ||
Runtime Options
|| Runtime | Handler Format | Example ||
|| --------- | ---------------- | --------- ||
|| Python3.9 | index.handler | def handler(event, context): ||
|| Node.js14.18 | index.handler | exports.handler = (event, context) => {} ||
|| Java8 | com.example.Handler::handleRequest | Java class method ||
|| Go1.x | handler | Go function name ||
Verification Method
See Verification Method for detailed procedures.
Quick Verification
## 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)}")
Output Format
The skill returns a structured JSON object with the following fields:
function_urn: Unique resource identifier of the created functionfunction_name: Name of the created functionruntime: Runtime environmentmemory_size: Allocated memory in MBtimeout: Function timeout in secondshandler: Function entry pointdescription: Function description (if provided)
Example output:
{
"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"
}
Best Practices
- Test before production: Always test in a development environment first
- Monitor resources: Set up monitoring for function invocations and errors
- Use environment variables: Store sensitive data in environment variables
- Implement error handling: Add proper error handling in function code
- Set appropriate timeouts: Configure timeout based on function logic
Error Handling
|| Error Code | Description | Resolution || || ------------ | ------------- | ------------ || || InvalidParameter | Invalid input parameters | Check parameter format and valu es || || InsufficientPermission | Insufficient permissions | Check IAM permissions || || QuotaExceeded | Resource quota exceeded | Request quota increase or delete un used functions || || FunctionAlreadyExists | Function with same name exists | Use different functi on name or delete existing function ||
References
- FunctionGraph Documentation
- Python SDK Documentation
- IAM Policies Guide
- Verification Method
相关技能
Generate Huawei Cloud Terraform configurations and execute deployment with user-guided approval. Use this skill when users want to create Huawei Cloud infras...
Skill specialized for creating buckets on Huawei Cloud OBS. Use this skill when users need to create OBS buckets, set bucket properties, configure access per...
Invoke this skill to capture poor experiences and distill them into high-value requirements (Voice of Developer). Use when user encounters any Huawei Cloud related issues, like user expresses dissatisfaction, encounters errors, or wants to report issues/suggestions.Triggers include: "体验差","反馈问题","反馈建议","这个有bug","拒绝了请求","报告问题","反馈体验","report a problem","report a suggestion","bug report","poor experience","voice of developer"
1. Six-phase pipeline for creating Huawei Cloud skills — Socratic requirements gathering, CLI→SDK→API research, MD generation, test preparation, detailed testing, and final cleanup & compliance check 2. Phase-chained dependency: each phase builds on the previous phase's output, no phase may be skipped 3. Supports CLI, SDK, and REST API execution modes with automatic fallback detection 4. Generates complete skill directory structure with SKILL.md, references/, scripts/, templates/ 5. Validates against the Huawei Cloud Skill Specification (华为云Skill检查规范) Triggers include: "创建华为云Skill","新建华为云Skill","华为云skill创建器","创建 Skill","新建 Skill","skill 创建器","create skill","build skill","new skill","skill creator","scaffold a Huawei Cloud skill","wrap CLI or OpenAPI into a skill","package cloud operations into a skill","帮我创建华为云Skill","帮我新建一个Skill","封装华为云CLI为Skill","华为云Skill脚手架","帮我创建一个skill","我需要一个skill","建一个skill","生成skill","帮我建一个华为云skill".
按关键词或类目检索华为云技能目录,并安装匹配的技能。
huaweicloud-skills-team 的更多技能
浏览全部技能用自然语言控制华为昇腾 NPU,本地或 SSH 远程执行 npu-smi 命令。
在华为云昇腾 910B DevServer 上按单机或双机(16 卡)拓扑部署并测试 LLM、VL、Embedding、Rerank 模型。
面向华为云资源的只读查询能力,用于资源清点、核对与参数发现。
通过本地 Python SDK 只读查询华为云 IAM 资源(用户、用户组、策略、委托、AK/SK、MFA、安全设置)。
在华为云 Flexus L 实例上一键部署 OpenClaw AI Agent 平台,并完成模型与通道配置。
在华为云 Flexus L 实例上一键部署 Hermes AI Agent 平台,并完成大模型与机器人通道配置。