Package org.jclouds.openstack.nova.v2_0.compute.predicates

Examples of org.jclouds.openstack.nova.v2_0.compute.predicates.AllNodesInGroupTerminated


      HttpResponse listResponse = HttpResponse.builder().statusCode(200).payload(
               payloadFromResource("/securitygroup_list_details_computeservice_typical.json")).build();

      builder.put(list, listResponse);

      NovaApi apiWhenSecurityGroupsExist = requestsSendResponses(builder.build());

      CreateSecurityGroupIfNeeded fn = new CreateSecurityGroupIfNeeded(apiWhenSecurityGroupsExist);

      // we can find it
      assertEquals(fn.apply(
View Full Code Here


*/
@Test(groups = "unit", testName = "CloudServersUKProviderTest")
public class CloudServersUKProviderTest extends BaseProviderMetadataTest {

   public CloudServersUKProviderTest() {
      super(new CloudServersUKProviderMetadata(), new NovaApiMetadata());
   }
View Full Code Here

   public static class Builder extends BaseProviderMetadata.Builder {

      protected Builder(){
         id("rackspace-cloudservers-uk")
         .name("Rackspace Next Generation Cloud Servers UK")
         .apiMetadata(new NovaApiMetadata().toBuilder()
                  .identityName("${userName}")
                  .credentialName("${apiKey}")
                  .version("2")
                  .defaultEndpoint("https://lon.identity.api.rackspacecloud.com/v2.0/")
                  .endpointName("identity service url ending in /v2.0/")
View Full Code Here

     
      builder.put(getSecurityGroup, getSecurityGroupResponse);

      NovaApi apiCanCreateSecurityGroup = requestsSendResponses(builder.build());

      CreateSecurityGroupIfNeeded fn = new CreateSecurityGroupIfNeeded(apiCanCreateSecurityGroup);

      // we can find it
      assertEquals(fn.apply(
               new ZoneSecurityGroupNameAndPorts("az-1.region-a.geo-1", "jclouds_mygroup", ImmutableSet.of(22, 8080)))
               .toString(), new SecurityGroupInZone(new ParseComputeServiceTypicalSecurityGroupTest().expected(),
               "az-1.region-a.geo-1").toString());

   }
View Full Code Here

      builder.put(list, listResponse);

      NovaApi apiWhenSecurityGroupsExist = requestsSendResponses(builder.build());

      CreateSecurityGroupIfNeeded fn = new CreateSecurityGroupIfNeeded(apiWhenSecurityGroupsExist);

      // we can find it
      assertEquals(fn.apply(
               new ZoneSecurityGroupNameAndPorts("az-1.region-a.geo-1", "jclouds_mygroup", ImmutableSet.of(22, 8080)))
               .toString(), new SecurityGroupInZone(new ParseComputeServiceTypicalSecurityGroupTest().expected(),
               "az-1.region-a.geo-1").toString());

   }
View Full Code Here

   @Override
   public NodeAndInitialCredentials<ServerInZone> createNodeWithGroupEncodedIntoName(String group, String name,
            Template template) {

      LoginCredentials.Builder credentialsBuilder = LoginCredentials.builder();
      NovaTemplateOptions templateOptions = template.getOptions().as(NovaTemplateOptions.class);

      CreateServerOptions options = new CreateServerOptions();
      options.metadata(metadataAndTagsAsCommaDelimitedValue(template.getOptions()));
      if (templateOptions.getSecurityGroupNames().isPresent())
         options.securityGroupNames(templateOptions.getSecurityGroupNames().get());
      options.userData(templateOptions.getUserData());
      options.diskConfig(templateOptions.getDiskConfig());

      Optional<String> privateKey = Optional.absent();
      if (templateOptions.getKeyPairName() != null) {
         options.keyPairName(templateOptions.getKeyPairName());       
         KeyPair keyPair = keyPairCache.getIfPresent(ZoneAndName.fromZoneAndName(template.getLocation().getId(), templateOptions.getKeyPairName()));
         if (keyPair != null && keyPair.getPrivateKey() != null) {
            privateKey = Optional.of(keyPair.getPrivateKey());
            credentialsBuilder.privateKey(privateKey.get());
         }
      }
View Full Code Here

public class OrphanedGroupsByZoneId implements Function<Set<? extends NodeMetadata>, Multimap<String, String>> {
   private final Predicate<ZoneAndName> allNodesInGroupTerminated;

   @Inject
   protected OrphanedGroupsByZoneId(ComputeService computeService) {
      this(new AllNodesInGroupTerminated(checkNotNull(computeService, "computeService")));
   }
View Full Code Here

public class OrphanedGroupsByZoneId implements Function<Set<? extends NodeMetadata>, Multimap<String, String>> {
   private final Predicate<ZoneAndName> allNodesInGroupTerminated;

   @Inject
   protected OrphanedGroupsByZoneId(ComputeService computeService) {
      this(new AllNodesInGroupTerminated(checkNotNull(computeService, "computeService")));
   }
View Full Code Here

public class OrphanedGroupsByZoneId implements Function<Set<? extends NodeMetadata>, Multimap<String, String>> {
   private final Predicate<ZoneAndName> allNodesInGroupTerminated;

   @Inject
   protected OrphanedGroupsByZoneId(ComputeService computeService) {
      this(new AllNodesInGroupTerminated(checkNotNull(computeService, "computeService")));
   }
View Full Code Here

public class OrphanedGroupsByRegionId implements Function<Set<? extends NodeMetadata>, Multimap<String, String>> {
   private final Predicate<RegionAndName> allNodesInGroupTerminated;

   @Inject
   protected OrphanedGroupsByRegionId(ComputeService computeService) {
      this(new AllNodesInGroupTerminated(checkNotNull(computeService, "computeService")));
   }
View Full Code Here

TOP

Related Classes of org.jclouds.openstack.nova.v2_0.compute.predicates.AllNodesInGroupTerminated

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.