public T fromPowerState(PowerState in) { return this .keyName(in.getKeyName()); } }
public T fromPowerState(PowerState in) { return this .keyName(in.getKeyName()); } }
public T fromPowerState(PowerState in) { return this .keyName(in.getKeyName()); } }
public T fromPowerState(PowerState in) { return this .keyName(in.getKeyName()); } }
public T fromPowerState(PowerState in) { return this .keyName(in.getKeyName()); } }
public T fromPowerState(PowerState in) { return this .keyName(in.getKeyName()); } }
@Test(dependsOnMethods = "testSetNotesOnVirtualGuest") public void testPauseVirtualGuest() throws Exception { virtualGuestApi.pauseVirtualGuest(virtualGuest.getId()); checkState(retry(new Predicate<VirtualGuest>() { public boolean apply(VirtualGuest guest) { guest = api().getVirtualGuest(virtualGuest.getId()); return guest.getPowerState().getKeyName() == VirtualGuest.State.PAUSED; } }, 5 * 60 * 1000).apply(virtualGuest), "%s still not paused!", virtualGuest); VirtualGuest found = virtualGuestApi.getVirtualGuest(virtualGuest.getId()); assertTrue(found.getPowerState().getKeyName() == VirtualGuest.State.PAUSED); }
@Test(dependsOnMethods = "testPauseVirtualGuest") public void testResumeVirtualGuest() throws Exception { virtualGuestApi.resumeVirtualGuest(virtualGuest.getId()); checkState(retry(new Predicate<VirtualGuest>() { public boolean apply(VirtualGuest guest) { guest = api().getVirtualGuest(virtualGuest.getId()); return guest.getPowerState().getKeyName() == VirtualGuest.State.RUNNING; } }, 5 * 60 * 1000).apply(virtualGuest), "%s still not running!", virtualGuest); VirtualGuest found = virtualGuestApi.getVirtualGuest(virtualGuest.getId()); assertTrue(found.getPowerState().getKeyName() == VirtualGuest.State.RUNNING); }
public boolean apply(VirtualGuest guest) { guest = api().getVirtualGuest(virtualGuest.getId()); return guest.getPowerState().getKeyName() == VirtualGuest.State.RUNNING; } }, 5 * 60 * 1000).apply(virtualGuest), "%s still not running!", virtualGuest);
public boolean apply(VirtualGuest guest) { guest = api().getVirtualGuest(virtualGuest.getId()); return guest.getPowerState().getKeyName() == VirtualGuest.State.PAUSED; } }, 5 * 60 * 1000).apply(virtualGuest), "%s still not paused!", virtualGuest);
@Override public NodeMetadata apply(VirtualGuest from) { // convert the result object to a jclouds NodeMetadata NodeMetadataBuilder builder = new NodeMetadataBuilder(); builder.ids(from.getId() + ""); builder.name(from.getHostname()); builder.hostname(from.getHostname()); if (from.getDatacenter() != null) builder.location(from(locations.get()).firstMatch( LocationPredicates.idEquals(from.getDatacenter().getId() + "")).orNull()); builder.group(nodeNamingConvention.groupInUniqueNameOrNull(from.getHostname())); Image image = images.getImage(from); if (image != null) { builder.imageId(image.getId()); builder.operatingSystem(image.getOperatingSystem()); } builder.hardware(hardware.getHardware(from)); builder.status(serverStateToNodeStatus.get(from.getPowerState().getKeyName())); // These are null for 'bad' guest orders in the HALTED state. if (from.getPrimaryIpAddress() != null) builder.publicAddresses(ImmutableSet.<String> of(from.getPrimaryIpAddress())); if (from.getPrimaryBackendIpAddress() != null) builder.privateAddresses(ImmutableSet.<String> of(from.getPrimaryBackendIpAddress())); return builder.build(); }
@Override public NodeMetadata apply(VirtualGuest from) { // convert the result object to a jclouds NodeMetadata NodeMetadataBuilder builder = new NodeMetadataBuilder(); builder.ids(from.getId() + ""); builder.name(from.getHostname()); builder.hostname(from.getHostname()); if (from.getDatacenter() != null) builder.location(from(locations.get()).firstMatch( LocationPredicates.idEquals(from.getDatacenter().getId() + "")).orNull()); builder.group(nodeNamingConvention.groupInUniqueNameOrNull(from.getHostname())); Image image = images.getImage(from); if (image != null) { builder.imageId(image.getId()); builder.operatingSystem(image.getOperatingSystem()); } builder.hardware(hardware.getHardware(from)); builder.status(serverStateToNodeStatus.get(from.getPowerState().getKeyName())); // These are null for 'bad' guest orders in the HALTED state. if (from.getPrimaryIpAddress() != null) builder.publicAddresses(ImmutableSet.<String> of(from.getPrimaryIpAddress())); if (from.getPrimaryBackendIpAddress() != null) builder.privateAddresses(ImmutableSet.<String> of(from.getPrimaryBackendIpAddress())); return builder.build(); }
@Override public NodeMetadata apply(VirtualGuest from) { NodeMetadataBuilder builder = new NodeMetadataBuilder(); builder.ids(from.getId() + ""); builder.name(from.getHostname()); builder.hostname(from.getHostname()); if (from.getDatacenter() != null) builder.location(from(locations.get()).firstMatch( LocationPredicates.idEquals(from.getDatacenter().getId() + "")).orNull()); builder.group(nodeNamingConvention.groupInUniqueNameOrNull(from.getHostname())); Image image = new VirtualGuestToImage().apply(from); if (image != null) { builder.imageId(image.getId()); builder.operatingSystem(image.getOperatingSystem()); builder.hardware(new VirtualGuestToHardware().apply(from)); } builder.status(serverStateToNodeStatus.get(from.getPowerState().getKeyName())); if (from.getPrimaryIpAddress() != null) builder.publicAddresses(ImmutableSet.<String> of(from.getPrimaryIpAddress())); if (from.getPrimaryBackendIpAddress() != null) builder.privateAddresses(ImmutableSet.<String> of(from.getPrimaryBackendIpAddress())); return builder.build(); }
builder.status(serverStateToNodeStatus.get(from.getPowerState().getKeyName()));
builder.status(serverStateToNodeStatus.get(from.getPowerState().getKeyName()));
builder.status(serverStateToNodeStatus.get(from.getPowerState().getKeyName()));