Package org.jclouds.openstack.nova.v2_0.domain

Examples of org.jclouds.openstack.nova.v2_0.domain.SimpleTenantUsage


                  .payload(payloadFromResource("/simple_tenant_usages.json")).build())
            .getSimpleTenantUsageExtensionForZone("az-1.region-a.geo-1").get();
     
      Set<? extends SimpleTenantUsage> results = api.list().toSet();
     
      SimpleTenantUsage usage = Iterables.getOnlyElement(results);
      assertEquals(usage.getTenantId(), "f8535069c3fb404cb61c873b1a0b4921");
      assertEquals(usage.getTotalHours(), 4.888888888888889e-07);
      assertEquals(usage.getTotalLocalGbUsage(), 1.9555555555555557e-05);
      assertEquals(usage.getTotalMemoryMbUsage(), 0.0015018666666666667);
      assertEquals(usage.getTotalVcpusUsage(), 7.333333333333333e-07);
      assertEquals(usage.getStart(), dateService.iso8601DateParse("2012-04-18 12:18:39.702411"));
      assertEquals(usage.getStop(), dateService.iso8601DateParse("2012-04-18 12:18:39.702499"));
      assertNotNull(usage.getServerUsages());
      assertTrue(usage.getServerUsages().isEmpty());
   }
View Full Code Here


                  .endpoint(endpoint).build(),
            HttpResponse.builder().statusCode(200)
                  .payload(payloadFromResource("/simple_tenant_usage.json")).build())
            .getSimpleTenantUsageExtensionForZone("az-1.region-a.geo-1").get();

      SimpleTenantUsage usage = api.get("test-1234");
      assertEquals(usage.getTenantId(), "f8535069c3fb404cb61c873b1a0b4921");
     
      SimpleTenantUsage expected = SimpleTenantUsage.builder().tenantId("f8535069c3fb404cb61c873b1a0b4921").totalHours(4.833333333333333E-7).totalLocalGbUsage(1.933333333333333E-05)
            .start(dateService.iso8601DateParse("2012-04-18 13:32:07.255743")).stop(dateService.iso8601DateParse("2012-04-18 13:32:07.255743"))
            .totalMemoryMbUsage(0.0014847999999999999).totalVcpusUsage(7.249999999999999E-07).serverUsages(
            ImmutableSet.of(
                  SimpleServerUsage.builder().hours(2.4166666666666665e-07).uptime(91149).flavorLocalGb(50).instanceName("test1").tenantId("f8535069c3fb404cb61c873b1a0b4921").flavorVcpus(2).flavorMemoryMb(4096).instanceStatus(SimpleServerUsage.Status.ACTIVE).flavorName("m1.medium").instanceCreated(this.dateService.iso8601SecondsDateParse("2012-04-17T12:12:58")).build(),
                  SimpleServerUsage.builder().hours(2.4166666666666665e-07).uptime(84710).flavorLocalGb(30).instanceName("mish_test").tenantId("f8535069c3fb404cb61c873b1a0b4921").flavorVcpus(1).flavorMemoryMb(2048).instanceStatus(SimpleServerUsage.Status.ACTIVE).flavorName("m1.small").instanceCreated(this.dateService.iso8601SecondsDateParse("2012-04-17T14:00:17")).build()
View Full Code Here

         if (optApi.isPresent() && identity.endsWith(":admin")) {
            SimpleTenantUsageApi api = optApi.get();
            Set<? extends SimpleTenantUsage> usages = api.list().toSet();
            assertNotNull(usages);
            for (SimpleTenantUsage usage : usages) {
               SimpleTenantUsage details = api.get(usage.getTenantId());
               assertNotNull(details);
            }
         }
      }
   }
View Full Code Here

         if (optApi.isPresent() && identity.endsWith(":admin")) {
            SimpleTenantUsageApi api = optApi.get();
            Set<? extends SimpleTenantUsage> usages = api.list().toSet();
            assertNotNull(usages);
            for (SimpleTenantUsage usage : usages) {
               SimpleTenantUsage details = api.get(usage.getTenantId());
               assertNotNull(details);
            }
         }
      }
   }
