Package org.jclouds.compute

Examples of org.jclouds.compute.ComputeServiceContext.unwrap()


         assertFalse(InetAddresses2.isPrivateIPAddress(ip));
         HostAndPort socket = HostAndPort.fromParts(ip, 22);
         assertTrue(socketTester.apply(socket), String.format("failed to open socket %s on node %s", socket, node));

         // check that there is an elastic ip correlating to it
         EC2Client ec2 = EC2Client.class.cast(context.unwrap(EC2ApiMetadata.CONTEXT_TOKEN).getApi());
         Set<PublicIpInstanceIdPair> ipidpairs =
               ec2.getElasticIPAddressServices().describeAddressesInRegion(region, publicIps.toArray(new String[0]));
         assertEquals(ipidpairs.size(), 1, String.format("there should only be one address pair (%s)",
               Iterables.toString(ipidpairs)));
View Full Code Here


      ComputeServiceContext context = ContextBuilder.newBuilder("rackspace-cloudservers-us")
            .credentials(identity, credential)
            .overrides(overrides)
            .buildView(ComputeServiceContext.class);
      computeService = context.getComputeService();
      nova = context.unwrap();

      Template template = computeService.templateBuilder().smallest().build();
      NodeMetadata nodeMetadata = computeService.createNodesInGroup("jclouds-reverse-dns-test", 1, template).iterator().next();
      serverId = nodeMetadata.getId();
      serverURI = nodeMetadata.getUri();
View Full Code Here

   }

   private void checkAuthAsUser(ApiKeyPair keyPair) {
      ComputeServiceContext context = createView(credentialsAsProperties(keyPair), setupModules());

      CloudStackClient client = context.unwrap(CloudStackApiMetadata.CONTEXT_TOKEN).getApi();
      Set<Account> accounts = client.getAccountClient().listAccounts();

      assert accounts.size() > 0;

      context.close();
View Full Code Here

   @Test
   public void testUnwrapIsCorrectType() {
      ComputeServiceContext context = ContextBuilder.newBuilder("servermanager").build(ComputeServiceContext.class);

      assertEquals(context.unwrap().getClass(), ContextImpl.class);

      context.close();
   }
}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.