当前位置: 首页>>代码示例>>Java>>正文


Java CreateApplicationVersionRequest类代码示例

本文整理汇总了Java中com.amazonaws.services.elasticbeanstalk.model.CreateApplicationVersionRequest的典型用法代码示例。如果您正苦于以下问题:Java CreateApplicationVersionRequest类的具体用法?Java CreateApplicationVersionRequest怎么用?Java CreateApplicationVersionRequest使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


CreateApplicationVersionRequest类属于com.amazonaws.services.elasticbeanstalk.model包,在下文中一共展示了CreateApplicationVersionRequest类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: prepareWar

import com.amazonaws.services.elasticbeanstalk.model.CreateApplicationVersionRequest; //导入依赖的package包/类
public void prepareWar(File warFile, String versionLabel, String applicationName) {
    AmazonS3 s3 = new AmazonS3Client(awsCredentials);
    String bucketName = beanstalkClient.createStorageLocation().getS3Bucket();
    String key;
    try {
        key = URLEncoder.encode(warFile.getName() + "-" + versionLabel, "UTF-8");
        s3.putObject(bucketName, key, warFile);
        beanstalkClient.createApplicationVersion(new CreateApplicationVersionRequest()
                .withApplicationName(applicationName).withAutoCreateApplication(true)
                .withVersionLabel(versionLabel)
                .withSourceBundle(new S3Location(bucketName, key)));
    } catch (UnsupportedEncodingException e) {
        // TODO Auto-generated catch block
        journal.log(Level.SEVERE, e.getMessage());
    }
}
 
开发者ID:SINTEF-9012,项目名称:cloudml,代码行数:17,代码来源:BeanstalkConnector.java

示例2: perform

import com.amazonaws.services.elasticbeanstalk.model.CreateApplicationVersionRequest; //导入依赖的package包/类
@Override
public boolean perform() throws Exception {
    log("Creating application version %s for application %s for path %s",
            getVersionLabel(), getApplicationName(), getS3ObjectPath());

    CreateApplicationVersionRequest cavRequest = new CreateApplicationVersionRequest()
            .withApplicationName(getApplicationName())
            .withAutoCreateApplication(true)
            .withSourceBundle(new S3Location(getBucketName(), getObjectKey()))
            .withVersionLabel(getVersionLabel())
            .withDescription(getVersionDescription());

    final CreateApplicationVersionResult result = getAwseb().createApplicationVersion(cavRequest);

    log("Created version: %s", result.getApplicationVersion().getVersionLabel());

    return false;
}
 
开发者ID:ingenieux,项目名称:awseb-deployment-plugin,代码行数:19,代码来源:DeployerCommand.java

示例3: createApplicationVersion

import com.amazonaws.services.elasticbeanstalk.model.CreateApplicationVersionRequest; //导入依赖的package包/类
private void createApplicationVersion(String applicationName, AWSElasticBeanstalk eb, String bucketName,
        String objectName, String versionLabel) {
    log.info("creating version label=" + versionLabel);
    CreateApplicationVersionRequest request = new CreateApplicationVersionRequest()
            .withApplicationName(applicationName).withAutoCreateApplication(true)
            .withSourceBundle(new S3Location(bucketName, objectName)).withVersionLabel(versionLabel);
    eb.createApplicationVersion(request);
}
 
开发者ID:davidmoten,项目名称:aws-maven-plugin,代码行数:9,代码来源:BeanstalkDeployer.java

示例4: createApplicationVersion

import com.amazonaws.services.elasticbeanstalk.model.CreateApplicationVersionRequest; //导入依赖的package包/类
public void createApplicationVersion(AWSElasticBeanstalk awseb) {
    AWSEBUtils.log(listener, "Creating application version %s for application %s for path %s", versionLabel, applicationName, s3ObjectPath);

    CreateApplicationVersionRequest cavRequest = new CreateApplicationVersionRequest().withApplicationName(applicationName).withAutoCreateApplication(true)
            .withSourceBundle(new S3Location(bucketName, objectKey)).withVersionLabel(versionLabel);

    awseb.createApplicationVersion(cavRequest);
}
 
开发者ID:DavidTanner,项目名称:aws-beanstalk-publisher,代码行数:9,代码来源:AWSEBS3Uploader.java

示例5: overridesVersionInEbt

import com.amazonaws.services.elasticbeanstalk.model.CreateApplicationVersionRequest; //导入依赖的package包/类
/**
 * 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)
    );
}
 
开发者ID:jcabi,项目名称:jcabi-beanstalk-maven-plugin,代码行数:32,代码来源:OverridingVersionTest.java

示例6: label

import com.amazonaws.services.elasticbeanstalk.model.CreateApplicationVersionRequest; //导入依赖的package包/类
/**
 * {@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();
}
 
开发者ID:jcabi,项目名称:jcabi-beanstalk-maven-plugin,代码行数:44,代码来源:OverridingVersion.java


注:本文中的com.amazonaws.services.elasticbeanstalk.model.CreateApplicationVersionRequest类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。