System.out.printf("dns name: %s%n", instance.getDnsName()); System.out.printf("login identity:%n%s%n", pair.getKeyMaterial());
private RunningInstance blockUntilWeCanSshIntoInstance(RunningInstance instance) throws UnknownHostException { System.out.printf("%d: %s awaiting instance to run %n", System.currentTimeMillis(), instance.getId()); assert runningTester.apply(instance); instance = getInstance(instance.getId()); System.out .printf("%d: %s awaiting instance to have ip assigned %n", System.currentTimeMillis(), instance.getId()); assert hasIpTester.apply(instance); System.out.printf("%d: %s awaiting ssh service to start%n", System.currentTimeMillis(), instance.getIpAddress()); assert socketTester.apply(HostAndPort.fromParts(instance.getIpAddress(), 22)); System.out.printf("%d: %s ssh service started%n", System.currentTimeMillis(), instance.getDnsName()); sshPing(instance); System.out.printf("%d: %s ssh connection made%n", System.currentTimeMillis(), instance.getId()); System.out.printf("%d: %s awaiting http service to start%n", System.currentTimeMillis(), instance.getIpAddress()); assert socketTester.apply(HostAndPort.fromParts(instance.getIpAddress(), 80)); System.out.printf("%d: %s http service started%n", System.currentTimeMillis(), instance.getDnsName()); return instance; }
private RunningInstance blockUntilWeCanSshIntoInstance(RunningInstance instance) throws UnknownHostException { System.out.printf("%d: %s awaiting instance to run %n", System.currentTimeMillis(), instance.getId()); assert runningTester.apply(instance); instance = getInstance(instance.getId()); System.out .printf("%d: %s awaiting instance to have ip assigned %n", System.currentTimeMillis(), instance.getId()); assert hasIpTester.apply(instance); System.out.printf("%d: %s awaiting ssh service to start%n", System.currentTimeMillis(), instance.getIpAddress()); assert socketTester.apply(HostAndPort.fromParts(instance.getIpAddress(), 22)); System.out.printf("%d: %s ssh service started%n", System.currentTimeMillis(), instance.getDnsName()); sshPing(instance); System.out.printf("%d: %s ssh connection made%n", System.currentTimeMillis(), instance.getId()); System.out.printf("%d: %s awaiting http service to start%n", System.currentTimeMillis(), instance.getIpAddress()); assert socketTester.apply(HostAndPort.fromParts(instance.getIpAddress(), 80)); System.out.printf("%d: %s http service started%n", System.currentTimeMillis(), instance.getDnsName()); return instance; }
private RunningInstance blockUntilWeCanSshIntoInstance(RunningInstance instance) throws UnknownHostException { System.out.printf("%d: %s awaiting instance to run %n", System.currentTimeMillis(), instance.getId()); assert runningTester.apply(instance); // search my identity for the instance I just created Set<? extends Reservation<? extends RunningInstance>> reservations = client.getInstanceServices() .describeInstancesInRegion(instance.getRegion(), instance.getId()); // last // parameter // (ids) // narrows // the // search instance = Iterables.getOnlyElement(Iterables.getOnlyElement(reservations)); System.out.printf("%d: %s awaiting ssh service to start%n", System.currentTimeMillis(), instance.getIpAddress()); assert socketTester.apply(HostAndPort.fromParts(instance.getIpAddress(), 22)); System.out.printf("%d: %s ssh service started%n", System.currentTimeMillis(), instance.getDnsName()); sshPing(instance); System.out.printf("%d: %s ssh connection made%n", System.currentTimeMillis(), instance.getId()); return instance; }
private RunningInstance blockUntilWeCanSshIntoInstance(RunningInstance instance) throws UnknownHostException { System.out.printf("%d: %s awaiting instance to run %n", System.currentTimeMillis(), instance.getId()); assert runningTester.apply(instance); // search my identity for the instance I just created Reservation<? extends RunningInstance> reservation = Iterables.getOnlyElement(client.getInstanceApi().get() .describeInstancesInRegion(instance.getRegion(), instance.getId())); // last // parameter // (ids) // narrows // the // search instance = Iterables.getOnlyElement(reservation); System.out.printf("%d: %s awaiting ssh service to start%n", System.currentTimeMillis(), instance.getIpAddress()); assert socketTester.apply(HostAndPort.fromParts(instance.getIpAddress(), 22)); System.out.printf("%d: %s ssh service started%n", System.currentTimeMillis(), instance.getDnsName()); sshPing(instance); System.out.printf("%d: %s ssh connection made%n", System.currentTimeMillis(), instance.getId()); return instance; }