@Override public Set<? extends Reservation<? extends RunningInstance>> apply(String from) { return client.getInstanceApi().get() .describeInstancesInRegion(from, toArray(idsByRegions.get(from), String.class)); }
@Override public Set<? extends Reservation<? extends RunningInstance>> apply(String from) { return client.getInstanceApi().get() .describeInstancesInRegion(from, toArray(idsByRegions.get(from), String.class)); }
@Override public Set<? extends Reservation<? extends RunningInstance>> apply(String from) { return client.getInstanceApi().get() .describeInstancesInRegion(from, toArray(idsByRegions.get(from), String.class)); }
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()))); } }
private RunningInstance refresh(RunningInstance instance) { return Iterables.getOnlyElement(Iterables.getOnlyElement(client.getInstanceApi().get() .describeInstancesInRegion(instance.getRegion(), instance.getId()))); } }
private RunningInstance refresh(RunningInstance instance) { return Iterables.getOnlyElement(Iterables.getOnlyElement(client.getInstanceApi().get() .describeInstancesInRegion(instance.getRegion(), instance.getId()))); } }
private RunningInstance refresh(RunningInstance instance) { return Iterables.getOnlyElement(Iterables.getOnlyElement(client .getInstanceApi().get().describeInstancesInRegion( instance.getRegion(), instance.getId()))); } }
private RunningInstance refresh(RunningInstance instance) { return Iterables.getOnlyElement(Iterables.getOnlyElement(client.getInstanceApi().get() .describeInstancesInRegion(instance.getRegion(), instance.getId()))); } }
private RunningInstance refresh(RunningInstance instance) { Reservation<? extends RunningInstance> reservation = Iterables.getOnlyElement(client.getInstanceApi().get() .describeInstancesInRegion(instance.getRegion(), instance.getId())); return Iterables.getOnlyElement(reservation); } }
private RunningInstance refresh(RunningInstance instance) { Reservation<? extends RunningInstance> reservation = Iterables.getOnlyElement(client.getInstanceApi().get() .describeInstancesInRegion(instance.getRegion(), instance.getId())); return Iterables.getOnlyElement(reservation); } }
private RunningInstance refresh(RunningInstance instance) { Reservation<? extends RunningInstance> reservation = Iterables.getOnlyElement(client .getInstanceApi().get().describeInstancesInRegion( instance.getRegion(), instance.getId())); return Iterables.getOnlyElement(reservation); } }
private RunningInstance refresh(RunningInstance instance) { return Iterables.getOnlyElement(Iterables.getOnlyElement(client.getInstanceApi().get() .describeInstancesInRegion(instance.getRegion(), instance.getId()))); } }
private RunningInstance refresh(RunningInstance instance) { return Iterables.getOnlyElement(Iterables.getOnlyElement(client .getInstanceApi().get().describeInstancesInRegion( instance.getRegion(), instance.getId()))); } }
/** * Gets the instance with the given ID from the default region * * @throws NoSuchElementException If no instance with that id exists, or the instance is in a different region */ public static RunningInstance getInstance(InstanceApi instanceClient, String id) { Reservation<? extends RunningInstance> reservation = Iterables.getOnlyElement(instanceClient .describeInstancesInRegion(null, id)); RunningInstance instance = Iterables.getOnlyElement(reservation); return instance; }
@Override public ImageTemplate buildImageTemplateFromNode(String name, String id) { String[] parts = AWSUtils.parseHandle(id); String region = parts[0]; String instanceId = parts[1]; Reservation<? extends RunningInstance> instance = getOnlyElement(ec2Api.getInstanceApi().get() .describeInstancesInRegion(region, instanceId)); if (instance == null) throw new NoSuchElementException("Cannot find server with id: " + id); CloneImageTemplate template = new ImageTemplateBuilder.CloneImageTemplateBuilder().nodeId(id).name(name).build(); return template; }
@Override public ImageTemplate buildImageTemplateFromNode(String name, String id) { String[] parts = AWSUtils.parseHandle(id); String region = parts[0]; String instanceId = parts[1]; Reservation<? extends RunningInstance> instance = getOnlyElement(ec2Api.getInstanceApi().get() .describeInstancesInRegion(region, instanceId)); if (instance == null) throw new NoSuchElementException("Cannot find server with id: " + id); CloneImageTemplate template = new ImageTemplateBuilder.CloneImageTemplateBuilder().nodeId(id).name(name).build(); return template; }
@Override public ImageTemplate buildImageTemplateFromNode(String name, String id) { String[] parts = AWSUtils.parseHandle(id); String region = parts[0]; String instanceId = parts[1]; Reservation<? extends RunningInstance> instance = getOnlyElement(ec2Api.getInstanceApi().get() .describeInstancesInRegion(region, instanceId)); if (instance == null) throw new NoSuchElementException("Cannot find server with id: " + id); CloneImageTemplate template = new ImageTemplateBuilder.CloneImageTemplateBuilder().nodeId(id).name(name).build(); return template; }
private RunningInstance getInstance(String instanceId) { // search my identity for the instance I just created Reservation<? extends RunningInstance> reservation = Iterables.getOnlyElement(client.getInstanceApi().get() .describeInstancesInRegion(null, instanceId)); // last parameter // (ids) narrows the // search return Iterables.getOnlyElement(reservation); }
@Test void testDescribeInstances() { for (String region : ec2Api.getConfiguredRegions()) { Set<? extends Reservation<? extends RunningInstance>> allResults = client.describeInstancesInRegion(region); assertNotNull(allResults); } }