Package com.google.api.services.compute.model

Examples of com.google.api.services.compute.model.MachineType


          metadata.getItems().add(meta);
        }

        create.setImage(foundImage.getSelfLink());

        MachineType flavor = getClosestInstanceType(request);
        if (flavor == null) {
          throw new OpsException("Cannot determine machine type for request");
        }
        create.setMachineType(flavor.getSelfLink());

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


      }

      candidates.add(flavor);
    }

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

    return bestFlavor;
View Full Code Here

    return bestFlavor;
  }

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

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

TOP

Related Classes of com.google.api.services.compute.model.MachineType

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.