NavigationContentFooter
Jump toSuggest an edit
Was this page helpful?

Functions handlers reference

Reviewed on 15 October 2024Published on 09 April 2024

A handler is a routine/function/method that processes specific events. Upon invoking your function, the handler is executed and returns an output.

To learn how to package a function and its dependencies in a zip file, refer to the dedicated documentation.

Handler syntaxLink to this anchor

For Python functions, the handler must be written in the <folder>/<file>.<function_name> format.

  • If the handle function is defined in a single file named handler.py: the handler name will be handler.handle.

  • If the handle function is defined in a file named handler.py in a root folder: the handler will be handler.handle.

  • If the handle function is defined in a file named handler.py within a folder (for example, myFunction/handler.py): the handler will be myFunction/handler.handle.

Python handler example

def handle(event, context):
return {
"body": {
"message": 'Hello, world',
},
"statusCode": 200,
}
Was this page helpful?
API DocsScaleway consoleDedibox consoleScaleway LearningScaleway.comPricingBlogCareers
© 2023-2025 – Scaleway