Example usage for com.amazonaws.services.ec2.model AttachVolumeRequest AttachVolumeRequest

List of usage examples for com.amazonaws.services.ec2.model AttachVolumeRequest AttachVolumeRequest

Introduction

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

Prototype

public AttachVolumeRequest(String volumeId, String instanceId, String device) 

Source Link

Document

Constructs a new AttachVolumeRequest object.

Usage

From source file:org.openinfinity.cloud.service.administrator.EC2Wrapper.java

License:Apache License

public void attachVolume(String volumeId, String instanceId, String deviceName) {
    try {/*from w ww. j a v  a2s . c o m*/
        AttachVolumeRequest request = new AttachVolumeRequest(volumeId, instanceId, deviceName);
        ec2.attachVolume(request);
    } catch (Exception e) {
        String message = e.getMessage();
        LOG.error("Error attaching volume to instance: " + message);
        ExceptionUtil.throwSystemException(message, e);
    }
}