Package org.platformlayer.ops.images

Examples of org.platformlayer.ops.images.ImageStore


      // Check for existing image

      MachineProvider targetCloud = cloudHelpers.getCloud(image.cloud);
      DiskImageRecipe recipe = platformLayer.getItem(image.recipeId, DiskImageRecipe.class);

      ImageStore imageStore = cloud.getImageStore(targetCloud);

      List<CloudImage> existingImages = imageStore.findImages(Collections.<Tag> emptyList());

      for (CloudImage existingImage : existingImages) {
        // TODO: Fetch the parent, fetch the description, see if it's a match??
        log.info("Image found, but not know whether we can re-use: " + existingImage);
      }
View Full Code Here


    if (target.getFilesystemInfoFile(imageFile) == null) {
      DirectCloud cloud = OpsContext.get().getInstance(DirectCloud.class);
      if (cloud == null) {
        throw new IllegalStateException("Cloud instance not found");
      }
      ImageStore imageStore = cloudHelpers.getImageStore(cloud);
      MachineProvider machineProvider = providers.toInterface(cloud, MachineProvider.class);
      CloudImage imageInfo = imageFactory.getOrCreateImageId(machineProvider, imageFormats, recipeKey);

      if (imageStore == null) {
        throw new OpsException("Image store not configured");
      }

      String fileName = imageInfo.getId() + ".image." + imageInfo.getFormat().name();

      // TODO: We don't need rawImage; delete or just request a read-only version
      File rawImage = new File(IMAGES_DIR, fileName);
      target.mkdir(IMAGES_DIR);
      // TODO: Caching / reuse ... need to check md5 though
      imageStore.bringToMachine(imageInfo.getId(), target, rawImage);

      ImageFormat imageFormat = imageInfo.getFormat();
      switch (imageFormat) {
      case Tar: {
        target.mkdir(imageFile);
View Full Code Here

    return getImageStore(providers.toInterface(item, MachineProvider.class));
  }

  public ImageStore getGenericImageStore() throws OpsException {
    for (ProviderOf<ImageStoreProvider> p : providers.listItemsProviding(ImageStoreProvider.class)) {
      ImageStore imageStore = p.get().getImageStore();

      if (imageStore != null) {
        return imageStore;
      }
    }
View Full Code Here

    log.warn("Validate stub-implemented for PlatformCloudContext");
  }

  @Override
  public ImageStore getImageStore(MachineProvider targetCloud) throws OpsException {
    ImageStore imageStore = cloudHelpers.getImageStore(targetCloud);
    // UserInfo userInfo = OpsContext.get().getUserInfo();
    // URL url = new URL(userInfo.getConfig().getRequiredString("image.url"));
    // String protocol = "ssh://";
    // if (!protocol.equals(url.getProtocol())) {
    // throw new OpsException("Expected SSH protocol for image store");
View Full Code Here

TOP

Related Classes of org.platformlayer.ops.images.ImageStore

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.