Examples of unwrapApi()


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

            log.error(msg);
            throw new InvalidRegionException(msg);
        }
       
        ComputeServiceContext context = iaasInfo.getComputeService().getContext();
        Set<String> regions = context.unwrapApi(AWSEC2Api.class).getConfiguredRegions();
        for (String configuredRegion : regions) {
            if (region.equalsIgnoreCase(configuredRegion)) {
                if (log.isDebugEnabled()) {
                    log.debug("Found a matching region: " + region);
                }
View Full Code Here

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

                                 iaasInfo;
            log.error(msg);
            throw new InvalidZoneException(msg);
        }
        ComputeServiceContext context = iaasInfo.getComputeService().getContext();
        AvailabilityZoneAndRegionApi zoneRegionApi = context.unwrapApi(AWSEC2Api.class).
            getAvailabilityZoneAndRegionApiForRegion(region).get();
       
        Set<AvailabilityZoneInfo> availabilityZones =
                                                      zoneRegionApi.describeAvailabilityZonesInRegion(region,
                                                              new DescribeAvailabilityZonesOptions[0]);
View Full Code Here

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

      log.fatal("Cannot create a new volume in the [region] : "+region
          +", [zone] : "+zone+" of Iaas : "+iaasInfo);
      return null;
    }
   
    ElasticBlockStoreApi blockStoreApi = context.unwrapApi(AWSEC2Api.class).getElasticBlockStoreApiForRegion(region).get();
   
    Volume volume = blockStoreApi.createVolumeInAvailabilityZone(zone, sizeGB);
   
    if (volume == null) {
      log.fatal("Volume creation was unsuccessful. [region] : " + region
View Full Code Here

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

      log.fatal("Cannot attach the volume [id]: "+volumeId+" in the [region] : "+region
          +", [zone] : "+zone+" of Iaas : "+iaasInfo);
      return null;
    }
   
    ElasticBlockStoreApi blockStoreApi = context.unwrapApi(AWSEC2Api.class).getElasticBlockStoreApiForRegion(region).get();

        Volume.Status volumeStatus = this.getVolumeStatus(blockStoreApi, region, volumeId);

        if(log.isDebugEnabled()){
            log.debug("Volume " + volumeId + " is in state " + volumeStatus);
View Full Code Here

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

          +" of the [region] : "+region
          +" of Iaas : "+iaasInfo);
      return;
    }

    ElasticBlockStoreApi blockStoreApi = context.unwrapApi(AWSEC2Api.class).getElasticBlockStoreApiForRegion(region).get();

        Set<Volume> volumeDescriptions = blockStoreApi.describeVolumesInRegion(region, volumeId);
        Iterator<Volume> it = volumeDescriptions.iterator();

        while(it.hasNext()){
View Full Code Here

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

         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
         EC2Api ec2 = context.unwrapApi(EC2Api.class);
         Set<PublicIpInstanceIdPair> ipidpairs =
               ec2.getElasticIPAddressApi().get().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

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

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

      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

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

            .overrides(overrides)
            .modules(modules)
            .buildView(ComputeServiceContext.class);

      computeService = context.getComputeService();
      novaApi = context.unwrapApi(NovaApi.class);
   }

   /**
    * Detect that the OpenStack Key Pair Extension is installed on the Rackspace Cloud.
    *
 
View Full Code Here

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

   public ServerMetadata(String username, String apiKey) {
      ComputeServiceContext context = ContextBuilder.newBuilder(PROVIDER)
            .credentials(username, apiKey)
            .buildView(ComputeServiceContext.class);
      computeService = context.getComputeService();
      novaApi = context.unwrapApi(NovaApi.class);
      serverApi = novaApi.getServerApiForZone(ZONE);
   }

   /**
    * @return The Server created in the CreateServer example
View Full Code Here

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

            .credentials(username, apiKey)
            .modules(modules)
            .overrides(overrides)
            .buildView(ComputeServiceContext.class);
      computeService = context.getComputeService();
      novaApi = context.unwrapApi(NovaApi.class);
      volumeAttachmentApi = novaApi.getVolumeAttachmentExtensionForZone(ZONE).get();

      cinderApi = ContextBuilder.newBuilder(PROVIDER)
            .credentials(username, apiKey)
            .buildApi(CinderApi.class);
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.