Package org.platformlayer.images.model

Examples of org.platformlayer.images.model.DiskImageRecipe


  }

  private PersistentInstance buildPersistentInstanceTemplate() throws OpsException {
    SshKey sshKey = service.getSshKey();
    String securityGroup = service.getSecurityGroupName();
    DiskImageRecipe recipeTemplate = diskImageRecipe.get();
    if (recipeTemplate.getKey() == null) {
      // TODO: Something nicer than a UUID
      String recipeId = UUID.randomUUID().toString();
      recipeTemplate.setKey(PlatformLayerKey.fromId(recipeId));
    }

    DiskImageRecipe recipe = imageFactory.getOrCreateRecipe(recipeTemplate);

    PersistentInstance persistentInstanceTemplate = new PersistentInstance();

    persistentInstanceTemplate.setDnsName(dnsName);
    persistentInstanceTemplate.setSshPublicKey(SshKeys.serialize(sshKey.getKeyPair().getPublic()));
    persistentInstanceTemplate.setSecurityGroup(securityGroup);
    persistentInstanceTemplate.setMinimumRam(minimumMemoryMb);
    persistentInstanceTemplate.setCloud(cloud);
    persistentInstanceTemplate.setHostPolicy(hostPolicy);
    persistentInstanceTemplate.setRecipe(recipe.getKey());

    String id = dnsName;
    if (Strings.isNullOrEmpty(id)) {
      id = UUID.randomUUID().toString();
    }
View Full Code Here

TOP

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

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.