LambdaClient.invoke_with_response_stream
rboto-lambda==0.4.0 · Service index · Types
Model summary (excerpt): Configure your Lambda Event Functions to stream response payloads back to clients. For more information, see Configuring a Lambda function to stream responses . This operation requires permission for the lambda:InvokeFunction action. For details on how to set up permissions for cross-account invocations, see Granting function access to other accounts .
Install and imports
from rboto import LambdaClient
from rboto_lambda.types import (
InvokeWithResponseStreamOutput,
LogType,
ResponseStreamingInvocationType,
)
Signature
async def invoke_with_response_stream(
*,
function_name: str,
log_type: LogType | None = None,
client_context: str | None = None,
qualifier: str | None = None,
payload: bytes | None = None,
tenant_id: str | None = None,
invocation_type: ResponseStreamingInvocationType | None = None,
) -> InvokeWithResponseStreamOutput: ...
Arguments without defaults are required. None omits an optional request argument. Static types do not validate resource existence, permissions, lengths, ranges, or conditional service requirements.
Arguments
| Argument | Required | Model notes (excerpt) |
|---|---|---|
function_name |
Yes | The name or ARN of the Lambda function. Name formats Function name – my-function . Function ARN – arn:aws:lambda:us-west-2:123456789012:function:my-function . Partial ARN – 123456789012:function:my-function . The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length. |
log_type |
No | Set to Tail to include the execution log in the response. Applies to synchronously invoked functions only. |
client_context |
No | Up to 3,583 bytes of base64-encoded data about the invoking client to pass to the function in the context object. ClientContext is logged to CloudTrail if you turn on data events. |
qualifier |
No | The alias name. |
payload |
No | The JSON that you want to provide to your Lambda function as input. You can enter the JSON directly. For example, --payload '{ "key": "value" }' . You can also specify a file path. For example, --payload file://payload.json . |
tenant_id |
No | The identifier of the tenant in a multi-tenant Lambda function. |
invocation_type |
No | Use one of the following options: RequestResponse (default) – Invoke the function synchronously. Keep the connection open until the function returns a response or times out. The API operation response includes the function response and additional data. DryRun – Validate parameter values and verify that the IAM user or role has permission to invoke the function. |
Output
InvokeWithResponseStreamOutput.
Typed response mapping, accessed as response["field"].
| Field | Type | Presence | References |
|---|---|---|---|
status_code |
int |
Always present | — |
executed_version |
str | None |
Always present | — |
event_stream |
AsyncIterator[InvokeWithResponseStreamResponseEvent] |
Always present | InvokeWithResponseStreamResponseEvent |
response_stream_content_type |
str | None |
Always present | — |
| None means a value can be absent. Output mappings include every declared key; optional input keys may be omitted. Unknown output enum/union variants are not automatically valid inputs.
Related types
InvokeWithResponseStreamOutput, LogType, ResponseStreamingInvocationType
Follow these links for nested inputs and outputs; recursive types link back to the same type page.
Pagination and streaming
No generated paginator for this operation.
Output streams: InvokeWithResponseStreamOutput.
Consume with async for. Do not reuse a consumed stream.
Errors
Import from rboto_lambda.exceptions:
CodeArtifactUserDeletedError, CodeArtifactUserFailedError, CodeArtifactUserPendingError, EC2AccessDeniedError, EC2ThrottledError, EC2UnexpectedError, EFSIOError, EFSMountConnectivityError, EFSMountFailureError, EFSMountTimeoutError, ENILimitReachedError, InvalidParameterValueError, InvalidRequestContentError, InvalidRuntimeError, InvalidSecurityGroupIDError, InvalidSubnetIDError, InvalidZipFileError, KMSAccessDeniedError, KMSDisabledError, KMSInvalidStateError, KMSNotFoundError, NoPublishedVersionError, RecursiveInvocationError, RequestTooLargeError, ResourceConflictError, ResourceNotFoundError, ResourceNotReadyError, RuntimeAliasDeletedError, RuntimeVersionDeletedError, S3FilesMountConnectivityError, S3FilesMountFailureError, S3FilesMountTimeoutError, SerializedRequestEntityTooLargeError, ServiceError, ServiceQuotaExceededError, SnapStartError, SnapStartNotReadyError, SnapStartRegenerationFailureError, SnapStartTimeoutError, SubnetIPAddressLimitReachedError, TooManyRequestsError, UnsupportedMediaTypeError.
Other service failures use the service base error; credential, transport and timeout failures use shared errors.