public T fromVolumeAttachment(VolumeAttachment in) { return this .id(in.getId()) .volumeId(in.getVolumeId()) .serverId(in.getServerId()) .device(in.getDevice()); } }
public VolumeAttachment build() { return new VolumeAttachment(id, volumeId, serverId, device); }
@Override public String toString() { return string().toString(); }
@Test(dependsOnMethods = "testAttachVolume") public void testListAttachments() { FluentIterable<VolumeAttachment> volumeAttachments = volumeAttachmentApi .listAttachmentsOnServer(server.getId()); assertEquals(volumeAttachments.size(), 1); VolumeAttachment volumeAttachment = volumeAttachments.get(0); assertEquals(volumeAttachment.getVolumeId(), volume.getId()); assertEquals(volumeAttachment.getServerId(), server.getId()); }
protected VolumeAttachment testAttachment() { return VolumeAttachment.builder().device("/dev/vdc").serverId("b4785058-cb80-491b-baa3-e4ee6546450e").id("1").volumeId("1").build(); } }
@Test(dependsOnMethods = "testListAttachments") public void testGetAttachment() { VolumeAttachment volumeAttachment = volumeAttachmentApi .getAttachmentForVolumeOnServer(volume.getId(), server.getId()); assertEquals(volumeAttachment.getVolumeId(), volume.getId()); assertEquals(volumeAttachment.getServerId(), server.getId()); }
protected VolumeAttachment testAttachment() { return VolumeAttachment.builder().device("/dev/vdc").serverId("b4785058-cb80-491b-baa3-e4ee6546450e").id("1").volumeId("1").build(); } }
public T fromVolumeAttachment(VolumeAttachment in) { return this .id(in.getId()) .volumeId(in.getVolumeId()) .serverId(in.getServerId()) .device(in.getDevice()); } }
@Test public void testAttachVolume() throws TimeoutException { VolumeAttachment volumeAttachment = volumeAttachmentApi .attachVolumeToServerAsDevice(volume.getId(), server.getId(), deviceId); // Wait for the volume to become Attached (aka In Use) before moving on if (!VolumePredicates.awaitInUse(volumeApi).apply(volume)) { throw new TimeoutException("Timeout on volume: " + volume); } assertEquals(volumeAttachment.getVolumeId(), volume.getId()); assertEquals(volumeAttachment.getServerId(), server.getId()); // we can't assert the device because, depending on the implementation, the passed in device may be ignored // and the implementation just picks a device itself }
public VolumeAttachment build() { return new VolumeAttachment(id, volumeId, serverId, device); }
@Override public String toString() { return string().toString(); }
protected VolumeAttachment testAttachment() { return VolumeAttachment.builder().device("/dev/vdc").serverId("b4785058-cb80-491b-baa3-e4ee6546450e").id("1").volumeId("1").build(); }
public T fromVolumeAttachment(VolumeAttachment in) { return this .id(in.getId()) .volumeId(in.getVolumeId()) .serverId(in.getServerId()) .device(in.getDevice()); } }
public VolumeAttachment build() { return new VolumeAttachment(id, volumeId, serverId, device); }
@Override public String toString() { return string().toString(); }
protected VolumeAttachment testAttachment() { return VolumeAttachment.builder().device("/dev/vdc").serverId("b4785058-cb80-491b-baa3-e4ee6546450e").id("1").volumeId("1").build(); }
public T fromVolumeAttachment(VolumeAttachment in) { return this .id(in.getId()) .volumeId(in.getVolumeId()) .serverId(in.getServerId()) .device(in.getDevice()); } }
public VolumeAttachment build() { return new VolumeAttachment(id, volumeId, serverId, device); }
@Override public String toString() { return string().toString(); }
public T fromVolumeAttachment(VolumeAttachment in) { return this .id(in.getId()) .volumeId(in.getVolumeId()) .serverId(in.getServerId()) .device(in.getDevice()); } }