View Full Code Here

         if (optApi.isPresent() && identity.endsWith(":admin")) {
            SimpleTenantUsageApi api = optApi.get();
            Set<? extends SimpleTenantUsage> usages = api.list().toSet();
            assertNotNull(usages);
            for (SimpleTenantUsage usage : usages) {
               SimpleTenantUsage details = api.get(usage.getTenantId());
               assertNotNull(details);
            }
         }
      }
   }
View Full Code Here

                  .payload(payloadFromResource("/simple_tenant_usages.json")).build())
            .getSimpleTenantUsageExtensionForZone("az-1.region-a.geo-1").get();
     
      Set<? extends SimpleTenantUsage> results = api.list().toSet();
     
      SimpleTenantUsage usage = Iterables.getOnlyElement(results);
      assertEquals(usage.getTenantId(), "f8535069c3fb404cb61c873b1a0b4921");
      assertEquals(usage.getTotalHours(), 4.888888888888889e-07);
      assertEquals(usage.getTotalLocalGbUsage(), 1.9555555555555557e-05);
      assertEquals(usage.getTotalMemoryMbUsage(), 0.0015018666666666667);
      assertEquals(usage.getTotalVcpusUsage(), 7.333333333333333e-07);
      assertEquals(usage.getStart(), dateService.iso8601DateParse("2012-04-18 12:18:39.702411"));
      assertEquals(usage.getStop(), dateService.iso8601DateParse("2012-04-18 12:18:39.702499"));
      assertNotNull(usage.getServerUsages());
      assertTrue(usage.getServerUsages().isEmpty());
   }
View Full Code Here

                  .endpoint(endpoint).build(),
            HttpResponse.builder().statusCode(200)
                  .payload(payloadFromResource("/simple_tenant_usage.json")).build())
            .getSimpleTenantUsageExtensionForZone("az-1.region-a.geo-1").get();

      SimpleTenantUsage usage = api.get("test-1234");
      assertEquals(usage.getTenantId(), "f8535069c3fb404cb61c873b1a0b4921");
     
      SimpleTenantUsage expected = SimpleTenantUsage.builder().tenantId("f8535069c3fb404cb61c873b1a0b4921").totalHours(4.833333333333333E-7).totalLocalGbUsage(1.933333333333333E-05)
            .start(dateService.iso8601DateParse("2012-04-18 13:32:07.255743")).stop(dateService.iso8601DateParse("2012-04-18 13:32:07.255743"))
            .totalMemoryMbUsage(0.0014847999999999999).totalVcpusUsage(7.249999999999999E-07).serverUsages(
            ImmutableSet.of(
                  SimpleServerUsage.builder().hours(2.4166666666666665e-07).uptime(91149).flavorLocalGb(50).instanceName("test1").tenantId("f8535069c3fb404cb61c873b1a0b4921").flavorVcpus(2).flavorMemoryMb(4096).instanceStatus(SimpleServerUsage.Status.ACTIVE).flavorName("m1.medium").instanceCreated(this.dateService.iso8601SecondsDateParse("2012-04-17T12:12:58")).build(),
                  SimpleServerUsage.builder().hours(2.4166666666666665e-07).uptime(84710).flavorLocalGb(30).instanceName("mish_test").tenantId("f8535069c3fb404cb61c873b1a0b4921").flavorVcpus(1).flavorMemoryMb(2048).instanceStatus(SimpleServerUsage.Status.ACTIVE).flavorName("m1.small").instanceCreated(this.dateService.iso8601SecondsDateParse("2012-04-17T14:00:17")).build()
View Full Code Here

                  .payload(payloadFromResource("/simple_tenant_usages.json")).build())
            .getSimpleTenantUsageExtensionForZone("az-1.region-a.geo-1").get();
     
      Set<? extends SimpleTenantUsage> results = api.list().toSet();
     
      SimpleTenantUsage usage = Iterables.getOnlyElement(results);
      assertEquals(usage.getTenantId(), "f8535069c3fb404cb61c873b1a0b4921");
      assertEquals(usage.getTotalHours(), 4.888888888888889e-07);
      assertEquals(usage.getTotalLocalGbUsage(), 1.9555555555555557e-05);
      assertEquals(usage.getTotalMemoryMbUsage(), 0.0015018666666666667);
      assertEquals(usage.getTotalVcpusUsage(), 7.333333333333333e-07);
      assertEquals(usage.getStart(), dateService.iso8601DateParse("2012-04-18 12:18:39.702411"));
      assertEquals(usage.getStop(), dateService.iso8601DateParse("2012-04-18 12:18:39.702499"));
      assertNotNull(usage.getServerUsages());
      assertTrue(usage.getServerUsages().isEmpty());
   }
