Java function invocation context
Invocation context is the current function invocation metadata comprising function ID, function version ID, function version RAM size, request ID, and Yandex Cloud API authentication parameters.
The availability of the invocation context from within the function and the method of obtaining it depend on the Java programming model used.
YcFunction interface
If you are using the YcFunction interface as your programming model, the invocation context is a yandex.cloud.sdk.functions.Context class object. To get information about the function version properties, use this object's methods in the handler method:
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 request ID.getTokenJson(): Returns the parameters for authentication in the Yandex Cloud API.
For more information, see Using the YcFunction interface for a Java handler.
HttpServlet class
If you are using the HttpServlet class as your programming model, you can get the invocation context in HTTP headers together with the information on the HTTP request used to invoke the function:
Lambda-Runtime-Function-Name: Function string ID.Lambda-Runtime-Function-Version: Function version string ID.Lambda-Runtime-Memory-Limit: Amount of memory specified when creating the version, MB.Lambda-Runtime-Aws-Request-Id: Request ID.Lambda-Runtime-Token-Json: Parameters for authentication in the APIs of Yandex Cloud services.
For more information, see Using the HttpServlet class to specify a Java handler.