:doc:`MediaStore <../../mediastore>` / Client / put_lifecycle_policy

********************
put_lifecycle_policy
********************



.. py:method:: MediaStore.Client.put_lifecycle_policy(**kwargs)

  

  Writes an object lifecycle policy to a container. If the container already has an object lifecycle policy, the service replaces the existing policy with the new policy. It takes up to 20 minutes for the change to take effect.

   

  For information about how to construct an object lifecycle policy, see `Components of an Object Lifecycle Policy <https://docs.aws.amazon.com/mediastore/latest/ug/policies-object-lifecycle-components.html>`__.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/mediastore-2017-09-01/PutLifecyclePolicy>`_  


  **Request Syntax**
  ::

    response = client.put_lifecycle_policy(
        ContainerName='string',
        LifecyclePolicy='string'
    )
    
  :type ContainerName: string
  :param ContainerName: **[REQUIRED]** 

    The name of the container that you want to assign the object lifecycle policy to.

    

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

    The object lifecycle policy to apply to the container.

    

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

    
    ::

      {}
      
    **Response Structure**

    

    - *(dict) --* 
  
  **Exceptions**
  
  *   :py:class:`MediaStore.Client.exceptions.ContainerInUseException`

  
  *   :py:class:`MediaStore.Client.exceptions.ContainerNotFoundException`

  
  *   :py:class:`MediaStore.Client.exceptions.InternalServerError`

  