Skip to content

put_metadata async

put_metadata(
    channel_arn: ChannelArn,
    metadata: StreamMetadata,
    *,
    config_overrides: Optional[AsyncivsClientConfig] = None,
) -> None

Inserts metadata into the active stream of the specified channel. At most 5 requests per second per channel are allowed, each with a maximum 1 KB payload. (If 5 TPS is not sufficient for your needs, we recommend batching your data into a single PutMetadata call.) At most 155 requests per second per account are allowed. Also see Embedding Metadata within a Video Stream in the Amazon IVS User Guide.

Parameters:

  • channel_arn (ChannelArn) –

    ARN of the channel into which metadata is inserted. This channel must have an active stream.

  • metadata (StreamMetadata) –

    Metadata to insert into the stream. Maximum: 1 KB per request.

Raises:

Source code in docs_src/capo_ivs/_services/async_ivs.py
async def put_metadata(
    self,
    channel_arn: "capo_ivs.types.channel_arn.ChannelArn",
    metadata: "capo_ivs.types.stream_metadata.StreamMetadata",
    *,
    config_overrides: Optional[AsyncivsClientConfig] = None,
) -> None:
    """<p>Inserts metadata into the active stream of the specified channel. At most 5 requests per second per channel are allowed, each with a maximum 1 KB payload. (If 5 TPS is not sufficient for your needs, we recommend batching your data into a single PutMetadata call.) At most 155 requests per second per account are allowed. Also see <a href="https://docs.aws.amazon.com/ivs/latest/userguide/metadata.html">Embedding Metadata within a Video Stream</a> in the <i>Amazon IVS User Guide</i>.</p>

    Args:
        channel_arn: <p>ARN of the channel into which metadata is inserted. This channel must have an active stream.</p>
        metadata: <p>Metadata to insert into the stream. Maximum: 1 KB per request.</p>

    Raises:
        capo_ivs.errors.access_denied_exception.AccessDeniedException: <p>User does not have sufficient access to perform this action.</p>
        capo_ivs.errors.channel_not_broadcasting.ChannelNotBroadcasting: <p>The stream is offline for the given channel ARN.</p>
        capo_ivs.errors.resource_not_found_exception.ResourceNotFoundException: <p>Request references a resource which does not exist.</p>
        capo_ivs.errors.throttling_exception.ThrottlingException: <p>Request was denied due to request throttling.</p>
        capo_ivs.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints specified by an Amazon Web Services service.</p>
        capo_ivs.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_ivs.types.put_metadata_request.PutMetadataRequest]",
    ) -> AsyncOperationResponse[None]:
        import capo_ivs._operations.amazon_interactive_video_service.put_metadata

        (
            output,
            http_response,
        ) = await capo_ivs._operations.amazon_interactive_video_service.put_metadata.async_put_metadata(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_ivs.types.put_metadata_request.PutMetadataRequest",
    ) -> dict[str, Any]:
        import capo_ivs.types.put_metadata_request

        return capo_ivs.types.put_metadata_request.redact_sensitive(input_)

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("PutMetadata", redact_input=_redact_input),
    )
    input_: capo_ivs.types.put_metadata_request.PutMetadataRequest = {
        "channel_arn": channel_arn,
        "metadata": metadata,
    }

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output