Create FunctionGraph functions on Huawei Cloud. Use this skill when users ask to create, deploy, or upload cloud functions, serverless functions, or Function...
文档
huawei-cloud-functiongraph-trigger-create
试用Create and configure scheduled TIMER triggers for Huawei Cloud FunctionGraph functions using Quartz Cron expressions. Use this skill when users ask to create...
它能做什么
Create and configure scheduled TIMER triggers for Huawei Cloud FunctionGraph functions using Quartz Cron expressions. Use this skill when users ask to create triggers, schedule function execution, set up periodic tasks, or configure timers for functions. Triggered by keywords like "create trigger", "set up trigger", "schedule function", "periodic task", "timer", "cron", "创建云函数触发器", "配置云函数触发器", "云函数定时触发", "定时执行", "定时任务", "创建定时器", "FunctionGraph trigger", "schedule function execution".
技能文档
Overview
This skill enables the creation and configuration of scheduled triggers (TIMER type) for Huawei Cloud FunctionGraph functions. It supports Quartz Cron expression format for flexible scheduling configurations.
The trigger allows automatic execution of serverless functions at specified time intervals, making it ideal for:
- Periodic data processing tasks
- Scheduled backup operations
- Regular monitoring and health checks
- Time-based notification systems
Prerequisites
Before using this skill, ensure the following requirements are met:
- Python Environment: Python 3.9+ installed
- SDK Installation: Install FunctionGraph SDK:
pip install huaweicloudsdkfunctiongraph - Environment Variables: Configure the following environment variables:
HUAWEI_AK: Huawei Cloud Access KeyHUAWEI_SK: Huawei Cloud Secret KeyHUAWEI_REGION: Target region (e.g.,cn-north-4)HUAWEI_PROJECT_ID: Project ID
- FunctionGraph Function: Target function must already exist in the specified region
- Network Access: Stable network connection to Huawei Cloud API endpoints
Usage
Basic Command Structure
cd scripts
python create_trigger.py \
--function-urn "urn:fss:cn-north-4:project_id:function:default:my-function:latest" \
--name "daily-trigger" \
--schedule "0 0 2 * * ?" \
--schedule-type "Cron" \
--status "ACTIVE"
Examples
Cron Expression Trigger
cd scripts
python create_trigger.py \
--function-urn "urn:fss:cn-north-4:project_id:function:default:my-function:latest" \
--name "daily-trigger" \
--schedule "0 0 8 * * ?" \
--schedule-type "Cron"
Fixed Rate Trigger
cd scripts
python create_trigger.py \
--function-urn "urn:fss:cn-north-4:project_id:function:default:my-function:latest" \
--name "every-5min" \
--schedule "5m" \
--schedule-type "Rate"
Cron Expression Format
FunctionGraph uses Quartz Cron format with 6 or 7 fields:
┌───────────── second (0-59)
│ ┌───────────── minute (0-59)
│ │ ┌───────────── hour (0-23)
│ │ │ ┌───────────── day of month (1-31)
│ │ │ │ ┌───────────── month (1-12)
│ │ │ │ │ ┌───────────── day of week (1-7, 1=Sunday)
│ │ │ │ │ │
* * * * * ?
For detailed Cron expression reference including special characters and common examples, see Cron Expression Reference.
Parameters Confirmation
Before creating the trigger, confirm the following parameters:
| Parameter | Required | Description | Example |
|---|---|---|---|
function_urn | Yes | Target function URN | urn:fss:cn-north-4:xxx:function:default:my-func:latest |
trigger_name | Yes | Trigger name (1-64 chars) | daily-trigger |
schedule | Yes | Cron expression or Rate value | 0 0 2 * * ? or 5m |
schedule_type | No | Cron (default) or Rate | Cron |
enable_status | No | ACTIVE (default) or DISABLED | ACTIVE |
user_event | No | Additional user event data | optional info |
Confirmation Checklist
- Function URN is correct and function exists
- Cron expression has been validated
- Trigger name follows naming conventions
- IAM permissions are sufficient
- Region matches the function location
Output Format
Success Response
{
"status": "success",
"trigger_id": "timer-xxx-xxx-xxx",
"trigger_name": "daily-trigger",
"trigger_type": "TIMER",
"schedule": "0 0 2 * * ?",
"enable_status": "ACTIVE",
"message": "Trigger created successfully"
}
Error Response
{
"status": "failed",
"error_code": "TriggerAlreadyExists",
"message": "Trigger with the same name already exists"
}
For complete error codes and troubleshooting information, see Cron Expression Reference.
Verification Method
After creating the trigger, verify the configuration:
1. List Function Triggers
Navigate to FunctionGraph console → Function details → Triggers tab to view all triggers
2. Check Trigger Details
Navigate to FunctionGraph console → Function details → Triggers → View trigger details
3. Monitor Trigger Execution
Navigate to FunctionGraph console → Function details → Triggers → View execution history
Expected indicators:
- Trigger status: Active
- Next execution time: Correctly calculated
- Execution history: No failed invocations
Best Practices
Cron Expression Best Practices
- Avoid frequent executions: Use intervals ≥ 5 minutes unless necessary
- Consider timezone: FunctionGraph uses UTC by default
- Use
?for unused day field: Either day-of-month or day-of-week should use? - Validate before creation: Test expressions using online Cron validators
Naming Conventions
- Use descriptive names:
daily-data-sync,hourly-health-check - Follow pattern:
[frequency]-[purpose] - Maximum 64 characters
- Use lowercase with hyphens
Security Considerations
- Least privilege: Grant minimal IAM permissions
- Enable encryption: Use KMS for sensitive function inputs
- Monitor executions: Set up Cloud Eye alarms for failures
- Rate limiting: Configure appropriate retry parameters
Operational Recommendations
- Start with disabled status for testing
- Document trigger purpose in description field
- Set appropriate retries for transient failures
- Monitor first executions after enabling
Reference Documents
For detailed information, refer to:
- SDK Installation Guide
- IAM Policies
- Verification Method
- Acceptance Criteria
- Cron Expression Reference
Important Notes
Compatibility Notes
This skill is designed to work with Huawei Cloud FunctionGraph API. The tags field helps with skill discovery and categorization, while the version field follows semantic versioning for skill updates.
Limitations
- Maximum triggers: Each function supports up to 10 triggers by default
- Cron precision: Second-level scheduling may have minor delays
- Timeout handling: Function timeout should be less than trigger interval
- Cold start: First executions may have additional latency
Cost Implications
- No additional cost for trigger configuration
- Function execution billed per invocation
- Consider execution frequency for cost optimization
Common Pitfalls
- Wrong timezone: Remember FunctionGraph uses UTC
- Overlapping schedules: Multiple triggers may cause concurrent executions
- Long-running functions: Ensure function completes before next trigger
- Cron syntax errors: Validate expression format before deployment
For troubleshooting and error codes, refer to Cron Expression Reference.
Related Skills:
huawei-cloud-functiongraph-function-createhuawei-cloud-functiongraph-deploy
相关技能
Generate Huawei Cloud Terraform configurations and execute deployment with user-guided approval. Use this skill when users want to create Huawei Cloud infras...
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"
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...
按关键词或类目检索华为云技能目录,并安装匹配的技能。
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 平台,并完成大模型与机器人通道配置。