
huawei-cloud-functiongraph-function-create
Create and invoke FunctionGraph functions on Huawei Cloud. Supports VPC configuration, environment variables, synchronous and asynchronous function invocation. Use this skill when users ask to create, deploy, upload, or invoke cloud functions, serverless functions, or FunctionGraph functions. Triggered by keywords like "create function", "deploy function", "upload function", "invoke function", "create cloud function", "创建函数", "部署函数", "上传函数", "调用函数", "创建云函数", "FunctionGraph function", "serverless function", "function invocation".
- Installs
- 17K
- Last 24h
- +104
- Trending rank
- #1951
- Security
- Pass
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/huaweicloud/huaweicloud-skills --skill huawei-cloud-functiongraph-function-create- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads huawei-cloud-functiongraph-function-create automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
Security audits
Independent scans of the skill's instructions and bundled files.
SKILL.md
The instructions your agent reads when the skill is triggered.
FunctionGraph Function Creation & Invocation Skill
Overview
This skill manages FunctionGraph functions on Huawei Cloud, supporting creation with advanced configuration (VPC, environment variables) and function invocation (sync/async).
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 with VPC or environment variable configuration
- Foundation component for workflow deployment
- CI/CD integration for function deployment
- Invoke and test deployed functions
Typical Use Cases:
- "Create a Python function named my_handler"
- "Deploy this code to FunctionGraph with VPC configuration"
- "Create a function with environment variables"
- "Invoke the function I just created"
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 functionsfunctiongraph:function:invoke- Invoke function
See IAM Policies for detailed permission configuration.
Workflow
User Request → Parse Parameters → Validate Input
→ Create Function (with optional VPC/Env Vars) → Return Function URN
→ (Optional) Invoke Function → Return Invocation Result
Usage
Create a Function
cd scripts
# Basic creation
python create_function.py create \
--name my_function \
--runtime Python3.9 \
--handler index.handler \
--code main.py
# With VPC configuration
python create_function.py create \
--name my_function \
--runtime Python3.9 \
--handler index.handler \
--code main.py \
--vpc-id vpc-xxx \
--subnet-id subnet-xxx \
--security-group-id sg-xxx
# With environment variables
python create_function.py create \
--name my_function \
--runtime Python3.9 \
--handler index.handler \
--code main.py \
--env-vars '{"DB_HOST":"localhost","DB_PORT":"3306"}'
# Full configuration
python create_function.py create \
--name my_function \
--runtime Python3.9 \
--handler index.handler \
--code main.py \
--memory 256 \
--timeout 30 \
--description "My production function" \
--vpc-id vpc-xxx \
--subnet-id subnet-xxx \
--security-group-id sg-xxx \
--env-vars '{"DEBUG":"true","LOG_LEVEL":"info"}'
Invoke a Function
Note: The function URN uses the real FunctionGraph URN prefix
urn:fss:. ReplacePROJECT_IDin the examples below with your actual project ID (the same value as theHUAWEI_PROJECT_IDenvironment variable). The function package isdefaultand the version islatest(or a specific version/alias). You can copy the URN returned by thecreatecommand and append:latestfor invocation.
# Synchronous invocation (default)
python create_function.py invoke \
--function-urn urn:fss:cn-north-4:PROJECT_ID:function:default:my_function:latest \
--body '{"key1":"value1","source":"test"}'
# Asynchronous invocation
python create_function.py invoke \
--function-urn urn:fss:cn-north-4:PROJECT_ID:function:default:my_function:latest \
--body '{"async":true}' \
--invocation-type async
# Invoke with log tail (returns last 4KB of log)
python create_function.py invoke \
--function-urn urn:fss:cn-north-4:PROJECT_ID:function:default:my_function:latest \
--body '{"test":"data"}' \
--log-type tail
Parameter Confirmation
Create Parameters
| Parameter | Required/Optional | Description | Default |
|---|---|---|---|
--name | Required | Function name, must follow naming rules | - |
--runtime | Required | Runtime environment (Python3.9, etc.) | - |
--handler | Required | Function entry point (e.g., index.handler) | - |
--code | Required | Code file path or inline code content | - |
--memory | Optional | Memory size in MB | 128 |
--timeout | Optional | Timeout in seconds | 3 |
--description | Optional | Function description | - |
--vpc-id | Optional | VPC ID for VPC configuration (must be set together with --subnet-id and --security-group-id) | - |
--subnet-id | Optional | Subnet ID for VPC configuration (must be set together with --vpc-id and --security-group-id) | - |
--security-group-id | Optional | Security group ID for VPC configuration (must be set together with --vpc-id and --subnet-id) | - |
--env-vars | Optional | Environment variables as JSON string | - |
Invoke Parameters
| Parameter | Required/Optional | Description | Default |
|---|---|---|---|
--function-urn | Required | Function URN to invoke | - |
--body | Optional | Event payload as JSON string | {} |
--invocation-type | Optional | sync or async | sync |
--log-type | Optional | tail to return last 4KB log | - |
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
Create Output
The script returns a structured JSON object:
{
"status": "success",
"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",
"code_size": 1234,
"message": "Function created successfully"
}
Invoke Output
{
"status": "success",
"function_urn": "urn:fss:cn-north-4:project_id:function:default:my_function",
"invocation_type": "sync",
"result": {
"output": "..."
},
"request_id": "a1b2c3d4-...",
"message": "Function invoked successfully"
}
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
- VPC for private resources: Use VPC configuration when functions need access to private network resources
Error Handling
| Error Code | Description | Resolution |
|---|---|---|
| InvalidParameter | Invalid input parameters | Check parameter format and values |
| InsufficientPermission | Insufficient permissions | Check IAM permissions |
| QuotaExceeded | Resource quota exceeded | Request quota increase or delete unused functions |
| FunctionAlreadyExists | Function with same name exists | Use different function name or delete existing function |
| FunctionNotFound | Function URN not found (invoke) | Verify the function URN is correct |
References
- FunctionGraph Documentation
- Python SDK Documentation
- IAM Policies Guide
- Verification Method
- Acceptance Criteria
FAQ
What does the huawei-cloud-functiongraph-function-create skill do?
Create and invoke FunctionGraph functions on Huawei Cloud. Supports VPC configuration, environment variables, synchronous and asynchronous function invocation. Use this skill when users ask to create, deploy, upload, or invoke cloud functions, serverless functions, or FunctionGraph functions. Triggered by keywords like "create function", "deploy function", "upload function", "invoke function", "create cloud function", "创建函数", "部署函数", "上传函数", "调用函数", "创建云函数", "FunctionGraph function", "serverless function", "function invocation".
How do I install huawei-cloud-functiongraph-function-create?
Run npx skills add https://github.com/huaweicloud/huaweicloud-skills --skill huawei-cloud-functiongraph-function-create in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/huawei-cloud-functiongraph-function-create/ (personal) or .claude/skills/huawei-cloud-functiongraph-function-create/ (project).
Which AI agents can use huawei-cloud-functiongraph-function-create?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is huawei-cloud-functiongraph-function-create safe to install?
Security partners have reviewed it: Gen Agent Trust Hub passed; Socket passed; Snyk passed. As with any skill, read the SKILL.md and bundled scripts before installing.
Who maintains huawei-cloud-functiongraph-function-create?
It is published by huaweicloud in huaweicloud/huaweicloud-skills. It has 17,029 recorded installs.
More from huaweicloud/huaweicloud-skills
huawei-cloud-terraform-installer
huaweicloud/huaweicloud-skills
Installs Terraform CLI cross-platform with Huawei Cloud mirror support. Use this skill whenever the user mentions installing Terraform, setting up Terraform environment, or when IaC tasks detect missing Terraform. Trigger: install terraform, setup terraform, terraform environment, huaweicloud provider.
huawei-cloud-find-skills
huaweicloud/huaweicloud-skills
Invoke this skill to search, list, query, discover, browse, find and install any Huawei Cloud (华为云) agent skill. Triggers include: "华为云", "华为云有什么skill", "华为云相关skill", "华为云agent skill 市场", "华为云skill类目", "explore Huawei Cloud skills", "show Huawei Cloud skill categories", "does a Huawei Cloud skill exist for...", "which Huawei Cloud skills exist", "搜索华为云技能", "查询华为云skill列表", "有没有管理ECS/OBS/RDS的skill", "帮我找 XX 华为云skill", "介绍 XX Skill 内容", "华为云 XX Skill 具体做什么", "安装华为云Skill".
huawei-cloud-billing-scout
huaweicloud/huaweicloud-skills
Huawei Cloud BSS billing (not AWS/Azure/other clouds; refuses pricing quotes, real-name review, and any non-billing scope): balance, spend, attribution, reconciliation, coupons, stored-value cards, enterprise/partner billing. One-page briefing via hcloud. Use only when the user explicitly mentions 华为云 / Huawei Cloud / BSS and 余额/账单/对账/资源包/代金券/储值卡/企业或伙伴账务; refuses pay, renew, refund, delete.
huawei-cloud-computing-query
huaweicloud/huaweicloud-skills
Queries Huawei Cloud computing resources (ECS/BMS/IMS/AS), Covers ECS instances, flavors, keypairs, quotas, server groups, block devices, NICs, VNC console, BMS bare metal servers/flavors/quotas, IMS images/OS versions/members/quotas, and AS scaling groups/configs/policies/activity logs/lifecycle hooks/warm pools/quotas. No write operations. Use this skill when the user needs to query ECS instance details, list flavors, check BMS availability, browse images, or view auto-scaling group/policy status. Triggers: 弹性云服务器, ECS, 裸金属, BMS, 镜像, IMS, 弹性伸缩, AS, 伸缩组, 伸缩策略, 规格查询, flavor, instance, image, scaling.
huawei-cloud-obs-upload
huaweicloud/huaweicloud-skills
Upload local files or directories to Huawei Cloud OBS (Object Storage Service) buckets, list OBS buckets with capacity and object count, and schedule periodic uploads via crontab. Use this skill when the user wants to: (1) upload a local file or directory to an OBS bucket, (2) list OBS buckets and check their storage capacity and object count, (3) set up a scheduled/periodic upload task to automatically sync a local directory to an OBS bucket. Triggers include: user mentions "OBS", "object storage", "bucket list", "bucket capacity", "upload to OBS", "upload file", "upload directory", "scheduled upload", "periodic upload", "sync to bucket", "对象存储", "桶列表", "桶容量", "上传文件", "上传目录", "定时上传", "OBS管理"
huawei-cloud-terraform-generator
huaweicloud/huaweicloud-skills
Generate Huawei Cloud Terraform configurations and execute deployment with user-guided approval. Use this skill when users want to create Huawei Cloud infrastructure as Terraform, whether they ask explicitly for Terraform or describe goals such as deploying a website, launching an application, or creating network, compute, database, load balancing, or storage resources. Trigger when users mention 创建/create、生成/generate、部署/deploy、配置/configure、使用/use、管理/manage、华为云/Huawei Cloud、Terraform、ECS、VPC、资源/resource、云服务器/ECS、虚拟机/VM、实例/instance、网络/network、负载均衡/ELB、数据库/database、RDS、存储/storage、OBS、桶/bucket、域名/domain、DNS、证书/certificate、SSL、监控/monitoring、日志/log、备份/backup、容器/container、CCE、函数工作流/FunctionGraph
Popular devops & cloud skills
microsoft-foundry
microsoft/azure-skills
Build, deploy, evaluate, optimize, fine-tune, and manage Microsoft Foundry agents, models, and resources end to end. USE FOR: foundry, azd ai agent, azd provision/deploy, hosted agent scaffold/develop/run/deploy/troubleshoot, prompt agent create, managed harness agent create, GitHub Copilot harness agent, create agent, update agent, add tool to agent, invoke agent, agent insights, evaluate agent, batch eval, continuous eval, continuous monitoring, agent CI/CD, optimize prompt, improve prompt, optimize agent instructions, Agent Optimizer scaffold, dataset curation from traces, deploy model, model fine-tuning (SFT/DPO/RFT), Foundry project, RBAC, role assignment, permissions, quota, capacity, region, deployment failure, AI Services, create Foundry resource, knowledge index, customize deployment, onboard, availability, training-data, grader, distillation, large file upload. DO NOT USE FOR: Azure Functions, App Service, general Azure deploy (use azure-deploy), general Azure prep (use azure
azure-diagnostics
microsoft/azure-skills
Debug Azure production issues on Azure using AppLens, Azure Monitor, resource health, and safe triage. WHEN: debug production issues, troubleshoot app service, app service high CPU, app service deployment failure, troubleshoot container apps, container app 503 or target port mismatch, troubleshoot functions, function telemetry missing or stopped after a config/connection-string change, troubleshoot AKS, VM RDP, Linux SSH, VM black screen, can't connect to VM, reset VM password, NSG or firewall blocking, kubectl cannot connect, kube-system/CoreDNS failures, pod pending, crashloop, node not ready, upgrade failures, analyze logs, KQL, insights, image pull failures, cold start issues, health probe failures, resource health, root cause of errors, troubleshoot event hubs, troubleshoot service bus, messaging SDK error, AMQP connection failure, message lock lost, lock renewal during long-running processing, service bus dead letter.
azure-prepare
microsoft/azure-skills
Prepare azd-based Azure projects for deployment: generates azure.yaml, infrastructure (Bicep/Terraform), and Dockerfiles for the Azure Developer CLI (azd) workflow. USE ONLY when the user explicitly wants to use azd as the deployment tool, or the project already has an azure.yaml file. DO NOT USE FOR: non-azd deployments, Python App Service code-only deploys (use python-appservice-deploy), or cross-cloud migration (use azure-cloud-migrate). WHEN: prepare app for azd, create azure.yaml, set up azd infrastructure, modernize app for Azure with azd, deploy with azd, function app, timer trigger, service bus trigger, event-driven function, managed identity, generate Bicep, generate Terraform, create and deploy to Azure.
azure-ai
microsoft/azure-skills
Use for Azure AI: Search, Speech, OpenAI, Document Intelligence. Helps with search, vector/hybrid search, speech-to-text, text-to-speech, transcription, OCR. WHEN: AI Search, query search, vector search, hybrid search, semantic search, speech-to-text, text-to-speech, transcribe, OCR, convert text to speech.
azure-deploy
microsoft/azure-skills
Execute Azure deployments for ALREADY-PREPARED applications that have existing .azure/deployment-plan.md and infrastructure files. DO NOT use this skill when the user asks to CREATE a new application — use azure-prepare instead. This skill runs azd up, azd deploy, terraform apply, and az deployment commands with built-in error recovery. Requires .azure/deployment-plan.md from azure-prepare and validated status from azure-validate. WHEN: "run azd up", "run azd deploy", "execute deployment", "push to production", "push to cloud", "go live", "ship it", "bicep deploy", "terraform apply", "publish to Azure", "launch on Azure". DO NOT USE WHEN: "create and deploy", "build and deploy", "create a new app", "set up infrastructure", "create and deploy to Azure using Terraform" — use azure-prepare for these.
azure-validate
microsoft/azure-skills
Pre-deployment validation for Azure readiness. Run deep checks on configuration, infrastructure (Bicep or Terraform), RBAC role assignments, managed identity permissions, and prerequisites before deploying. WHEN: validate my app, check deployment readiness, run preflight checks, verify configuration, check if ready to deploy, validate azure.yaml, validate Bicep, test before deploying, troubleshoot deployment errors, validate Azure Functions, validate function app, validate serverless deployment, verify RBAC roles, check role assignments, review managed identity permissions, what-if analysis, validate Container Apps deployment.