当前位置: 首页>>代码示例>>Java>>正文


Java InstanceType.fromValue方法代码示例

本文整理汇总了Java中com.amazonaws.services.ec2.model.InstanceType.fromValue方法的典型用法代码示例。如果您正苦于以下问题:Java InstanceType.fromValue方法的具体用法?Java InstanceType.fromValue怎么用?Java InstanceType.fromValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.amazonaws.services.ec2.model.InstanceType的用法示例。


在下文中一共展示了InstanceType.fromValue方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getInstanceType

import com.amazonaws.services.ec2.model.InstanceType; //导入方法依赖的package包/类
/**
 * Get the size of the instance
 * 
 * @param size
 *            The size requested
 * @return The size assigned
 */
private static InstanceType getInstanceType(String size) {
    InstanceType output = InstanceType.C42xlarge;
    try {
        output = InstanceType.fromValue(size);
    } catch (Exception e) {
        LOG.warn("Error parsing vminstanceType " + size, e);
    }
    return output;
}
 
开发者ID:intuit,项目名称:Tank,代码行数:17,代码来源:AmazonInstance.java

示例2: validateMachineHasInstanceType

import com.amazonaws.services.ec2.model.InstanceType; //导入方法依赖的package包/类
private void validateMachineHasInstanceType(List<String> results, Machine machine) {
  if (StringUtils.isEmpty(machine.getInstanceType()))
    results.add(ERROR + "You must provide an instance type for the machine");
  else {
    String instanceType = machine.getInstanceType();

    try {
      InstanceType.fromValue(instanceType);
      results.add(SUCCESS + "Valid instance type");
    } catch (IllegalArgumentException e) {
      results.add(ERROR + "Unknown instance type");
    }
  }
}
 
开发者ID:tuhrig,项目名称:DeployMan,代码行数:15,代码来源:FormationValidator.java

示例3: validate

import com.amazonaws.services.ec2.model.InstanceType; //导入方法依赖的package包/类
/**
 * Performs basic validation of this configuration.
 *
 * @throws IllegalArgumentException
 */
public void validate() throws IllegalArgumentException {
    checkArgument(this.instanceType != null, "provisioningTemplate: missing instanceType");
    try {
        InstanceType.fromValue(this.instanceType);
    } catch (IllegalArgumentException e) {
        throw new IllegalArgumentException(
                String.format("provisioingTemplate: unrecognized instanceType: %s", this.instanceType));
    }

    checkArgument(this.amiId != null, "provisioningTemplate: missing amiId");
    checkArgument(this.subnetIds != null, "provisioningTemplate: missing subnetIds");
    checkArgument(!this.subnetIds.isEmpty(), "provisioningTemplate: at least one subnet id must be specified");
}
 
开发者ID:elastisys,项目名称:scale.cloudpool,代码行数:19,代码来源:Ec2ProvisioningTemplate.java

示例4: getInstanceType

import com.amazonaws.services.ec2.model.InstanceType; //导入方法依赖的package包/类
private InstanceType getInstanceType(IProperty[] macProps) {
    String instanceTypeString = Utils.getInstanceType(macProps, controllerServices);

    InstanceType instanceType = InstanceType.M1Small;
    try {
        instanceType = InstanceType.fromValue(instanceTypeString);
    } catch (IllegalArgumentException e) { //Should never occur
        logger.log(Level.INFO, "Invalid instance type. Using m1.small", e);
    }
    return instanceType;
}
 
开发者ID:Appdynamics,项目名称:aws-connector-extension,代码行数:12,代码来源:AWSConnector.java

示例5: getInstanceType

import com.amazonaws.services.ec2.model.InstanceType; //导入方法依赖的package包/类
/**
 * The name of the instance type to launch. For example, {@code m1.medium}.
 *
 * @return
 */
public InstanceType getInstanceType() {
    return InstanceType.fromValue(this.instanceType);
}
 
开发者ID:elastisys,项目名称:scale.cloudpool,代码行数:9,代码来源:Ec2ProvisioningTemplate.java


注:本文中的com.amazonaws.services.ec2.model.InstanceType.fromValue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。