Deletes the specified version from the specified application.
You cannot delete an application version that is associated with a running environment.
Parameters:
-
application_name
(ApplicationName)
–
The name of the application to which the version belongs.
-
version_label
(VersionLabel)
–
The label of the version to delete.
-
delete_source_bundle
(Optional[DeleteSourceBundle], default:
None
)
–
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.
Raises:
-
InsufficientPrivilegesException
–
The specified account does not have sufficient privileges for one or more Amazon Web Services services.
-
OperationInProgressException
–
Unable to perform the specified operation because another operation that effects an element in this activity is already in progress.
-
S3LocationNotInServiceRegionException
–
The specified S3 bucket does not belong to the S3 region in which the service is running. The following regions are supported:
-
IAD/us-east-1
-
PDX/us-west-2
-
DUB/eu-west-1
-
SourceBundleDeletionException
–
Unable to delete the Amazon S3 source bundle associated with the application version. The application version was deleted successfully.
-
UnknownServiceError
–
The service returned an error code this client does not model.
Examples:
To delete an application version
The following operation deletes an application version named 22a0-stage-150819_182129 for an application named my-app:
>>> client.delete_application_version(application_name='my-app', version_label='22a0-stage-150819_182129', delete_source_bundle=True)
Source code in docs_src/capo_elastic_beanstalk/_services/elastic_beanstalk.py
| def delete_application_version(
self,
application_name: "capo_elastic_beanstalk.types.application_name.ApplicationName",
version_label: "capo_elastic_beanstalk.types.version_label.VersionLabel",
*,
config_overrides: Optional[ElasticBeanstalkClientConfig] = None,
delete_source_bundle: Optional[
"capo_elastic_beanstalk.types.delete_source_bundle.DeleteSourceBundle"
] = None,
) -> None:
"""<p>Deletes the specified version from the specified application.</p> <note> <p>You cannot delete an application version that is associated with a running environment.</p> </note>
Args:
application_name: <p>The name of the application to which the version belongs.</p>
version_label: <p>The label of the version to delete.</p>
delete_source_bundle: <p>Set to <code>true</code> 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.</p>
Raises:
capo_elastic_beanstalk.errors.insufficient_privileges_exception.InsufficientPrivilegesException: <p>The specified account does not have sufficient privileges for one or more Amazon Web Services services.</p>
capo_elastic_beanstalk.errors.operation_in_progress_exception.OperationInProgressException: <p>Unable to perform the specified operation because another operation that effects an element in this activity is already in progress.</p>
capo_elastic_beanstalk.errors.s3_location_not_in_service_region_exception.S3LocationNotInServiceRegionException: <p>The specified S3 bucket does not belong to the S3 region in which the service is running. The following regions are supported:</p> <ul> <li> <p>IAD/us-east-1</p> </li> <li> <p>PDX/us-west-2</p> </li> <li> <p>DUB/eu-west-1</p> </li> </ul>
capo_elastic_beanstalk.errors.source_bundle_deletion_exception.SourceBundleDeletionException: <p>Unable to delete the Amazon S3 source bundle associated with the application version. The application version was deleted successfully.</p>
capo_elastic_beanstalk.errors.UnknownServiceError: The service returned an error code this client does not model.
Examples:
To delete an application version
The following operation deletes an application version named 22a0-stage-150819_182129 for an application named my-app:
>>> client.delete_application_version(application_name='my-app', version_label='22a0-stage-150819_182129', delete_source_bundle=True)
"""
def _handler(
req: "OperationRequest[capo_elastic_beanstalk.types.delete_application_version_message.DeleteApplicationVersionMessage]",
) -> OperationResponse[None]:
import capo_elastic_beanstalk._operations.aws_elastic_beanstalk_service.delete_application_version
output, http_response = (
capo_elastic_beanstalk._operations.aws_elastic_beanstalk_service.delete_application_version.delete_application_version(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("DeleteApplicationVersion")
)
input_: capo_elastic_beanstalk.types.delete_application_version_message.DeleteApplicationVersionMessage = {
"application_name": application_name,
"version_label": version_label,
}
if delete_source_bundle is not None:
input_["delete_source_bundle"] = delete_source_bundle
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|