Package org.jclouds.compute

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


    String openstackNovaMsg = " Openstack-nova. Region: " + region
        + " - Name: ";

    ComputeServiceContext context = iaasInfo.getComputeService()
        .getContext();
    RestContext<NovaApi, NovaAsyncApi> nova = context.unwrap();
    KeyPairApi api = nova.getApi().getKeyPairExtensionForZone(region).get();

    KeyPair keyPair = api.createWithPublicKey(keyPairName, publicKey);

    if (keyPair != null) {
View Full Code Here


    ComputeServiceContext context = iaasInfo.getComputeService()
        .getContext();

    String region = ComputeServiceBuilderUtil.extractRegion(iaasInfo);

    RestContext<NovaApi, NovaAsyncApi> nova = context.unwrap();
    FloatingIPApi floatingIp = nova.getApi().getFloatingIPExtensionForZone(
        region).get();

    String ip = null;
    // first try to find an unassigned IP.
View Full Code Here

   
    ComputeServiceContext context = iaasInfo.getComputeService()
        .getContext();

    @SuppressWarnings("deprecation")
        NovaApi novaClient = context.unwrap(NovaApiMetadata.CONTEXT_TOKEN).getApi();
    String region = ComputeServiceBuilderUtil.extractRegion(iaasInfo);

    FloatingIPApi floatingIp = novaClient.getFloatingIPExtensionForZone(
        region).get();
View Full Code Here

        .getContext();

    String region = ComputeServiceBuilderUtil.extractRegion(iaasInfo);

    @SuppressWarnings("deprecation")
    RestContext<NovaApi, NovaAsyncApi> nova = context.unwrap();
    @SuppressWarnings("deprecation")
    FloatingIPApi floatingIPApi = nova.getApi()
        .getFloatingIPExtensionForZone(region).get();

    for (FloatingIP floatingIP : floatingIPApi.list()) {
View Full Code Here

            log.error(msg);
            throw new InvalidRegionException(msg);
        }
       
        ComputeServiceContext context = iaasInfo.getComputeService().getContext();
        RestContext<NovaApi, NovaAsyncApi> nova = context.unwrap();
        Set<String> zones = nova.getApi().getConfiguredZones();
        for (String configuredZone : zones) {
            if (region.equalsIgnoreCase(configuredZone)) {
                if (log.isDebugEnabled()) {
                    log.debug("Found a matching region: " + region);
View Full Code Here

                    zone + " - IaaSProvider: " + iaasInfo;
            log.error(msg);
            throw new InvalidZoneException(msg);
        }
        ComputeServiceContext context = iaasInfo.getComputeService().getContext();
        RestContext<NovaApi, NovaAsyncApi> nova = context.unwrap();
        AvailabilityZoneAPI zoneApi = nova.getApi().getAvailabilityZoneApi(region);
        for (AvailabilityZone z : zoneApi.list()) {
     
          if (zone.equalsIgnoreCase(z.getName())) {
            if (log.isDebugEnabled()) {
View Full Code Here

                    zone + " - IaaSProvider: " + iaasInfo;
            log.error(msg);
            throw new InvalidHostException(msg);
        }
        ComputeServiceContext context = iaasInfo.getComputeService().getContext();
        RestContext<NovaApi, NovaAsyncApi> nova = context.unwrap();
        HostAggregateApi hostApi = nova.getApi().getHostAggregateExtensionForZone(zone).get();
        for (HostAggregate hostAggregate : hostApi.list()) {
            for (String configuredHost : hostAggregate.getHosts()) {
                if (host.equalsIgnoreCase(configuredHost)) {
                    if (log.isDebugEnabled()) {
View Full Code Here

          +" of Iaas : "+iaasInfo);
            return null;
        }
        ComputeServiceContext context = iaasInfo.getComputeService().getContext();
       
        RestContext<NovaApi, NovaAsyncApi> nova = context.unwrap();
        VolumeApi api = nova.getApi().getVolumeExtensionForZone(region).get();
        Volume volume = api.create(sizeGB, CreateVolumeOptions.Builder.availabilityZone(zone));
        if (volume == null) {
      log.fatal("Volume creation was unsuccessful. [region] : " + region+" [zone] : " + zone
          + " of Iaas : " + iaasInfo);
View Full Code Here

      log.fatal("Cannot attach the volume [id]: "+volumeId+" in the [region] : "+region
          +" of Iaas : "+iaasInfo);
      return null;
    }
   
    RestContext<NovaApi, NovaAsyncApi> nova = context.unwrap();
        VolumeAttachmentApi api = nova.getApi().getVolumeAttachmentExtensionForZone(region).get();
        VolumeAttachment attachment = api.attachVolumeToServerAsDevice(volumeId, instanceId, device);
       
        if (attachment == null) {
      log.fatal("Volume [id]: "+volumeId+" attachment for instance [id]: "+instanceId
View Full Code Here

          +" of the [region] : "+region
          +" of Iaas : "+iaasInfo);
      return;
    }
   
    RestContext<NovaApi, NovaAsyncApi> nova = context.unwrap();
        VolumeAttachmentApi api = nova.getApi().getVolumeAttachmentExtensionForZone(region).get();
        if (api.detachVolumeFromServer(volumeId, instanceId)) {
          log.info("Detachment of Volume [id]: "+volumeId+" from instance [id]: "+instanceId
            +" was successful. [region] : " + region
            + " of Iaas : " + iaasInfo);
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.