Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions en/functions/lang/python/context.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
_Invocation context_ is an object that contains certain [execution context](../../concepts/runtime/execution-context.md) parameters as well as invocation parameters for the Python function itself. It is accepted by the [call handler](handler.md) as its second argument.

The invocation context contains:
* `function_folder_id` - Function Folder.
* `function_name`: Function ID.
* `function_version`: Function version ID.
* `deadline_ms` - Unix-time (Epoch time) of a call timeout in milliseconds, i.e. a moment which `get_remaining_time_in_millis()` counts down.
* `memory_limit_in_mb`: Amount of memory specified at version creation, MB.
* `request_id`: ID of the request being handled.
* `token`: {{ yandex-cloud }} API authentication parameters.
Expand All @@ -22,7 +24,7 @@ Invocation context is required for a function to have access to environment info

If a function has a service account specified, the `token` parameter contains information for authentication on behalf of this service account:
* `access_token`: [IAM token](../../../iam/concepts/authorization/iam-token.md).
* `expires_in`: Token lifetime in seconds.
* `expires_in`: Token lifetime in seconds from the invocation.
* `token_type`: Token type (`Bearer`).

You can also get this information using the metadata service. For more information, see [{#T}](../../../compute/operations/vm-connect/auth-inside-vm.md#auth-inside-vm).
You can also get this information using the metadata service. For more information, see [{#T}](../../../compute/operations/vm-connect/auth-inside-vm.md#auth-inside-vm).
6 changes: 4 additions & 2 deletions ru/functions/lang/python/context.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
_Контекст вызова_ — это объект, который содержит некоторые параметры [контекста выполнения](../../concepts/runtime/execution-context.md) и параметры вызова самой функции на Python. Принимается [обработчиком запросов](handler.md) в качестве второго аргумента.

Контекст вызова содержит:
* `function_folder_id` - каталог функции;
* `function_name` — идентификатор функции;
* `function_version` — идентификатор версии функции;
* `deadline_ms` - Unix-время (Epoch time) таймаута вызова в миллисекундах, т.е. момент времени до которого ведёт обратный отсчёт функция `get_remaining_time_in_millis()`
* `memory_limit_in_mb` — объем памяти, указанный при создании версии, МБ;
* `request_id` — идентификатор обрабатываемого запроса;
* `token` — параметры для аутентификации в API сервисов {{ yandex-cloud }}.
Expand All @@ -22,7 +24,7 @@ _Контекст вызова_ — это объект, который соде

Если в функции указан сервисный аккаунт, то параметр `token` содержит информацию для аутентификации от имени этого сервисного аккаунта:
* `access_token` — [IAM-токен](../../../iam/concepts/authorization/iam-token.md);
* `expires_in` — время жизни токена в секундах;
* `expires_in` — оставшееся время жизни токена в секундах вычисленное в момент вызова функции;
* `token_type` — тип токена (`Bearer`).

Также данную информацию можно получить с помощью сервиса метаданных. Подробнее об этом способе читайте в разделе [{#T}](../../../compute/operations/vm-connect/auth-inside-vm.md#auth-inside-vm).
Также данную информацию можно получить с помощью сервиса метаданных. Подробнее об этом способе читайте в разделе [{#T}](../../../compute/operations/vm-connect/auth-inside-vm.md#auth-inside-vm).