Skip to content

update_stream_storage_configuration async

update_stream_storage_configuration(
    current_version: Version,
    stream_storage_configuration: StreamStorageConfiguration,
    *,
    config_overrides: Optional[AsyncKinesisVideoClientConfig] = None,
    stream_name: Optional[StreamName] = None,
    stream_arn: Optional[ResourceARN] = None,
) -> UpdateStreamStorageConfigurationOutput

Updates the storage configuration for an existing Kinesis video stream.

This operation allows you to modify the storage tier settings for a stream, enabling you to optimize storage costs and performance based on your access patterns.

UpdateStreamStorageConfiguration is an asynchronous operation.

You must have permissions for the KinesisVideo:UpdateStreamStorageConfiguration action.

Parameters:

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

    The name of the stream for which you want to update the storage configuration.

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

    The Amazon Resource Name (ARN) of the stream for which you want to update the storage configuration.

  • current_version (Version) –

    The version of the stream whose storage configuration you want to change. To get the version, call either the DescribeStream or the ListStreams API.

  • stream_storage_configuration (StreamStorageConfiguration) –

    The new storage configuration for the stream. This includes the default storage tier that determines how stream data is stored and accessed.

    Different storage tiers offer varying levels of performance and cost optimization to match your specific use case requirements.

Raises:

  • AccessDeniedException –

    You do not have required permissions to perform this operation.

  • 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.

  • 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/async_kinesis_video.py
async def update_stream_storage_configuration(
    self,
    current_version: "capo_kinesis_video.types.version.Version",
    stream_storage_configuration: "capo_kinesis_video.types.stream_storage_configuration.StreamStorageConfiguration",
    *,
    config_overrides: Optional[AsyncKinesisVideoClientConfig] = None,
    stream_name: Optional["capo_kinesis_video.types.stream_name.StreamName"] = None,
    stream_arn: Optional[
        "capo_kinesis_video.types.resource_arn.ResourceARN"
    ] = None,
) -> "capo_kinesis_video.types.update_stream_storage_configuration_output.UpdateStreamStorageConfigurationOutput":
    """<p>Updates the storage configuration for an existing Kinesis video stream.</p> <p>This operation allows you to modify the storage tier settings for a stream, enabling you to optimize storage costs and performance based on your access patterns.</p> <p> <code>UpdateStreamStorageConfiguration</code> is an asynchronous operation.</p> <p>You must have permissions for the <code>KinesisVideo:UpdateStreamStorageConfiguration</code> action.</p>

    Args:
        stream_name: <p>The name of the stream for which you want to update the storage configuration.</p>
        stream_arn: <p>The Amazon Resource Name (ARN) of the stream for which you want to update the storage configuration.</p>
        current_version: <p>The version of the stream whose storage configuration you want to change. To get the version, call either the <code>DescribeStream</code> or the <code>ListStreams</code> API.</p>
        stream_storage_configuration: <p>The new storage configuration for the stream. This includes the default storage tier that determines how stream data is stored and accessed.</p> <p>Different storage tiers offer varying levels of performance and cost optimization to match your specific use case requirements.</p>

    Raises:
        capo_kinesis_video.errors.access_denied_exception.AccessDeniedException: <p>You do not have required permissions to perform this operation.</p>
        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.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.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_kinesis_video.types.update_stream_storage_configuration_input.UpdateStreamStorageConfigurationInput]",
    ) -> AsyncOperationResponse[
        "capo_kinesis_video.types.update_stream_storage_configuration_output.UpdateStreamStorageConfigurationOutput"
    ]:
        import capo_kinesis_video._operations.kinesis_video_20170930.update_stream_storage_configuration

        (
            output,
            http_response,
        ) = await capo_kinesis_video._operations.kinesis_video_20170930.update_stream_storage_configuration.async_update_stream_storage_configuration(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateStreamStorageConfiguration")
    )
    input_: capo_kinesis_video.types.update_stream_storage_configuration_input.UpdateStreamStorageConfigurationInput = {
        "current_version": current_version,
        "stream_storage_configuration": stream_storage_configuration,
    }
    if stream_name is not None:
        input_["stream_name"] = stream_name
    if stream_arn is not None:
        input_["stream_arn"] = stream_arn

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