/** * @param bootOrder drive boot order * @param deviceChannel device channel in format {controller:unit} ex. 0:1, 0:2, etc. * @param deviceEmulationType device emulation type * @param drive drive to attach. UUID Required. */ @ConstructorProperties({ "boot_order", "dev_channel", "device", "drive" }) public ServerDrive(Integer bootOrder, String deviceChannel, DeviceEmulationType deviceEmulationType, Drive drive) { this.bootOrder = bootOrder; this.deviceChannel = deviceChannel; this.deviceEmulationType = deviceEmulationType; this.drive = drive; this.driveUuid = drive.getUuid(); }
/** * @param bootOrder drive boot order * @param deviceChannel device channel in format {controller:unit} ex. 0:1, 0:2, etc. * @param deviceEmulationType device emulation type * @param drive drive to attach. UUID Required. */ @ConstructorProperties({ "boot_order", "dev_channel", "device", "drive" }) public ServerDrive(Integer bootOrder, String deviceChannel, DeviceEmulationType deviceEmulationType, Drive drive) { this.bootOrder = bootOrder; this.deviceChannel = deviceChannel; this.deviceEmulationType = deviceEmulationType; this.drive = drive; this.driveUuid = drive.getUuid(); }
/** * @param bootOrder drive boot order * @param deviceChannel device channel in format {controller:unit} ex. 0:1, 0:2, etc. * @param deviceEmulationType device emulation type * @param drive drive to attach. UUID Required. */ @ConstructorProperties({ "boot_order", "dev_channel", "device", "drive" }) public ServerDrive(int bootOrder, String deviceChannel, DeviceEmulationType deviceEmulationType, Drive drive) { this.bootOrder = bootOrder; this.deviceChannel = deviceChannel; this.deviceEmulationType = deviceEmulationType; this.drive = drive; this.driveUuid = drive.getUuid(); }
@Test(dependsOnMethods = {"testCreateDrives"}) public void testGetDriveInfo() throws Exception { for (Drive driveInfo : api.listDrives().concat()) { assertNotNull(api.getDriveInfo(driveInfo.getUuid())); } }
public void testConvertServerDrive() { CloudSigma2Api api = EasyMock.createMock(CloudSigma2Api.class); DriveInfo mockDrive = new DriveInfo.Builder() .uuid(input.getDrive().getUuid()) .size(new BigInteger("1024000000")) .build(); expect(api.getDriveInfo(input.getDrive().getUuid())).andReturn(mockDrive); replay(api); ServerDriveToVolume function = new ServerDriveToVolume(api); assertEquals(function.apply(input), expected); verify(api); } }
driveObject.addProperty("drive", serverDrive.getDriveUuid()); } else if (serverDrive.getDrive() != null) { driveObject.addProperty("drive", serverDrive.getDrive().getUuid());
driveObject.addProperty("drive", serverDrive.getDriveUuid()); } else if (serverDrive.getDrive() != null) { driveObject.addProperty("drive", serverDrive.getDrive().getUuid());
driveObject.addProperty("drive", serverDrive.getDriveUuid()); } else if (serverDrive.getDrive() != null) { driveObject.addProperty("drive", serverDrive.getDrive().getUuid());
@Test public void testListDrives() throws Exception { CloudSigma2Api api = requestsSendResponses( getBuilder() .endpoint(endpoint + "drives/") .build(), responseBuilder() .payload(payloadFromResourceWithContentType("/drives.json", MediaType.APPLICATION_JSON)) .build(), getBuilder() .endpoint(endpoint + "drives/") .addQueryParam("limit", "2") .addQueryParam("offset", "2") .build(), responseBuilder() .payload(payloadFromResourceWithContentType("/drives-last-page.json", MediaType.APPLICATION_JSON)) .build()); List<Drive> drives = api.listDrives().concat().toList(); assertEquals(drives.size(), 3); assertEquals(drives.get(0).getUuid(), "92ca1450-417e-4cc1-983b-1015777e2591"); assertEquals(drives.get(1).getUuid(), "414ad24b-ba41-47c0-9751-ef5060b6c391"); assertEquals(drives.get(2).getUuid(), "7bc04bc5-bd09-4269-b45d-16b58d6f71b4"); }