Package org.jclouds.compute.domain

Examples of org.jclouds.compute.domain.Image


      return ImmutableSet.of(backendTemplate.get().getLocation());
   }

   @Override
   public Image getImage(String id) {
      Image backendImage = backendTemplate.get().getImage();
      return backendImage.getId().equals(id) ? backendImage : null;
   }
View Full Code Here


         builder.hardware(parseHardware(from.getServer().getType()));

         LoginCredentials.Builder credentialsBuilder = LoginCredentials
               .builder().password(from.getInitialPassword());

         Image image = parseImage(from.getServer());
         // image will not be found if server was created a while back and
         // the image has since been destroyed or discontinued (like an old
         // CentOS version)
         if (image != null) {

            builder.operatingSystem(image.getOperatingSystem());
            String user = image.getDefaultCredentials().getUser();
            credentialsBuilder.identity(user);
         }

         builder.credentials(credentialsBuilder.build());
View Full Code Here

      builder.ids(from.getUuid() + "");
      builder.name(from.getAlias());
      builder.location(from(locations.get()).firstMatch(LocationPredicates.idEquals(from.getUuid() + "")).orNull());
      builder.group(nodeNamingConvention.groupInUniqueNameOrNull(from.getType()));
      builder.imageId(from.getType() + "");
      Image image = from(images.get()).firstMatch(ImagePredicates.idEquals(from.getUuid() + "")).orNull();
      if (image != null)
         builder.operatingSystem(image.getOperatingSystem());
      builder.hardware(from(hardware.get()).firstMatch(HardwarePredicates.idEquals(from.getUuid() + "")).orNull());
      builder.status(serverStatusToNodeStatus.get(from.getState()));
      try {
         if (from.getState() == VM.State.RUNNING) {
            Optional<String> ip = from.getPublicAddress();
View Full Code Here

   @Test
   public void testWhenNoHardwareOrImageMatchImageIdIsStillSet() {

      Hardware existingHardware = new HardwareBuilder().id("us-sw-1/FOOOOOOOO").providerId("FOOOOOOOO").location(zone)
            .build();
      Image existingImage = new ImageBuilder().id("us-sw-1/FOOOOOOOO")
            .operatingSystem(OperatingSystem.builder().family(OsFamily.LINUX).description("foobuntu").build())
            .providerId("FOOOOOOOO").description("foobuntu").location(zone).status(Image.Status.AVAILABLE).build();

      checkHardwareAndImageStatus(null, existingHardware, "us-sw-1/sdc:sdc:centos-5.7:1.2.1", null, existingImage);
   }
View Full Code Here

   @Test
   public void testWhenHardwareAndImageMatchHardwareOperatingSystemAndImageIdAreSet() {

      Hardware existingHardware = new HardwareBuilder().id("us-sw-1/Small 1GB").providerId("Small 1GB").ram(1024)
            .volume(new VolumeImpl(Float.valueOf(61440), true, true)).location(zone).build();
      Image existingImage = new ImageBuilder().id("us-sw-1/sdc:sdc:centos-5.7:1.2.1")
            .operatingSystem(OperatingSystem.builder().family(OsFamily.LINUX).description("foobuntu").build())
            .providerId("sdc:sdc:centos-5.7:1.2.1").description("foobuntu").status(Image.Status.AVAILABLE)
            .location(zone).build();

      checkHardwareAndImageStatus(existingHardware, existingHardware, existingImage.getId(),
            existingImage.getOperatingSystem(), existingImage);
   }
View Full Code Here

         }
      }).orNull();
   }

   protected OperatingSystem findOperatingSystemForMachineOrNull(MachineInDatacenter machineInDatacenter) {
      Image image = findObjectOfTypeForMachineOrNull(images.get(), "image", machineInDatacenter.get()
            .getDatasetURN(), machineInDatacenter);
      return (image != null) ? image.getOperatingSystem() : null;
   }
View Full Code Here

   }

   @Override
   public synchronized Master getIfPresent(Object key) {
      checkArgument(key instanceof Image, "this cache is for entries who's keys are Images");
      Image image = Image.class.cast(key);
      if (masters.containsKey(image.getId())) {
         return masters.get(image.getId());
      }
      return null;
   }
View Full Code Here

         return null;
      }
      ImageExtension imageExtension = service.getImageExtension().get();
      ImageTemplate imageTemplate = imageExtension.buildImageTemplateFromNode(imageName, id);
      ListenableFuture<Image> imageFuture = imageExtension.createImage(imageTemplate);
      Image image = imageFuture.get();
      System.out.println("Successfully created image:" + image.getId());
      return null;
   }
View Full Code Here

   }

   @Override
   public NodeMetadata apply(Instance input) {
      Map<URI, ? extends Image> imagesMap = images.get();
      Image image = checkNotNull(imagesMap.get(checkNotNull(input.getImage(), "image")),
              "no image for %s. images: %s", input.getImage(), imagesMap.values());

      return new NodeMetadataBuilder()
              .id(input.getName())
              .name(input.getName())
              .providerId(input.getId())
              .hostname(input.getName())
              .imageId(image.getId())
              .location(checkNotNull(locations.get().get(input.getZone()), "location for %s", input.getZone()))
              .hardware(checkNotNull(hardwares.get().get(input.getMachineType()), "hardware type for %s",
                      input.getMachineType().toString()))
              .operatingSystem(image.getOperatingSystem())
              .status(toPortableNodeStatus.get(input.getStatus()))
              .tags(input.getTags())
              .uri(input.getSelfLink())
              .userMetadata(input.getMetadata())
              .group(nodeNamingConvention.groupInUniqueNameOrNull(input.getName()))
View Full Code Here

   @Test
   public void testWhenNoHardwareOrImageMatchServerScopedIdsImageIdIsStillSet() {

      Hardware existingHardware = new HardwareBuilder().id("az-1.region-a.geo-1/FOOOOOOOO").providerId("FOOOOOOOO")
            .location(zone).build();
      Image existingImage = new ImageBuilder().id("az-1.region-a.geo-1/FOOOOOOOO")
            .operatingSystem(OperatingSystem.builder().family(OsFamily.LINUX).description("foobuntu").build())
            .providerId("FOOOOOOOO").description("foobuntu").location(zone).status(Image.Status.AVAILABLE).build();

      checkHardwareAndImageStatus(null, existingHardware, "az-1.region-a.geo-1/52415800-8b69-11e0-9b19-734f6f006e54",
            null, existingImage);
View Full Code Here

TOP

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

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.