/** * Constructs a new DeleteApplicationVersionRequest object. Callers should use the setter or fluent setter (with...) * methods to initialize any additional object members. * * @param applicationName * The name of the application to which the version belongs. * @param versionLabel * The label of the version to delete. */ public DeleteApplicationVersionRequest(String applicationName, String versionLabel) { setApplicationName(applicationName); setVersionLabel(versionLabel); }
/** * <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> * * @param deleteSourceBundle * 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. * @return Returns a reference to this object so that method calls can be chained together. */ public DeleteApplicationVersionRequest withDeleteSourceBundle(Boolean deleteSourceBundle) { setDeleteSourceBundle(deleteSourceBundle); return this; }
@Override protected Object executeInternal() throws MojoExecutionException, MojoFailureException { DeleteApplicationVersionRequest req = new DeleteApplicationVersionRequest(); req.setApplicationName(applicationName); req.setDeleteSourceBundle(deleteSourceBundle); req.setVersionLabel(versionLabel); getService().deleteApplicationVersion(req); return null; } }
void deleteVersion(ApplicationVersionDescription versionToRemove) { getLog().info("Must delete version: " + versionToRemove.getVersionLabel()); DeleteApplicationVersionRequest req = new DeleteApplicationVersionRequest() .withApplicationName(versionToRemove.getApplicationName()) // .withDeleteSourceBundle(deleteSourceBundle) // .withVersionLabel(versionToRemove.getVersionLabel()); if (!dryRun) { getService().deleteApplicationVersion(req); deletedVersionsCount++; } }
/** * <p> * The name of the application to which the version belongs. * </p> * * @param applicationName * The name of the application to which the version belongs. * @return Returns a reference to this object so that method calls can be chained together. */ public DeleteApplicationVersionRequest withApplicationName(String applicationName) { setApplicationName(applicationName); return this; }
/** * <p> * The label of the version to delete. * </p> * * @param versionLabel * The label of the version to delete. * @return Returns a reference to this object so that method calls can be chained together. */ public DeleteApplicationVersionRequest withVersionLabel(String versionLabel) { setVersionLabel(versionLabel); return this; }
public void deleteApplicationVersion(ApplicationVersionDescription version) { log.info("Deleting application version {}", version.getVersionLabel()); DeleteApplicationVersionRequest deleteRequest = new DeleteApplicationVersionRequest(); deleteRequest.setApplicationName(version.getApplicationName()); deleteRequest.setVersionLabel(version.getVersionLabel()); deleteRequest.setDeleteSourceBundle(true); elasticBeanstalk.deleteApplicationVersion(deleteRequest); }
@TaskAction public void deleteVersion() { // to enable conventionMappings feature String applicationName = getApplicationName(); String versionLabel = getVersionLabel(); boolean deleteSourceBundle = isDeleteSourceBundle(); AwsBeanstalkPluginExtension ext = getProject().getExtensions().getByType(AwsBeanstalkPluginExtension.class); AWSElasticBeanstalk eb = ext.getClient(); eb.deleteApplicationVersion(new DeleteApplicationVersionRequest() .withApplicationName(applicationName) .withVersionLabel(versionLabel) .withDeleteSourceBundle(deleteSourceBundle)); getLogger().info("version " + versionLabel + " deleted"); } }
/** * <p> * The name of the application to which the version belongs. * </p> * * @param applicationName * The name of the application to which the version belongs. * @return Returns a reference to this object so that method calls can be chained together. */ public DeleteApplicationVersionRequest withApplicationName(String applicationName) { setApplicationName(applicationName); return this; }
/** * <p> * The label of the version to delete. * </p> * * @param versionLabel * The label of the version to delete. * @return Returns a reference to this object so that method calls can be chained together. */ public DeleteApplicationVersionRequest withVersionLabel(String versionLabel) { setVersionLabel(versionLabel); return this; }
public void deleteApplicationVersion(ApplicationVersionDescription version) { log.info("Deleting application version {}", version.getVersionLabel()); DeleteApplicationVersionRequest deleteRequest = new DeleteApplicationVersionRequest(); deleteRequest.setApplicationName(version.getApplicationName()); deleteRequest.setVersionLabel(version.getVersionLabel()); deleteRequest.setDeleteSourceBundle(true); elasticBeanstalk.deleteApplicationVersion(deleteRequest); }
@TaskAction public void deleteVersion() { // to enable conventionMappings feature String appName = getAppName(); boolean deleteSourceBundle = isDeleteSourceBundle(); AwsBeanstalkPluginExtension ext = getProject().getExtensions().getByType(AwsBeanstalkPluginExtension.class); AWSElasticBeanstalk eb = ext.getClient(); DescribeEnvironmentsResult der = eb.describeEnvironments(new DescribeEnvironmentsRequest() .withApplicationName(appName)); List<String> usingVersions = der.getEnvironments().stream().map(ed -> ed.getVersionLabel()).collect(Collectors.toList()); DescribeApplicationVersionsResult davr = eb.describeApplicationVersions(new DescribeApplicationVersionsRequest() .withApplicationName(appName)); List<String> versionLabelsToDelete = davr.getApplicationVersions().stream() .filter(avd -> usingVersions.contains(avd.getVersionLabel()) == false && avd.getVersionLabel().contains("-SNAPSHOT-")) .map(avd -> avd.getVersionLabel()).collect(Collectors.toList()); versionLabelsToDelete.forEach(versionLabel -> { getLogger().info("version " + versionLabel + " deleted"); eb.deleteApplicationVersion(new DeleteApplicationVersionRequest() .withApplicationName(appName) .withVersionLabel(versionLabel) .withDeleteSourceBundle(deleteSourceBundle)); }); } }
/** * Constructs a new DeleteApplicationVersionRequest object. Callers should use the setter or fluent setter (with...) * methods to initialize any additional object members. * * @param applicationName * The name of the application to which the version belongs. * @param versionLabel * The label of the version to delete. */ public DeleteApplicationVersionRequest(String applicationName, String versionLabel) { setApplicationName(applicationName); setVersionLabel(versionLabel); }
/** * <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> * * @param deleteSourceBundle * 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. * @return Returns a reference to this object so that method calls can be chained together. */ public DeleteApplicationVersionRequest withDeleteSourceBundle(Boolean deleteSourceBundle) { setDeleteSourceBundle(deleteSourceBundle); return this; }