private RunningInstance refresh(RunningInstance instance) { return Iterables.getOnlyElement(Iterables.getOnlyElement(client.describeInstancesInRegion( instance.getRegion(), instance.getId()))); } }
private RunningInstance refresh(RunningInstance instance) { return Iterables.getOnlyElement(Iterables.getOnlyElement(client.describeInstancesInRegion( instance.getRegion(), instance.getId()))); } }
@VisibleForTesting String getLoginAccountFor(RunningInstance from) throws ExecutionException { return imageMap.get().get(new RegionAndName(from.getRegion(), from.getImageId())).getDefaultCredentials().identity; } }
private RunningInstance refresh(RunningInstance instance) { return Iterables.getOnlyElement(Iterables.getOnlyElement(client.getInstanceApi().get() .describeInstancesInRegion(instance.getRegion(), instance.getId()))); } }
@Override public RegionAndName apply(RunningInstance from) { return new RegionAndName(from.getRegion(), from.getId()); } };
private RunningInstance refresh(RunningInstance instance) { return Iterables.getOnlyElement(Iterables.getOnlyElement(client .getInstanceServices().describeInstancesInRegion( instance.getRegion(), instance.getId()))); } }
private RunningInstance refresh(RunningInstance instance) { return Iterables.getOnlyElement(Iterables.getOnlyElement(client.getInstanceServices() .describeInstancesInRegion(instance.getRegion(), instance.getId()))); } }
@VisibleForTesting String getPrivateKeyOrNull(RunningInstance instance) { KeyPair keyPair = credentialsMap.get(new RegionAndName(instance.getRegion(), instance.getKeyName())); return keyPair != null ? keyPair.getKeyMaterial() : null; }
private RunningInstance refresh(RunningInstance instance) { return Iterables.getOnlyElement(Iterables.getOnlyElement(client.getInstanceServices() .describeInstancesInRegion(instance.getRegion(), instance.getId()))); } }
@VisibleForTesting String getPrivateKeyOrNull(RunningInstance instance) { KeyPair keyPair = credentialsMap.get(new RegionAndName(instance.getRegion(), instance.getKeyName())); return keyPair != null ? keyPair.getKeyMaterial() : null; }
@Override public RegionAndName apply(RunningInstance from) { return new RegionAndName(from.getRegion(), from.getId()); } };
private RunningInstance refresh(RunningInstance instance) { return Iterables.getOnlyElement(Iterables.getOnlyElement(client .getInstanceServices().describeInstancesInRegion( instance.getRegion(), instance.getId()))); } }
@VisibleForTesting String getPrivateKeyOrNull(RunningInstance instance) { KeyPair keyPair = credentialsMap.get(new RegionAndName(instance.getRegion(), instance.getKeyName())); return keyPair != null ? keyPair.getKeyMaterial() : null; }
@Override public RegionAndName apply(RunningInstance from) { return new RegionAndName(from.getRegion(), from.getId()); } };
private RunningInstance refresh(RunningInstance instance) { return Iterables.getOnlyElement(Iterables.getOnlyElement(client.getInstanceServices() .describeInstancesInRegion(instance.getRegion(), instance.getId()))); } }
@VisibleForTesting String getPrivateKeyOrNull(RunningInstance instance) { KeyPair keyPair = credentialsMap.get(new RegionAndName(instance.getRegion(), instance.getKeyName())); return keyPair != null ? keyPair.getKeyMaterial() : null; }
private Location getLocationForAvailabilityZoneOrRegion(final RunningInstance instance) { Location location = findLocationWithId(instance.getAvailabilityZone()); if (location == null) location = findLocationWithId(instance.getRegion()); return location; }
private Location getLocationForAvailabilityZoneOrRegion(final RunningInstance instance) { Location location = findLocationWithId(instance.getAvailabilityZone()); if (location == null) location = findLocationWithId(instance.getRegion()); return location; }
@Test(enabled = false, dependsOnMethods = "testCreateRunningInstance") void testCreateAndAttachVolume() { volume = client.getElasticBlockStoreServices().createVolumeInAvailabilityZone(instance.getAvailabilityZone(), VOLUME_SIZE); System.out.printf("%d: %s awaiting volume to become available%n", System.currentTimeMillis(), volume.getId()); assert volumeTester.apply(volume); Attachment attachment = client.getElasticBlockStoreServices().attachVolumeInRegion(instance.getRegion(), volume.getId(), instance.getId(), "/dev/sdh"); System.out.printf("%d: %s awaiting attachment to complete%n", System.currentTimeMillis(), attachment.getId()); assert attachTester.apply(attachment); System.out.printf("%d: %s attachment complete%n", System.currentTimeMillis(), attachment.getId()); }
@Test(enabled = false, dependsOnMethods = { "testAMIFromBundle" }) public void testInstanceFromEBS() throws Exception { System.out.printf("%d: %s creating instance from ebs-backed ami%n", System.currentTimeMillis(), ebsImage.getId()); ebsInstance = createInstance(ebsImage.getId()); client.getInstanceServices().stopInstancesInRegion(ebsInstance.getRegion(), true, ebsInstance.getId()); System.out.printf("%d: %s awaiting instance to stop %n", System.currentTimeMillis(), ebsInstance.getId()); stoppedTester.apply(ebsInstance); tryToChangeStuff(); System.out.printf("%d: %s awaiting instance to start %n", System.currentTimeMillis(), ebsInstance.getId()); client.getInstanceServices().startInstancesInRegion(ebsInstance.getRegion(), ebsInstance.getId()); ebsInstance = blockUntilWeCanSshIntoInstance(ebsInstance); }