Skip to content

update_stream

update_stream(
    current_version: Version,
    *,
    config_overrides: Optional[KinesisVideoClientConfig] = None,
    stream_name: Optional[StreamName] = None,
    stream_arn: Optional[ResourceARN] = None,
    device_name: Optional[DeviceName] = None,
    media_type: Optional[MediaType] = None,
) -> UpdateStreamOutput

Updates stream metadata, such as the device name and media type.

You must provide the stream name or the Amazon Resource Name (ARN) of the stream.

To make sure that you have the latest version of the stream before updating it, you can specify the stream version. Kinesis Video Streams assigns a version to each stream. When you update a stream, Kinesis Video Streams assigns a new version number. To get the latest stream version, use the DescribeStream API.

UpdateStream is an asynchronous operation, and takes time to complete.

Parameters:

  • stream_name (Optional[StreamName], default: None ) –

    The name of the stream whose metadata you want to update.

    The stream name is an identifier for the stream, and must be unique for each account and region.

  • stream_arn (Optional[ResourceARN], default: None ) –

    The ARN of the stream whose metadata you want to update.

  • current_version (Version) –

    The version of the stream whose metadata you want to update.

  • device_name (Optional[DeviceName], default: None ) –

    The name of the device that is writing to the stream.

    In the current implementation, Kinesis Video Streams does not use this name.

  • media_type (Optional[MediaType], default: None ) –

    The stream's media type. Use MediaType to specify the type of content that the stream contains to the consumers of the stream. For more information about media types, see Media Types. If you choose to specify the MediaType, see Naming Requirements.

    To play video on the console, you must specify the correct video type. For example, if the video in the stream is H.264, specify video/h264 as the MediaType.

Raises:

  • ClientLimitExceededException –

    Kinesis Video Streams has throttled the request because you have exceeded the limit of allowed client calls. Try making the call later.

  • InvalidArgumentException –

    The value for this input parameter is invalid.

  • NotAuthorizedException –

    The caller is not authorized to perform this operation.

  • ResourceInUseException –

    When the input StreamARN or ChannelARN in CLOUD_STORAGE_MODE is already mapped to a different Kinesis Video Stream resource, or if the provided input StreamARN or ChannelARN is not in Active status, try one of the following :

    1. The DescribeMediaStorageConfiguration API to determine what the stream given channel is mapped to.

    2. The DescribeMappedResourceConfiguration API to determine the channel that the given stream is mapped to.

    3. The DescribeStream or DescribeSignalingChannel API to determine the status of the resource.

  • ResourceNotFoundException –

    Amazon Kinesis Video Streams can't find the stream that you specified.

  • VersionMismatchException –

    The stream version that you specified is not the latest version. To get the latest version, use the DescribeStream API.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_kinesis_video/_services/kinesis_video.py
def update_stream(
    self,
    current_version: "capo_kinesis_video.types.version.Version",
    *,
    config_overrides: Optional[KinesisVideoClientConfig] = None,
    stream_name: Optional["capo_kinesis_video.types.stream_name.StreamName"] = None,
    stream_arn: Optional[
        "capo_kinesis_video.types.resource_arn.ResourceARN"
    ] = None,
    device_name: Optional["capo_kinesis_video.types.device_name.DeviceName"] = None,
    media_type: Optional["capo_kinesis_video.types.media_type.MediaType"] = None,
) -> "capo_kinesis_video.types.update_stream_output.UpdateStreamOutput":
    """<p>Updates stream metadata, such as the device name and media type.</p> <p>You must provide the stream name or the Amazon Resource Name (ARN) of the stream.</p> <p>To make sure that you have the latest version of the stream before updating it, you can specify the stream version. Kinesis Video Streams assigns a version to each stream. When you update a stream, Kinesis Video Streams assigns a new version number. To get the latest stream version, use the <code>DescribeStream</code> API. </p> <p> <code>UpdateStream</code> is an asynchronous operation, and takes time to complete.</p>

    Args:
        stream_name: <p>The name of the stream whose metadata you want to update.</p> <p>The stream name is an identifier for the stream, and must be unique for each account and region.</p>
        stream_arn: <p>The ARN of the stream whose metadata you want to update.</p>
        current_version: <p>The version of the stream whose metadata you want to update.</p>
        device_name: <p>The name of the device that is writing to the stream. </p> <note> <p> In the current implementation, Kinesis Video Streams does not use this name. </p> </note>
        media_type: <p>The stream's media type. Use <code>MediaType</code> to specify the type of content that the stream contains to the consumers of the stream. For more information about media types, see <a href="http://www.iana.org/assignments/media-types/media-types.xhtml">Media Types</a>. If you choose to specify the <code>MediaType</code>, see <a href="https://tools.ietf.org/html/rfc6838#section-4.2">Naming Requirements</a>.</p> <p>To play video on the console, you must specify the correct video type. For example, if the video in the stream is H.264, specify <code>video/h264</code> as the <code>MediaType</code>.</p>

    Raises:
        capo_kinesis_video.errors.client_limit_exceeded_exception.ClientLimitExceededException: <p>Kinesis Video Streams has throttled the request because you have exceeded the limit of allowed client calls. Try making the call later.</p>
        capo_kinesis_video.errors.invalid_argument_exception.InvalidArgumentException: <p>The value for this input parameter is invalid.</p>
        capo_kinesis_video.errors.not_authorized_exception.NotAuthorizedException: <p>The caller is not authorized to perform this operation.</p>
        capo_kinesis_video.errors.resource_in_use_exception.ResourceInUseException: <p>When the input <code>StreamARN</code> or <code>ChannelARN</code> in <code>CLOUD_STORAGE_MODE</code> is already mapped to a different Kinesis Video Stream resource, or if the provided input <code>StreamARN</code> or <code>ChannelARN</code> is not in Active status, try one of the following : </p> <ol> <li> <p>The <code>DescribeMediaStorageConfiguration</code> API to determine what the stream given channel is mapped to. </p> </li> <li> <p>The <code>DescribeMappedResourceConfiguration</code> API to determine the channel that the given stream is mapped to. </p> </li> <li> <p>The <code>DescribeStream</code> or <code>DescribeSignalingChannel</code> API to determine the status of the resource. </p> </li> </ol>
        capo_kinesis_video.errors.resource_not_found_exception.ResourceNotFoundException: <p>Amazon Kinesis Video Streams can't find the stream that you specified.</p>
        capo_kinesis_video.errors.version_mismatch_exception.VersionMismatchException: <p>The stream version that you specified is not the latest version. To get the latest version, use the <a href="https://docs.aws.amazon.com/kinesisvideostreams/latest/dg/API_DescribeStream.html">DescribeStream</a> API.</p>
        capo_kinesis_video.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_kinesis_video.types.update_stream_input.UpdateStreamInput]",
    ) -> OperationResponse[
        "capo_kinesis_video.types.update_stream_output.UpdateStreamOutput"
    ]:
        import capo_kinesis_video._operations.kinesis_video_20170930.update_stream

        output, http_response = (
            capo_kinesis_video._operations.kinesis_video_20170930.update_stream.update_stream(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateStream")
    )
    input_: capo_kinesis_video.types.update_stream_input.UpdateStreamInput = {
        "current_version": current_version
    }
    if stream_name is not None:
        input_["stream_name"] = stream_name
    if stream_arn is not None:
        input_["stream_arn"] = stream_arn
    if device_name is not None:
        input_["device_name"] = device_name
    if media_type is not None:
        input_["media_type"] = media_type

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output