Examples of HostAggregate


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

            responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse,
            authenticatedGET().endpoint(endpoint).build(),
            HttpResponse.builder().statusCode(200).payload(payloadFromResource("/host_aggregate_list.json")).build())
            .getHostAggregateExtensionForZone("az-1.region-a.geo-1").get();

      HostAggregate result = Iterables.getOnlyElement(api.list());
      assertEquals(result, exampleHostAggregate());
   }
View Full Code Here

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

         for (HostAggregate aggregate : aggregates) {
            assertNotNull(aggregate.getId());
            assertNotNull(aggregate.getName());
            assertNotNull(aggregate.getAvailabilityZone());

            HostAggregate details = api.get(aggregate.getId());
            assertEquals(details.getId(), aggregate.getId());
            assertEquals(details.getName(), aggregate.getName());
            assertEquals(details.getAvailabilityZone(), aggregate.getAvailabilityZone());
            assertEquals(details.getHosts(), aggregate.getHosts());
         }
      }
   }
View Full Code Here

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

         for (Map<String, String> theMetaData : ImmutableSet.of(
               ImmutableMap.of("somekey", "somevalue"),
               ImmutableMap.of("somekey", "some other value", "anotherkey", "another val")
         )) {
            // Apply changes
            HostAggregate details = api.setMetadata(testAggregate.getId(), theMetaData);
           
            //  bug in openstack - metadata values are never removed, so we just checking what we've set
            for (Map.Entry<String, String> entry : theMetaData.entrySet()) {
               assertEquals(details.getMetadata().get(entry.getKey()), entry.getValue());
            }

            // Re-fetch to double-check
            details = api.get(testAggregate.getId());
            for (Map.Entry<String, String> entry : theMetaData.entrySet()) {
               assertEquals(details.getMetadata().get(entry.getKey()), entry.getValue());
            }
         }
      }
   }
View Full Code Here

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

         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);

            assertEquals(details.getHosts(), ImmutableSet.of(host_id));

            // re-fetch to double-check
            details = api.get(testAggregate.getId());
            assertEquals(details.getHosts(), ImmutableSet.of(host_id));

            // TODO wait until status of aggregate isn't CHANGING (hostAdministration.shutdown?)
         } finally {
            details = api.removeHost(testAggregate.getId(), host_id);
         }

         assertEquals(details.getHosts(), ImmutableSet.of());
      }
   }
View Full Code Here

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

            responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse,
            authenticatedGET().endpoint(endpoint).build(),
            HttpResponse.builder().statusCode(200).payload(payloadFromResource("/host_aggregate_list.json")).build())
            .getHostAggregateExtensionForZone("az-1.region-a.geo-1").get();

      HostAggregate result = Iterables.getOnlyElement(api.list());
      assertEquals(result, exampleHostAggregate());
   }
View Full Code Here

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

         for (HostAggregate aggregate : aggregates) {
            assertNotNull(aggregate.getId());
            assertNotNull(aggregate.getName());
            assertNotNull(aggregate.getAvailabilityZone());

            HostAggregate details = api.get(aggregate.getId());
            assertEquals(details.getId(), aggregate.getId());
            assertEquals(details.getName(), aggregate.getName());
            assertEquals(details.getAvailabilityZone(), aggregate.getAvailabilityZone());
            assertEquals(details.getHosts(), aggregate.getHosts());
         }
      }
   }
View Full Code Here

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

         for (Map<String, String> theMetaData : ImmutableSet.of(
               ImmutableMap.of("somekey", "somevalue"),
               ImmutableMap.of("somekey", "some other value", "anotherkey", "another val")
         )) {
            // Apply changes
            HostAggregate details = api.setMetadata(testAggregate.getId(), theMetaData);
           
            //  bug in openstack - metadata values are never removed, so we just checking what we've set
            for (Map.Entry<String, String> entry : theMetaData.entrySet()) {
               assertEquals(details.getMetadata().get(entry.getKey()), entry.getValue());
            }

            // Re-fetch to double-check
            details = api.get(testAggregate.getId());
            for (Map.Entry<String, String> entry : theMetaData.entrySet()) {
               assertEquals(details.getMetadata().get(entry.getKey()), entry.getValue());
            }
         }
      }
   }
View Full Code Here

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

         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);

            assertEquals(details.getHosts(), ImmutableSet.of(host_id));

            // re-fetch to double-check
            details = api.get(testAggregate.getId());
            assertEquals(details.getHosts(), ImmutableSet.of(host_id));

            // TODO wait until status of aggregate isn't CHANGING (hostAdministration.shutdown?)
         } finally {
            details = api.removeHost(testAggregate.getId(), host_id);
         }

         assertEquals(details.getHosts(), ImmutableSet.of());
      }
   }
View Full Code Here

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

            responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse,
            authenticatedGET().endpoint(endpoint).build(),
            HttpResponse.builder().statusCode(200).payload(payloadFromResource("/host_aggregate_list.json")).build())
            .getHostAggregateExtensionForZone("az-1.region-a.geo-1").get();

      HostAggregate result = Iterables.getOnlyElement(api.list());
      assertEquals(result, exampleHostAggregate());
   }
View Full Code Here

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

         for (HostAggregate aggregate : aggregates) {
            assertNotNull(aggregate.getId());
            assertNotNull(aggregate.getName());
            assertNotNull(aggregate.getAvailabilityZone());

            HostAggregate details = api.get(aggregate.getId());
            assertEquals(details.getId(), aggregate.getId());
            assertEquals(details.getName(), aggregate.getName());
            assertEquals(details.getAvailabilityZone(), aggregate.getAvailabilityZone());
            assertEquals(details.getHosts(), aggregate.getHosts());
         }
      }
   }
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.