Package org.openstack.model.compute

Examples of org.openstack.model.compute.Flavor


          }
        }

        create.setImageRef(foundImage.getId());

        Flavor flavor = getClosestInstanceType(computeClient, request);
        if (flavor == null) {
          throw new OpsException("Cannot determine instance type for request");
        }
        create.setFlavorRef(flavor.getId());

        if (request.securityGroups != null) {
          // TODO: Reimplement if needed
          throw new UnsupportedOperationException();
        }
View Full Code Here


      }

      candidates.add(flavor);
    }

    Flavor bestFlavor = findCheapest(candidates);
    if (bestFlavor == null) {
      return null;
    }

    return bestFlavor;
View Full Code Here

    return bestFlavor;
  }

  private Flavor findCheapest(List<Flavor> candidates) {
    Flavor bestFlavor = null;
    float bestPrice = Float.MAX_VALUE;

    for (Flavor candidate : candidates) {
      float price = computePrice(candidate);
      if (price < bestPrice) {
View Full Code Here

TOP

Related Classes of org.openstack.model.compute.Flavor

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.