Package org.jclouds.vcloud.domain

Examples of org.jclouds.vcloud.domain.Capacity


      Factory factory = injector.getInstance(ParseSax.Factory.class);
      VDC result = factory.create(injector.getInstance(VDCHandler.class)).parse(is);
      assertEquals(result.getName(), "Miami Environment 1");
      assertEquals(result.getHref(), URI.create("https://services.vcloudexpress.terremark.com/api/v0.8/vdc/32"));
      assertEquals(result.getDescription(), null);
      assertEquals(result.getStorageCapacity(), new Capacity("bytes * 10^9", 100, 0, 8, 0));
      assertEquals(result.getCpuCapacity(), new Capacity("hz * 10^6", 5000, 0, 0, 0));
      assertEquals(result.getMemoryCapacity(), new Capacity("bytes * 2^20", 10240, 0, 0, 0));
      assertEquals(result.getVmQuota(), 0);
      assertEquals(result.getResourceEntities(), ImmutableMap.<String, ReferenceType> of("adriantest",
               new ReferenceTypeImpl("adriantest", VCloudMediaType.VAPP_XML, URI
                        .create("https://services.vcloudexpress.terremark.com/api/v0.8/vapp/15124")), "centos-53",
               new ReferenceTypeImpl("centos-53", VCloudMediaType.VAPP_XML, URI
View Full Code Here


      Factory factory = injector.getInstance(ParseSax.Factory.class);
      VDC result = factory.create(injector.getInstance(VDCHandler.class)).parse(is);
      assertEquals(result.getName(), "vDC Name");
      assertEquals(result.getHref(), URI.create("https://vcloud.safesecureweb.com/api/v0.8/vdc/188849"));
      assertEquals(result.getDescription(), "vDC Name");
      assertEquals(result.getStorageCapacity(), new Capacity("bytes * 10^9", 0, 0, 40960, 0));
      assertEquals(result.getCpuCapacity(), new Capacity("hz * 10^6", 0, 0, 2400, 0));
      assertEquals(result.getMemoryCapacity(), new Capacity("bytes * 10^9", 0, 0, 2, 0));
      assertEquals(result.getVmQuota(), 0);
      assertEquals(result.getResourceEntities(), new ImmutableMap.Builder<String, ReferenceType>().put(
               "Plesk (Linux) 64-bit Template",
               new ReferenceTypeImpl("Plesk (Linux) 64-bit Template", "application/vnd.vmware.vcloud.vAppTemplate+xml",
                        URI.create("https://vcloud.safesecureweb.com/api/v0.8/vAppTemplate/1"))).put(
View Full Code Here

      } else if (qName.endsWith("Limit")) {
         limit = Integer.parseInt(currentOrNull());
      } else if (qName.endsWith("Overhead")) {
         overhead = Integer.parseInt(currentOrNull());
      } else if (qName.endsWith("StorageCapacity")) {
         storageCapacity = new Capacity(units, allocated, limit, used, overhead);
         resetCapacity();
      } else if (qName.endsWith("Cpu")) {
         cpuCapacity = new Capacity(units, allocated, limit, used, overhead);
         resetCapacity();
      } else if (qName.endsWith("Memory")) {
         memoryCapacity = new Capacity(units, allocated, limit, used, overhead);
         resetCapacity();
      } else if (qName.endsWith("DeployedVmsQuota")) {
         vmQuota = (int) limit;
         // vcloud express doesn't have the zero is unlimited rule
         if (vmQuota == -1)
View Full Code Here

TOP

Related Classes of org.jclouds.vcloud.domain.Capacity

Copyright © 2018 www.massapicom. 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.