Examples of DiskImageRecipe


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

Examples of org.platformlayer.service.imagefactory.v1.DiskImageRecipe

        Tag tag = new Tag(Tag.CONDUCTOR_ID, managed.getConductorId());

        SshKey sshKey = service.getSshKey();

        DiskImageRecipe recipe = imageFactory.loadDiskImageResource(getClass(), "DiskImageRecipe.xml");
        String securityGroup = service.getSecurityGroupName();

        int minimumMemoryMB = 256; // Git isn't particularly memory intensive (?)
        Managed<PersistentInstance> foundPersistentInstance = persistentInstances.getOrCreate(tag, recipe, model.dnsName, sshKey.getName(), securityGroup, minimumMemoryMB);
View Full Code Here

Examples of org.platformlayer.service.imagefactory.v1.DiskImageRecipe

    @Inject
    PlatformLayerClient platformLayer;

    public void doOperation(Managed<GraphiteService> managed) throws OpsException {
        DiskImageRecipe recipe = imageFactory.loadDiskImageResource(getClass(), "DiskImageRecipe.xml");
        String imageId = imageFactory.getOrCreateImage(recipe);

        GraphiteService model = (GraphiteService) managed.getModel();
        PersistentInstance persistentInstance = new PersistentInstance();
        persistentInstance.setImageId(imageId);
View Full Code Here

Examples of org.platformlayer.service.imagefactory.v1.DiskImageRecipe

        SshKey sshKey = service.getSshKey();

        Tag tag = new Tag(Tag.CONDUCTOR_ID, key);

        DiskImageRecipe recipe = imageFactory.loadDiskImageResource(getClass(), "DiskImageRecipe.xml");
        String securityGroup = service.getSecurityGroupName();

        // TODO: This needs to be configurable. Use tags?
        int minimumMemoryMb = 2048;
        Managed<PersistentInstance> foundPersistentInstance = persistentInstances.getOrCreate(tag, recipe, managed.getModel().dnsName, sshKey.getName(), securityGroup, minimumMemoryMb);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.