Package org.platformlayer.images.model

Examples of org.platformlayer.images.model.DiskImage


    }
    return best;
  }

  public DiskImage getOrCreateImage(DiskImage template) throws OpsException {
    DiskImage best = null;

    try {
      for (DiskImage candidate : platformLayer.listItems(DiskImage.class)) {
        if (isMatch(candidate, template)) {
          best = candidate;
View Full Code Here


        }
      }
      throw new OpsException("Cannot find bootstrap image for format " + Joiner.on(",").join(formats));
    }

    DiskImage imageTemplate = new DiskImage();
    imageTemplate.setFormat(formats.get(0).name());
    imageTemplate.setRecipeId(recipeKey);
    String id = "image-" + recipeKey.getItemId().getKey();
    imageTemplate.setKey(PlatformLayerKey.fromId(id));

    PlatformLayerKey cloudKey = targetCloud.getModel().getKey();
    imageTemplate.setCloud(cloudKey);

    DiskImage image = getOrCreateImage(imageTemplate);
    return getImageInfo(image);
  }
View Full Code Here

  }

  private boolean isMatch(DiskImage a, DiskImage b) {
    // TODO: Don't be evil

    DiskImage aCopy = cloneThroughJaxb(a);
    DiskImage bCopy = cloneThroughJaxb(b);

    aCopy.setKey(null);
    bCopy.setKey(null);

    aCopy.tags = null;
    bCopy.tags = null;

    aCopy.version = 0;
View Full Code Here

TOP

Related Classes of org.platformlayer.images.model.DiskImage

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.