:doc:`ElasticBeanstalk <../../elasticbeanstalk>` / Client / delete_application_version

**************************
delete_application_version
**************************



.. py:method:: ElasticBeanstalk.Client.delete_application_version(**kwargs)

  

  Deletes the specified version from the specified application.

   

  .. note::

    

    You cannot delete an application version that is associated with a running environment.

    

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/DeleteApplicationVersion>`_  


  **Request Syntax**
  ::

    response = client.delete_application_version(
        ApplicationName='string',
        VersionLabel='string',
        DeleteSourceBundle=True|False
    )
    
  :type ApplicationName: string
  :param ApplicationName: **[REQUIRED]** 

    The name of the application to which the version belongs.

    

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

    The label of the version to delete.

    

  
  :type DeleteSourceBundle: boolean
  :param DeleteSourceBundle: 

    Set to ``true`` to delete the source bundle from your storage bucket. Otherwise, the application version is deleted only from Elastic Beanstalk and the source bundle remains in Amazon S3.

    

  
  
  :returns: None
  **Exceptions**
  
  *   :py:class:`ElasticBeanstalk.Client.exceptions.SourceBundleDeletionException`

  
  *   :py:class:`ElasticBeanstalk.Client.exceptions.InsufficientPrivilegesException`

  
  *   :py:class:`ElasticBeanstalk.Client.exceptions.OperationInProgressException`

  
  *   :py:class:`ElasticBeanstalk.Client.exceptions.S3LocationNotInServiceRegionException`

  

  **Examples**

  The following operation deletes an application version named 22a0-stage-150819_182129 for an application named my-app:
  ::

    response = client.delete_application_version(
        ApplicationName='my-app',
        DeleteSourceBundle=True,
        VersionLabel='22a0-stage-150819_182129',
    )
    
    print(response)

  
  Expected Output:
  ::

    {
        'ResponseMetadata': {
            '...': '...',
        },
    }

  