Package org.jclouds.compute.domain

Examples of org.jclouds.compute.domain.ImageBuilder


      final Supplier<Set<? extends Location>> locations = Suppliers.<Set<? extends Location>> ofInstance(ImmutableSet
            .<Location> of(region));
      final Supplier<Set<? extends Image>> images = Suppliers.<Set<? extends Image>> ofInstance(ImmutableSet
            .<Image> of(
                  new ImageBuilder()
                        .ids("Ubuntu 11.04 x64")
                        .name("Ubuntu 11.04 x64")
                        .description("Ubuntu 11.04 x64")
                        .location(region)
                        .status(Status.AVAILABLE)
                        .operatingSystem(
                              OperatingSystem.builder().name("Ubuntu 11.04 x64").description("Ubuntu 11.04 x64")
                                    .is64Bit(true).version("11.04").family(OsFamily.UBUNTU).build()).build(),
                  new ImageBuilder()
                        .ids("Ubuntu 11.04 64-bit")
                        .name("Ubuntu 11.04 64-bit")
                        .description("Ubuntu 11.04 64-bit")
                        .location(region)
                        .status(Status.AVAILABLE)
View Full Code Here


      final Supplier<Set<? extends Location>> locations = Suppliers.<Set<? extends Location>> ofInstance(ImmutableSet
            .<Location> of(region));
      final Supplier<Set<? extends Image>> images = Suppliers.<Set<? extends Image>> ofInstance(ImmutableSet
            .<Image> of(
                  new ImageBuilder()
                        .id("us-east-2/ami-ffff")
                        .providerId("ami-ffff")
                        .name("Ubuntu 11.04 x64")
                        .description("Ubuntu 11.04 x64")
                        .location(region2)
View Full Code Here

      final Supplier<Set<? extends Location>> locations = Suppliers.<Set<? extends Location>> ofInstance(ImmutableSet
            .<Location> of(region));
      final Supplier<Set<? extends Image>> images = Suppliers.<Set<? extends Image>> ofInstance(ImmutableSet
            .<Image> of(
                  new ImageBuilder()
                        .id("us-east-2/ami-ffff")
                        .providerId("ami-ffff")
                        .name("Ubuntu 11.04 x64")
                        .description("Ubuntu 11.04 x64")
                        .location(region2)
View Full Code Here

         super(null);
      }

      @Override
      public Image getImage(VirtualGuest guest) {
         return new ImageBuilder().ids("123").description("mocked image")
               .operatingSystem(OperatingSystem.builder().description("foo os").build())
               .status(Image.Status.AVAILABLE).build();
      }
View Full Code Here

   @Override
   public Image apply(@Nullable VAppTemplate from) {
      if (from == null)
         return null;
      ImageBuilder builder = new ImageBuilder();
      builder.ids(from.getHref().toASCIIString());
      builder.uri(from.getHref());
      builder.name(from.getName());
      builder.location(findLocationForResource.apply(checkNotNull(parent, "parent")));
      builder.description(from.getDescription() != null ? from.getDescription() : from.getName());
      builder.operatingSystem(osParser.apply(from.getName()));
      builder.status(toPortableImageStatus.get(from.getStatus()));
      builder.defaultCredentials(credentialsProvider.apply(from));
      return builder.build();
   }
View Full Code Here

public class ImageToImageTest {

   @Test
   public void testConvertImage() {
      Image image = new Image(1, "Ubuntu 14.04 x64", "Ubuntu 14.04 x64", true, "ubuntu-1404-x86");
      org.jclouds.compute.domain.Image expected = new ImageBuilder()
            .id("ubuntu-1404-x86")
            .providerId("1")
            .name("Ubuntu 14.04 x64")
            .status(AVAILABLE)
            .operatingSystem(
View Full Code Here

   private DropletToNodeMetadata function;

   @BeforeMethod
   public void setup() {
      images = ImmutableSet.of(new ImageBuilder()
            .id("ubuntu-1404-x86")
            .providerId("1")
            .name("mock image")
            .status(AVAILABLE)
            .operatingSystem(
View Full Code Here

               // our group
               Set<? extends NodeMetadata> nodes = Sets.filter(input.listNodesDetailsMatching(NodePredicates.all()),
                        NodePredicates.inGroup(poolGroupPrefix));
               checkState(!nodes.isEmpty(), "service provided no template and no node was in this nodepool's group.");
               final NodeMetadata node = Iterables.get(nodes, 0);
               final Image image = new ImageBuilder().id(node.getId()).location(node.getLocation())
                        .operatingSystem(node.getOperatingSystem()).status(Status.AVAILABLE)
                        .description("physical node").build();
               final Hardware hardware = new HardwareBuilder().id(node.getId()).build();
               return new Template() {
View Full Code Here

@Singleton
public class ImageToImage implements Function<Image, org.jclouds.compute.domain.Image> {

   @Override
   public org.jclouds.compute.domain.Image apply(final Image input) {
      ImageBuilder builder = new ImageBuilder();
      // Private images don't have a slug
      builder.id(input.getSlug() != null ? input.getSlug() : String.valueOf(input.getId()));
      builder.providerId(String.valueOf(input.getId()));
      builder.name(input.getName());
      builder.description(input.getName());
      builder.status(Status.AVAILABLE);

      OperatingSystem os = input.getOs();

      builder.operatingSystem(builder()
            .name(input.getName())
            .family(os.getDistribution().getOsFamily())
            .description(input.getName())
            .arch(os.getArch())
            .version(os.getVersion())
            .is64Bit(os.is64bit())
            .build());

      ImmutableMap.Builder<String, String> metadata = ImmutableMap.builder();
      metadata.put("publicImage", String.valueOf(input.isPublicImage()));
      builder.userMetadata(metadata.build());

      return builder.build();
   }
View Full Code Here

              .family(osFamily)
              .version(osVersion)
              .is64Bit(is64bit(from))
              .build();

      return new ImageBuilder()
              .ids(from.getId())
              .name(get(Splitter.on(":").split(description), 0))
              .description(description)
              .operatingSystem(os)
              .status(Image.Status.AVAILABLE)
View Full Code Here

TOP

Related Classes of org.jclouds.compute.domain.ImageBuilder

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.