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

项目:cloudml    文件:BeanstalkConnector.java   
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());
    }
}
项目:awseb-deployment-plugin    文件:DeployerCommand.java   
@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;
}
项目:aws-maven-plugin    文件:BeanstalkDeployer.java   
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);
}
项目:aws-beanstalk-publisher    文件:AWSEBS3Uploader.java   
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);
}
项目:jcabi-beanstalk-maven-plugin    文件:OverridingBundle.java   
@Cacheable
@Override
public S3Location location() {
    if (this.exists()) {
        Logger.info(
            this,
            "No need to upload %s (%s) to S3, will use existing object",
            this.war,
            FileUtils.byteCountToDisplaySize(this.war.length())
        );
    } else {
        Logger.info(
            this,
            "Uploading %s (%s) to s3://%s/%s... (may take a few minutes)",
            this.war,
            FileUtils.byteCountToDisplaySize(this.war.length()),
            this.bucket, this.key
        );
        final PutObjectResult res = this.client.putObject(
            this.bucket, this.key, this.war
        );
        Logger.info(
            this,
            // @checkstyle LineLength (1 line)
            "Uploaded successfully to S3, etag=%s, expires=%s, exp.rule=%s, encryption=%s, version=%s",
            res.getETag(), res.getExpirationTime(),
            res.getExpirationTimeRuleId(), res.getServerSideEncryption(),
            res.getVersionId()
        );
    }
    return new S3Location(this.bucket, this.key);
}
项目:jcabi-beanstalk-maven-plugin    文件:Bundle.java   
/**
 * {@inheritDoc}
 */
@Override
public S3Location location() {
    return this.origin.location();
}
项目:jcabi-beanstalk-maven-plugin    文件:Bundle.java   
/**
 * Get S3 location of an app.
 * @return The location
 */
S3Location location();