Invoking FunctionGraph Functions¶
Following pages demonstrate how to call a FunctionGraph implemented in Python:
For details on function invocation, see
in FunctionGraph API reference.
Prerequisites¶
Environment Variables¶
Following environment variables need to be set:
Name |
Description |
|---|---|
OTC_SDK_PROJECTID |
Project ID |
OTC_SDK_REGION |
Region, e.g. “eu-de” |
OTC_SDK_AK |
Access Key (*) |
OTC_SDK_SK |
Secret Key |
OTC_USER_NAME |
User name (*) |
OTC_USER_PASSWORD |
User password |
OTC_DOMAIN_NAME |
Domain name |
OTC_IAM_ENDPOINT |
IAM Endpoint, e.g. https://iam.eu-de.otc.t-systems.com/v3 |
(* User needs to have permission to invoke FunctionGraph)
Deployed FunctionGraph Event Function¶
Use following settings to create the FunctionGraph event function using the FunctionGraph console:
Project : as specified in the environment variable
OTC_SDK_PROJECTIDRegion: as specified in the environment variable
OTC_SDK_REGIONName:
python-sample-invoke-functionRuntime:
Python 3.10Version:
latestApplication:
defaultFunction code: Use the following sample code for the function code.
# -*- coding:utf-8 -*- import json def handler (event, context): return { "statusCode": 200, "isBase64Encoded": False, "body": json.dumps(event), "headers": { "Content-Type": "application/json" } }
Handler name:
index.handler
Permissions¶
Make sure that your user has the necessary permissions to invoke the function.