Kotlin function invocation context
Written by
Updated at August 22, 2024
Invocation context is an object that is optionally accepted by the request handler if using the YcFunction interface as the programming model. Invocation context is an object of the yandex.cloud.sdk.functions.Context
type. It provides the following methods for getting information about function version properties:
getFunctionId()
: Returns the string ID of the function.getFunctionVersionId()
: Returns the string ID of the function version.getMemoryLimitInMB()
: Returns the amount of memory specified when creating the version, MB.getRequestId()
: Returns the ID of the request being handled.getTokenJson()
: Returns the parameters required for authentication in the Yandex Cloud API.
To get information from the invocation context, use one of the above functions in the handler method.