huaweicloud/huaweicloud-skills6 files

Huawei Cloud Functiongraph Function Create

|

Specification
Skill ID
huaweicloud/huaweicloud-skills/huawei-cloud-functiongraph-function-create
Publisher
huaweicloud
Repository
huaweicloud-skills
Installs
303
Files
6
Synced
Sep 16, 2026
How to use it

Open any RiverX project, open the Skills panel in the chat, and search for this identifier. The files are fetched from the source repository at install time.

huaweicloud/huaweicloud-skills/huawei-cloud-functiongraph-function-createInstalls these files
  • SKILL.md
  • references/acceptance-criteria.md
  • references/iam-policies.md
  • references/sdk-installation-guide.md
  • references/verification-method.md
  • scripts/create_function.py

What this skill tells the agent

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:

  1. "Create a Python function named my_handler"
  2. "Deploy this code to FunctionGraph"
  3. "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 function
  • functiongraph:function:get - Query function details
  • functiongraph:function:list - List functions

See IAM Policies for detailed permission configuration.

Usage

Command

cd scripts
python create_function.py   --name <function_name>   --runtime <runtime>   --han
dler <handler>   --code <code_content>   --memory <memory_size>   --timeout <timeout>

Parameter Confirmation

ParameterRequired/OptionalDescriptionDefault
function_nameRequiredFunction name, must follow naming rules-
runtimeRequiredRuntime environment (Python3.9, etc.)-
code_contentRequiredFunction code content-
handlerRequiredFunction entry point (e.g., index.handler)-
memory_sizeOptionalMemory size in MB128
timeoutOptionalTimeout in seconds3
descriptionOptionalFunction description-

Runtime Options

RuntimeHandler FormatExample
Python3.9index.handlerdef handler(event, context):
Node.js14.18index.handlerexports.handler = (event, context) => {}
Java8com.example.Handler::handleRequestJava class method
Go1.xhandlerGo 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 function
  • function_name: Name of the created function
  • runtime: Runtime environment
  • memory_size: Allocated memory in MB
  • timeout: Function timeout in seconds
  • handler: Function entry point
  • description: 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

  1. Test before production: Always test in a development environment first
  2. Monitor resources: Set up monitoring for function invocations and errors
  3. Use environment variables: Store sensitive data in environment variables
  4. Implement error handling: Add proper error handling in function code
  5. Set appropriate timeouts: Configure timeout based on function logic

Error Handling

Error CodeDescriptionResolution
InvalidParameterInvalid input parametersCheck parameter format and valu
es
InsufficientPermissionInsufficient permissionsCheck IAM permissions
QuotaExceededResource quota exceededRequest quota increase or delete un
used functions
FunctionAlreadyExistsFunction with same name existsUse different functi
on name or delete existing function

References