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

Examples of org.jclouds.openstack.nova.v2_0.domain.Host$Builder


   @Test(enabled = false)
   public void testShutdownAndStartup() throws Exception {
      if (optApi.isPresent()) {
         HostAdministrationApi api = optApi.get();
         Host host = Iterables.find(api.list(), isComputeHost);
         assertTrue(api.shutdown(host.getName()));
         assertTrue(api.startup(host.getName()));
      }
   }
View Full Code Here


   // Note the host will be added, but cannot remove it til
   @Test(enabled = false, dependsOnMethods = "testCreateAggregate")
   public void testModifyHosts() {
      if (apiOption.isPresent() && hostAdminOption.isPresent()) {
         HostAggregateApi api = apiOption.get();
         Host host = Iterables.getFirst(hostAdminOption.get().list(), null);
         assertNotNull(host);

         String host_id = host.getName();
         assertNotNull(host_id);
         HostAggregate details;

         try {
            details = api.addHost(testAggregate.getId(), host_id);
View Full Code Here

                       .addHeader("Accept", "application/json")
                       .addHeader("X-Auth-Token", authToken)
                  .endpoint(endpoint).build(),
            HttpResponse.builder().statusCode(200).payload(payloadFromResource("/hosts_list.json")).build()).getHostAdministrationExtensionForZone("az-1.region-a.geo-1").get();
     
      Host expected = Host.builder().name("ubuntu").service("compute").build();

      Set<? extends Host> result = api.list().toSet();
      Host host = Iterables.getOnlyElement(result);
      assertEquals(host.getName(), "ubuntu");
      assertEquals(host.getService(), "compute");

      assertEquals(host, expected);
   }
View Full Code Here

                       .addHeader("Accept", "application/json")
                       .addHeader("X-Auth-Token", authToken)
                  .endpoint(endpoint).build(),
            HttpResponse.builder().statusCode(200).payload(payloadFromResource("/hosts_list.json")).build()).getHostAdministrationApi("az-1.region-a.geo-1").get();

      Host expected = Host.builder().name("ubuntu").service("compute").zone("nova").build();

      Set<? extends Host> result = api.list().toSet();
      Host host = Iterables.getOnlyElement(result);
      assertEquals(host.getName(), "ubuntu");
      assertEquals(host.getService(), "compute");
      assertEquals(host.getZone(), "nova");

      assertEquals(host, expected);
   }
View Full Code Here

   // Note the host will be added, but cannot remove it til
   @Test(enabled = false, dependsOnMethods = "testCreateAggregate")
   public void testModifyHosts() {
      if (apiOption.isPresent() && hostAdminOption.isPresent()) {
         HostAggregateApi api = apiOption.get();
         Host host = Iterables.getFirst(hostAdminOption.get().list(), null);
         assertNotNull(host);

         String host_id = host.getName();
         assertNotNull(host_id);
         HostAggregate details;

         try {
            details = api.addHost(testAggregate.getId(), host_id);
View Full Code Here

   @Test(enabled = false)
   public void testEnableDisable() throws Exception {
      if (optApi.isPresent()) {
         HostAdministrationApi api = optApi.get();
         Host host = Iterables.find(api.list(), isComputeHost);

         assertTrue(api.disable(host.getName()));
         assertTrue(api.enable(host.getName()));
      }
   }
View Full Code Here

   @Test(enabled = false)
   public void testMaintenanceMode() throws Exception {
      if (optApi.isPresent()) {
         HostAdministrationApi api = optApi.get();
         Host host = Iterables.find(api.list(), isComputeHost);
         assertTrue(api.startMaintenance(host.getName()));
         assertTrue(api.stopMaintenance(host.getName()));
      }
   }
View Full Code Here

   @Test(enabled = false)
   public void testReboot() throws Exception {
      if (optApi.isPresent()) {
         HostAdministrationApi api = optApi.get();
         Host host = Iterables.find(api.list(), isComputeHost);
         assertTrue(api.reboot(host.getName()));
      }
   }
View Full Code Here

   @Test(enabled = false)
   public void testShutdownAndStartup() throws Exception {
      if (optApi.isPresent()) {
         HostAdministrationApi api = optApi.get();
         Host host = Iterables.find(api.list(), isComputeHost);
         assertTrue(api.shutdown(host.getName()));
         assertTrue(api.startup(host.getName()));
      }
   }
View Full Code Here

            .<String, Location> of("az-1.region-a.geo-1", zone));
  
   @Test
   public void testConversionWhereLocationFound() {
      UUID id = UUID.randomUUID();
      Image novaImageToConvert = Image.builder().id(id.toString()).name("Test Image " + id).status(Image.Status.DELETED).build();
      OperatingSystem operatingSystem = new OperatingSystem(OsFamily.UBUNTU, "My Test OS", "My Test Version", "x86",
               "My Test OS", true);
      ImageInZoneToImage converter = new ImageInZoneToImage(NovaComputeServiceContextModule.toPortableImageStatus,
               constant(operatingSystem), locationIndex);

      ImageInZone novaImageInZoneToConvert = new ImageInZone(novaImageToConvert, "az-1.region-a.geo-1");

      org.jclouds.compute.domain.Image convertedImage = converter.apply(novaImageInZoneToConvert);

      assertEquals(convertedImage.getId(), novaImageInZoneToConvert.slashEncode());
      assertEquals(convertedImage.getProviderId(), novaImageToConvert.getId());
      assertEquals(convertedImage.getLocation(), locationIndex.get().get("az-1.region-a.geo-1"));

      assertEquals(convertedImage.getName(), novaImageToConvert.getName());
      assertEquals(convertedImage.getStatus(), org.jclouds.compute.domain.Image.Status.DELETED);
      assertEquals(convertedImage.getOperatingSystem(), operatingSystem);
   }
View Full Code Here

TOP

Related Classes of org.jclouds.openstack.nova.v2_0.domain.Host$Builder

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.