Package org.jclouds.domain

Examples of org.jclouds.domain.LocationBuilder


   public NodeMetadata apply(Server from) {
      NodeMetadataBuilder builder = new NodeMetadataBuilder();
      builder.ids(from.getId() + "");
      builder.name(from.getName());
      builder.hostname(from.getName());
      builder.location(new LocationBuilder().scope(LocationScope.HOST).id(from.getHostId()).description(
               from.getHostId()).parent(location.get()).build());
      addMetadataAndParseTagsFromCommaDelimitedValue(builder, from.getMetadata());
      builder.group(groupFromMapOrName(from.getMetadata(), from.getName(), nodeNamingConvention));
      builder.imageId(from.getImageId() + "");
      builder.operatingSystem(parseOperatingSystem(from));
View Full Code Here


      SecurityGroupBuilder groupBuilder = new SecurityGroupBuilder();
      groupBuilder.id("us-east-1/sg-3c6ef654");
      groupBuilder.providerId("sg-3c6ef654");
      groupBuilder.name("jclouds#some-group");
      groupBuilder.location(new LocationBuilder()
                            .scope(LocationScope.REGION)
                            .id(region)
                            .description("region")
                            .build());
     
View Full Code Here

      SecurityGroupBuilder groupBuilder = new SecurityGroupBuilder();
      groupBuilder.id("us-east-1/sg-3c6ef654");
      groupBuilder.providerId("sg-3c6ef654");
      groupBuilder.name("jclouds#some-group");
      groupBuilder.location(new LocationBuilder()
                            .scope(LocationScope.REGION)
                            .id(region)
                            .description("region")
                            .build());
     
View Full Code Here

      SecurityGroupBuilder groupBuilder = new SecurityGroupBuilder();
      groupBuilder.id("us-east-1/sg-3c6ef654");
      groupBuilder.providerId("sg-3c6ef654");
      groupBuilder.name("jclouds#some-group");
      groupBuilder.location(new LocationBuilder()
                            .scope(LocationScope.REGION)
                            .id(region)
                            .description("region")
                            .build());
      groupBuilder.ownerId("993194456877");
View Full Code Here

      SecurityGroupBuilder groupBuilder = new SecurityGroupBuilder();
      groupBuilder.id("us-east-1/sg-3c6ef654");
      groupBuilder.providerId("sg-3c6ef654");
      groupBuilder.name("jclouds#some-group");
      groupBuilder.ownerId("993194456877");
      groupBuilder.location(new LocationBuilder()
                            .scope(LocationScope.REGION)
                            .id(region)
                            .description("region")
                            .build());
     
View Full Code Here

               }), Predicates.notNull()));
      if (zones.size() == 0)
         return locations.add(provider).build();
      else
         for (String zone : zones) {
            locations.add(new LocationBuilder().scope(LocationScope.ZONE).id(zone).description(zone).parent(provider)
                     .build());
         }
      return locations.build();
   }
View Full Code Here

      Location provider = Iterables.getOnlyElement(super.get());
      if (orgNameToResource.get().size() == 0)
         return locations.add(provider);
      Map<String, Supplier<Set<String>>> isoCodesById = isoCodesByIdSupplier.get();
      for (ReferenceType org : orgNameToResource.get().values()) {
         LocationBuilder builder = new LocationBuilder().scope(LocationScope.REGION).id(org.getHref().toASCIIString())
                  .description(org.getName()).parent(provider);
         if (isoCodesById.containsKey(org.getHref().toASCIIString()))
            builder.iso3166Codes(isoCodesById.get(org.getHref().toASCIIString()).get());
         Location orgL = builder.build();
         for (ReferenceType vdc : orgNameToVDCResource.get().get(org.getName()).getVDCs().values()) {
            builder = new LocationBuilder().scope(LocationScope.ZONE).id(vdc.getHref().toASCIIString()).description(
                     vdc.getName()).parent(orgL);
            if (isoCodesById.containsKey(vdc.getHref().toASCIIString()))
               builder.iso3166Codes(isoCodesById.get(vdc.getHref().toASCIIString()).get());
            locations.add(builder.build());
         }
      }
      return locations;
   }
View Full Code Here

      requestResponseMap.put(extensionsOfNovaRequest, extensionsOfNovaResponse);
      requestResponseMap.put(list, listResponse).build();

      SecurityGroupExtension extension = requestsSendResponses(requestResponseMap.build()).getSecurityGroupExtension().get();

      Set<SecurityGroup> groups = extension.listSecurityGroupsInLocation(new LocationBuilder()
              .scope(LocationScope.ZONE)
              .id(zone)
              .description("zone")
              .build());
      assertEquals(groups.size(), 1);
View Full Code Here

      requestResponseMap.put(list, listResponse);
      requestResponseMap.put(getSecurityGroup, getSecurityGroupResponse).build();

      SecurityGroupExtension extension = requestsSendResponses(requestResponseMap.build()).getSecurityGroupExtension().get();

      SecurityGroup group = extension.createSecurityGroup("test", new LocationBuilder()
              .scope(LocationScope.ZONE)
              .id(zone)
              .description("zone")
              .build());
      assertEquals(group.getId(), zone + "/160");
View Full Code Here

      NodeMetadataBuilder builder = new NodeMetadataBuilder();
      builder.id(serverInZone.slashEncode());
      builder.providerId(from.getId());
      builder.name(from.getName());
      builder.hostname(from.getName());
      builder.location(from.getHostId() != null ? new LocationBuilder().scope(LocationScope.HOST).id(from.getHostId())
            .description(from.getHostId()).parent(zone).build() : zone);
      builder.group(groupFromMapOrName(from.getMetadata(), from.getName(), nodeNamingConvention));
      addMetadataAndParseTagsFromCommaDelimitedValue(builder, from.getMetadata());

      if (from.getImage() != null) {
View Full Code Here

TOP

Related Classes of org.jclouds.domain.LocationBuilder

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.