Java 类com.amazonaws.services.elasticbeanstalk.model.ApplicationVersionDescription 实例源码

项目:jcabi-beanstalk-maven-plugin    文件:OverridingVersionTest.java   
/**
 * OverridingVersion can override a version in AWS EBT.
 * @throws Exception If something is wrong
 */
@Test
public void overridesVersionInEbt() throws Exception {
    final String app = "some-app";
    final String key = "some-bundle-key";
    final Bundle bundle = Mockito.mock(Bundle.class);
    Mockito.doReturn(key).when(bundle).name();
    final AWSElasticBeanstalk ebt = Mockito.mock(AWSElasticBeanstalk.class);
    Mockito.doReturn(new DescribeApplicationVersionsResult())
        .when(ebt).describeApplicationVersions(
            Mockito.any(DescribeApplicationVersionsRequest.class)
        );
    Mockito.doReturn(
        new CreateApplicationVersionResult()
            .withApplicationVersion(
                new ApplicationVersionDescription()
                    .withVersionLabel(key)
        )
    ).when(ebt)
        .createApplicationVersion(
            Mockito.any(CreateApplicationVersionRequest.class)
        );
    final Version version = new OverridingVersion(ebt, app, bundle);
    MatcherAssert.assertThat(
        version.label(),
        Matchers.equalTo(key)
    );
}
项目:jcabi-beanstalk-maven-plugin    文件:OverridingVersion.java   
/**
 * {@inheritDoc}
 */
@Override
public String label() {
    if (this.exists()) {
        Logger.info(
            this,
            "Version '%s' already exists for '%s'",
            this.bundle.name(),
            this.application
        );
    } else {
        final CreateApplicationVersionResult res =
            this.client.createApplicationVersion(
                new CreateApplicationVersionRequest()
                    .withApplicationName(this.application)
                    .withVersionLabel(this.bundle.name())
                    .withSourceBundle(this.bundle.location())
                    .withDescription(this.bundle.etag())
            );
        final ApplicationVersionDescription desc =
            res.getApplicationVersion();
        Logger.info(
            this,
            "Version '%s' created for '%s' (%s): '%s'",
            desc.getVersionLabel(),
            desc.getApplicationName(),
            this.bundle.location(),
            desc.getDescription()
        );
        if (!desc.getVersionLabel().equals(this.bundle.name())) {
            throw new DeploymentException(
                String.format(
                    "version label is '%s' while '%s' expected",
                    desc.getVersionLabel(),
                    this.bundle.name()
                )
            );
        }
    }
    return this.bundle.name();
}
项目:elasticbeanstalk-dashboard    文件:Environment.java   
public List<ApplicationVersionDescription> getVersions() {
    return versions;
}
项目:elasticbeanstalk-dashboard    文件:Environment.java   
public void setVersions(List<ApplicationVersionDescription> versions) {
    this.versions = versions;
}
项目:elasticbeanstalk-dashboard    文件:ElasticBeanstalkService.java   
public List<ApplicationVersionDescription> getVersions(String applicationName){
    DescribeApplicationVersionsRequest request = new DescribeApplicationVersionsRequest().withApplicationName(applicationName);
    DescribeApplicationVersionsResult result = awsElasticBeanstalkAsyncClient.describeApplicationVersions(request);
    return result.getApplicationVersions();
}
项目:awspush-maven-plugin    文件:Util.java   
public static void dump(CreateApplicationVersionResult cavr, Log log) {
    ApplicationVersionDescription avd = cavr.getApplicationVersion();
    log.info("  ApplicationName : " + avd.getApplicationName());
    log.info("  VersionLabel    : " + avd.getVersionLabel());
    log.info("  SourceBundle    : " + avd.getSourceBundle().getS3Bucket() + "/" + avd.getSourceBundle().getS3Key());
}