Examples of unwrapApi()


Examples of org.jclouds.View.unwrapApi()

   public void testAssignability() {
      View view = ContextBuilder.newBuilder(new AWSEC2ProviderMetadata()).credentials("foo", "bar")
              .buildView(typeToken(ComputeServiceContext.class));
      view.unwrapApi(EC2Api.class);
      view.unwrapApi(AWSEC2Api.class);
   }

   public void testConvertImageSyntax() {
      Properties input = new Properties();
      input.setProperty(PROPERTY_EC2_AMI_OWNERS, "137112412989,063491364108,099720109477,411009282317");
View Full Code Here

Examples of org.jclouds.View.unwrapApi()

@Test(groups = "unit", testName = "EC2ContextBuilderTest")
public class EC2ContextBuilderText {
   public void testAssignability() {
      View view = ContextBuilder.newBuilder(new EC2ApiMetadata()).credentials("foo", "bar")
              .buildView(typeToken(ComputeServiceContext.class));
      view.unwrapApi(EC2Api.class);
   }
}
View Full Code Here

Examples of org.jclouds.blobstore.BlobStoreContext.unwrapApi()

         // Use Provider API
         ApiMetadata apiMetadata = context.unwrap().getProviderMetadata().getApiMetadata();
         Object object = null;
         if (apiMetadata instanceof S3ApiMetadata) {
            S3Client api = context.unwrapApi(S3Client.class);
            object = api.headObject(containerName, blobName);
         } else if (apiMetadata instanceof SwiftApiMetadata) {
            SwiftClient api = context.unwrapApi(SwiftClient.class);
            object = api.getObjectInfo(containerName, blobName);
         } else if (apiMetadata instanceof AzureBlobApiMetadata) {
View Full Code Here

Examples of org.jclouds.blobstore.BlobStoreContext.unwrapApi()

         Object object = null;
         if (apiMetadata instanceof S3ApiMetadata) {
            S3Client api = context.unwrapApi(S3Client.class);
            object = api.headObject(containerName, blobName);
         } else if (apiMetadata instanceof SwiftApiMetadata) {
            SwiftClient api = context.unwrapApi(SwiftClient.class);
            object = api.getObjectInfo(containerName, blobName);
         } else if (apiMetadata instanceof AzureBlobApiMetadata) {
            RestContext<AzureBlobClient, ?> providerContext = context.unwrap();
            object = providerContext.getApi().getBlobProperties(containerName, blobName);
         } else if (apiMetadata instanceof AtmosApiMetadata) {
View Full Code Here

Examples of org.jclouds.blobstore.BlobStoreContext.unwrapApi()

            object = api.getObjectInfo(containerName, blobName);
         } else if (apiMetadata instanceof AzureBlobApiMetadata) {
            RestContext<AzureBlobClient, ?> providerContext = context.unwrap();
            object = providerContext.getApi().getBlobProperties(containerName, blobName);
         } else if (apiMetadata instanceof AtmosApiMetadata) {
            AtmosClient api = context.unwrapApi(AtmosClient.class);
            object = api.headFile(containerName + "/" + blobName);
         }
         if (object != null) {
            System.out.println(object);
         }
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()

      log.fatal("Cannot delete the volume [id]: "+volumeId+" of the [region] : "+region
          +" of Iaas : "+iaasInfo);
      return;
    }
   
    ElasticBlockStoreApi blockStoreApi = context.unwrapApi(AWSEC2Api.class).getElasticBlockStoreApiForRegion(region).get();
    blockStoreApi.deleteVolumeInRegion(region, volumeId);
   
    log.info("Deletion of Volume [id]: "+volumeId+" was successful. [region] : " + region
        + " of Iaas : " + iaasInfo);
  }
View Full Code Here

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

    String ec2Msg = " ec2. Region: " + region + " - Key Pair Name: ";

    ComputeServiceContext context = iaasInfo.getComputeService()
        .getContext();
   
    AWSKeyPairApi keyPairApi = context.unwrapApi(AWSEC2Api.class).getKeyPairApiForRegion(region).get();

    KeyPair keyPair = keyPairApi.importKeyPairInRegion(region, keyPairName, publicKey);
   
    if (keyPair != null) {
View Full Code Here

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

    IaasProvider iaasInfo = getIaasProvider();
   
    ComputeServiceContext context = iaasInfo.getComputeService()
        .getContext();
   
    ElasticIPAddressApi elasticIPAddressApi = context.unwrapApi(AWSEC2Api.class).getElasticIPAddressApi().get();
    String region = ComputeServiceBuilderUtil.extractRegion(iaasInfo);
   
    String ip = null;

    // first try to find an unassigned IP.
View Full Code Here

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

    IaasProvider iaasInfo = getIaasProvider();
   
    ComputeServiceContext context = iaasInfo.getComputeService()
        .getContext();
    ElasticIPAddressApi elasticIPAddressApi = context.unwrapApi(AWSEC2Api.class).getElasticIPAddressApi().get();
    String region = ComputeServiceBuilderUtil.extractRegion(iaasInfo);

    elasticIPAddressApi.disassociateAddressInRegion(
        region, ip);
    elasticIPAddressApi.releaseAddressInRegion(region,
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.