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/ivs.py
| def put_metadata(
self,
channel_arn: "capo_ivs.types.channel_arn.ChannelArn",
metadata: "capo_ivs.types.stream_metadata.StreamMetadata",
*,
config_overrides: Optional[ivsClientConfig] = 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.
"""
def _handler(
req: "OperationRequest[capo_ivs.types.put_metadata_request.PutMetadataRequest]",
) -> OperationResponse[None]:
import capo_ivs._operations.amazon_interactive_video_service.put_metadata
output, http_response = (
capo_ivs._operations.amazon_interactive_video_service.put_metadata.put_metadata(
req.options, req.input
)
)
return OperationResponse(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 = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|