:doc:`KinesisVideo <../../kinesisvideo>` / Client / update_data_retention

*********************
update_data_retention
*********************



.. py:method:: KinesisVideo.Client.update_data_retention(**kwargs)

  

  Increases or decreases the stream's data retention period by the value that you specify. To indicate whether you want to increase or decrease the data retention period, specify the ``Operation`` parameter in the request body. In the request, you must specify either the ``StreamName`` or the ``StreamARN``.

   

  This operation requires permission for the ``KinesisVideo:UpdateDataRetention`` action.

   

  Changing the data retention period affects the data in the stream as follows:

   

  
  * If the data retention period is increased, existing data is retained for the new retention period. For example, if the data retention period is increased from one hour to seven hours, all existing data is retained for seven hours.
   
  * If the data retention period is decreased, existing data is retained for the new retention period. For example, if the data retention period is decreased from seven hours to one hour, all existing data is retained for one hour, and any data older than one hour is deleted immediately.
  

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/kinesisvideo-2017-09-30/UpdateDataRetention>`_  


  **Request Syntax**
  ::

    response = client.update_data_retention(
        StreamName='string',
        StreamARN='string',
        CurrentVersion='string',
        Operation='INCREASE_DATA_RETENTION'|'DECREASE_DATA_RETENTION',
        DataRetentionChangeInHours=123
    )
    
  :type StreamName: string
  :param StreamName: 

    The name of the stream whose retention period you want to change.

    

  
  :type StreamARN: string
  :param StreamARN: 

    The Amazon Resource Name (ARN) of the stream whose retention period you want to change.

    

  
  :type CurrentVersion: string
  :param CurrentVersion: **[REQUIRED]** 

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

    

  
  :type Operation: string
  :param Operation: **[REQUIRED]** 

    Indicates whether you want to increase or decrease the retention period.

    

  
  :type DataRetentionChangeInHours: integer
  :param DataRetentionChangeInHours: **[REQUIRED]** 

    The number of hours to adjust the current retention by. The value you specify is added to or subtracted from the current value, depending on the ``operation``.

     

    The minimum value for data retention is 0 and the maximum value is 87600 (ten years).

    

  
  
  :rtype: dict
  :returns: 
    
    **Response Syntax**

    
    ::

      {}
      
    **Response Structure**

    

    - *(dict) --* 
  
  **Exceptions**
  
  *   :py:class:`KinesisVideo.Client.exceptions.ClientLimitExceededException`

  
  *   :py:class:`KinesisVideo.Client.exceptions.InvalidArgumentException`

  
  *   :py:class:`KinesisVideo.Client.exceptions.ResourceNotFoundException`

  
  *   :py:class:`KinesisVideo.Client.exceptions.ResourceInUseException`

  
  *   :py:class:`KinesisVideo.Client.exceptions.NotAuthorizedException`

  
  *   :py:class:`KinesisVideo.Client.exceptions.VersionMismatchException`

  