View Full Code Here

                  .endpoint(endpoint).build(),
            HttpResponse.builder().statusCode(200)
                  .payload(payloadFromResource("/simple_tenant_usage.json")).build())
            .getSimpleTenantUsageExtensionForZone("az-1.region-a.geo-1").get();

      SimpleTenantUsage usage = api.get("test-1234");
      assertEquals(usage.getTenantId(), "f8535069c3fb404cb61c873b1a0b4921");
     
      SimpleTenantUsage expected = SimpleTenantUsage.builder().tenantId("f8535069c3fb404cb61c873b1a0b4921").totalHours(4.833333333333333E-7).totalLocalGbUsage(1.933333333333333E-05)
            .start(dateService.iso8601DateParse("2012-04-18 13:32:07.255743")).stop(dateService.iso8601DateParse("2012-04-18 13:32:07.255743"))
            .totalMemoryMbUsage(0.0014847999999999999).totalVcpusUsage(7.249999999999999E-07).serverUsages(
            ImmutableSet.of(
                  SimpleServerUsage.builder().hours(2.4166666666666665e-07).uptime(91149).flavorLocalGb(50).instanceName("test1").tenantId("f8535069c3fb404cb61c873b1a0b4921").flavorVcpus(2).flavorMemoryMb(4096).instanceStatus(SimpleServerUsage.Status.ACTIVE).flavorName("m1.medium").instanceCreated(this.dateService.iso8601SecondsDateParse("2012-04-17T12:12:58")).build(),
                  SimpleServerUsage.builder().hours(2.4166666666666665e-07).uptime(84710).flavorLocalGb(30).instanceName("mish_test").tenantId("f8535069c3fb404cb61c873b1a0b4921").flavorVcpus(1).flavorMemoryMb(2048).instanceStatus(SimpleServerUsage.Status.ACTIVE).flavorName("m1.small").instanceCreated(this.dateService.iso8601SecondsDateParse("2012-04-17T14:00:17")).build()
View Full Code Here

                  .payload(payloadFromResource("/simple_tenant_usages.json")).build())
            .getSimpleTenantUsageApi("az-1.region-a.geo-1").get();

      Set<? extends SimpleTenantUsage> results = api.list().toSet();

      SimpleTenantUsage usage = Iterables.getOnlyElement(results);
      assertEquals(usage.getTenantId(), "f8535069c3fb404cb61c873b1a0b4921");
      assertEquals(usage.getTotalHours(), 4.888888888888889e-07);
      assertEquals(usage.getTotalLocalGbUsage(), 1.9555555555555557e-05);
      assertEquals(usage.getTotalMemoryMbUsage(), 0.0015018666666666667);
      assertEquals(usage.getTotalVcpusUsage(), 7.333333333333333e-07);
      assertEquals(usage.getStart(), dateService.iso8601DateParse("2012-04-18 12:18:39.702411"));
      assertEquals(usage.getStop(), dateService.iso8601DateParse("2012-04-18 12:18:39.702499"));
      assertNotNull(usage.getServerUsages());
      assertTrue(usage.getServerUsages().isEmpty());
   }
View Full Code Here

TOP

Related Classes of org.jclouds.openstack.nova.v2_0.domain.SimpleTenantUsage

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.