Example usage for com.amazonaws.services.ec2.model CreateVolumeRequest getAvailabilityZone

List of usage examples for com.amazonaws.services.ec2.model CreateVolumeRequest getAvailabilityZone

Introduction

In this page you can find the example usage for com.amazonaws.services.ec2.model CreateVolumeRequest getAvailabilityZone.

Prototype


public String getAvailabilityZone() 

Source Link

Document

The Availability Zone in which to create the volume.

Usage

From source file:jp.primecloud.auto.aws.typica.EucaEc2Client.java

License:Open Source License

@Override
public CreateVolumeResult createVolume(CreateVolumeRequest createVolumeRequest) {
    String size = createVolumeRequest.getSize() != null ? createVolumeRequest.getSize().toString() : null;

    try {//from ww w . jav  a2  s  . c  o m
        VolumeInfo info = jec2.createVolume(size, createVolumeRequest.getSnapshotId(),
                createVolumeRequest.getAvailabilityZone());
        Volume volume = new VolumeConverter().convert(info);
        return new CreateVolumeResult().withVolume(volume);
    } catch (EC2Exception e) {
        throw new AmazonClientException(e);
    }
}