@Test(expectedExceptions = IllegalArgumentException.class) public void testAddNewEphemeralBlockDeviceTooBig() { addNewEphemeralBlockDevice("deviceName", "virtualName", 1025); }
public RegisterImageBackedByEbsOptions addNewEphemeralBlockDevice(String deviceName, @Nullable String virtualName, int volumeSize) { checkArgument(volumeSize > 0 && volumeSize < 1025, "volumeSize must be between 1 and 1024 gb"); formParameters.put("BlockDeviceMapping." + deviceIndex + ".DeviceName", checkNotNull( deviceName, "deviceName")); if (virtualName != null) formParameters.put("BlockDeviceMapping." + deviceIndex + ".VirtualName", checkNotNull( virtualName, "virtualName")); formParameters.put("BlockDeviceMapping." + deviceIndex + ".Ebs.VolumeSize", volumeSize + ""); deviceIndex++; return this; }
RegisterImageBackedByEbsOptions extends RegisterImageOptions { public RegisterImageBackedByEbsOptions addNewEphemeralBlockDevice(String deviceName, @Nullable String virtualName, int volumeSize) { checkArgument(volumeSize > 0 && volumeSize < 1025, "volumeSize must be between 1 and 1024 gb"); formParameters.put("BlockDeviceMapping." + deviceIndex + ".DeviceName", checkNotNull( deviceName, "deviceName")); if (virtualName != null) formParameters.put("BlockDeviceMapping." + deviceIndex + ".VirtualName", checkNotNull( virtualName, "virtualName")); formParameters.put("BlockDeviceMapping." + deviceIndex + ".Ebs.VolumeSize", volumeSize + ""); deviceIndex++; return this; } }
RegisterImageBackedByEbsOptions extends RegisterImageOptions { public RegisterImageBackedByEbsOptions addNewEphemeralBlockDevice(String deviceName, @Nullable String virtualName, int volumeSize) { checkArgument(volumeSize > 0 && volumeSize < 1025, "volumeSize must be between 1 and 1024 gb"); formParameters.put("BlockDeviceMapping." + deviceIndex + ".DeviceName", checkNotNull( deviceName, "deviceName")); if (virtualName != null) formParameters.put("BlockDeviceMapping." + deviceIndex + ".VirtualName", checkNotNull( virtualName, "virtualName")); formParameters.put("BlockDeviceMapping." + deviceIndex + ".Ebs.VolumeSize", volumeSize + ""); deviceIndex++; return this; }  }
RegisterImageBackedByEbsOptions extends RegisterImageOptions { public RegisterImageBackedByEbsOptions addNewEphemeralBlockDevice(String deviceName, @Nullable String virtualName, int volumeSize) { checkArgument(volumeSize > 0 && volumeSize < 1025, "volumeSize must be between 1 and 1024 gb"); formParameters.put("BlockDeviceMapping." + deviceIndex + ".DeviceName", checkNotNull( deviceName, "deviceName")); if (virtualName != null) formParameters.put("BlockDeviceMapping." + deviceIndex + ".VirtualName", checkNotNull( virtualName, "virtualName")); formParameters.put("BlockDeviceMapping." + deviceIndex + ".Ebs.VolumeSize", volumeSize + ""); deviceIndex++; return this; }  RegisterImageBackedByEbsOptions addEphemeralBlockDeviceFromSnapshot(String deviceName,
            @Nullable String virtualName, String snapshotId); RegisterImageBackedByEbsOptions addNewEphemeralBlockDevice(String deviceName,
            @Nullable String virtualName, int volumeSize); RegisterImageBackedByEbsOptions addBlockDeviceFromSnapshot(String deviceName,
            @Nullable String virtualName, String snapshotId, boolean deleteOnTermination,
            @Nullable String volumeType, @Nullable Integer iops, boolean encrypted); RegisterImageBackedByEbsOptions addNewBlockDevice(String deviceName,
                                                            @Nullable String virtualName,
                                                            int volumeSize,
                                                            boolean deleteOnTermination,
                                                            @Nullable String volumeType,
                                                            @Nullable Integer iops,
                                                            boolean encrypted); RegisterImageBackedByEbsOptions addBlockDeviceFromSnapshot(String deviceName,
                                                                     @Nullable String virtualName, String snapshotId); RegisterImageBackedByEbsOptions addNewBlockDevice(String deviceName,
            @Nullable String virtualName, int volumeSize); @Override RegisterImageBackedByEbsOptions asArchitecture(Architecture architecture); @Override RegisterImageBackedByEbsOptions withDescription(String info); @Override RegisterImageBackedByEbsOptions withKernelId(String kernelId); @Override RegisterImageBackedByEbsOptions withRamdisk(String ramDiskId); }
RegisterImageBackedByEbsOptions extends RegisterImageOptions { public RegisterImageBackedByEbsOptions addNewEphemeralBlockDevice(String deviceName, @Nullable String virtualName, int volumeSize) { checkArgument(volumeSize > 0 && volumeSize < 1025, "volumeSize must be between 1 and 1024 gb"); formParameters.put("BlockDeviceMapping." + deviceIndex + ".DeviceName", checkNotNull( deviceName, "deviceName")); if (virtualName != null) formParameters.put("BlockDeviceMapping." + deviceIndex + ".VirtualName", checkNotNull( virtualName, "virtualName")); formParameters.put("BlockDeviceMapping." + deviceIndex + ".Ebs.VolumeSize", volumeSize + ""); deviceIndex++; return this; }  RegisterImageBackedByEbsOptions addEphemeralBlockDeviceFromSnapshot(String deviceName,
            @Nullable String virtualName, String snapshotId); RegisterImageBackedByEbsOptions addNewEphemeralBlockDevice(String deviceName,
            @Nullable String virtualName, int volumeSize); RegisterImageBackedByEbsOptions addBlockDeviceFromSnapshot(String deviceName,
            @Nullable String virtualName, String snapshotId, boolean deleteOnTermination,
            @Nullable String volumeType, @Nullable Integer iops, boolean encrypted); RegisterImageBackedByEbsOptions addNewBlockDevice(String deviceName,
                                                            @Nullable String virtualName,
                                                            int volumeSize,
                                                            boolean deleteOnTermination,
                                                            @Nullable String volumeType,
                                                            @Nullable Integer iops,
                                                            boolean encrypted); RegisterImageBackedByEbsOptions addBlockDeviceFromSnapshot(String deviceName,
                                                                     @Nullable String virtualName, String snapshotId); RegisterImageBackedByEbsOptions addNewBlockDevice(String deviceName,
            @Nullable String virtualName, int volumeSize); @Override RegisterImageBackedByEbsOptions asArchitecture(Architecture architecture); @Override RegisterImageBackedByEbsOptions withDescription(String info); @Override RegisterImageBackedByEbsOptions withKernelId(String kernelId); @Override RegisterImageBackedByEbsOptions withRamdisk(String ramDiskId);  }