Yandex Cloud
Search
Contact UsGet started
  • Pricing
  • Customer Stories
  • Documentation
  • Blog
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • AI for business
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Center for Technologies and Society
    • Yandex Cloud Partner program
  • Pricing
  • Customer Stories
  • Documentation
  • Blog
© 2025 Direct Cursus Technology L.L.C.
Yandex Cloud Functions
  • Comparing with other Yandex Cloud services
    • Overview
    • Managing dependencies
    • Request handler
    • Invocation context
    • Logging
    • Handling errors
    • Using the SDK
  • Tools
  • Pricing policy
  • Access management
  • Terraform reference
  • Monitoring metrics
  • Audit Trails events
  • Public materials
  • Release notes
  • FAQ

In this article:

  • YcFunction interface
  • HttpServlet class
  1. Developing in Java
  2. Invocation context

Java function invocation context

Written by
Yandex Cloud
Updated at June 23, 2025
  • YcFunction interface
  • HttpServlet class

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 interfaceYcFunction 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 classHttpServlet 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.

Was the article helpful?

Previous
Request handler
Next
Logging
© 2025 Direct Cursus Technology L.L.C.