Search in sources :

Example 1 with DeviceType

use of com.amazonaws.services.ec2.model.DeviceType in project photon-model by vmware.

the class AWSVolumeTypeDiscoveryService method handleGet.

@Override
public void handleGet(Operation get) {
    Map<String, String> params = UriUtils.parseUriQueryParams(get.getUri());
    String deviceType = params.get(DEVICE_TYPE);
    if (deviceType == null || deviceType.isEmpty()) {
        get.fail(new IllegalArgumentException("No deviceType provided."));
        return;
    }
    if (!deviceType.equals(AWSConstants.AWSStorageType.EBS.name().toLowerCase())) {
        get.fail(new IllegalArgumentException("Unsupported device Type"));
        return;
    }
    VolumeTypeList volumeTypeList = new VolumeTypeList();
    for (VolumeType volumeType : VolumeType.values()) {
        volumeTypeList.volumeTypes.add(volumeType.toString());
    }
    get.setBody(volumeTypeList);
    get.complete();
}
Also used : VolumeType(com.amazonaws.services.ec2.model.VolumeType)

Aggregations

VolumeType (com.amazonaws.services.ec2.model.VolumeType)1