com.norbl.cbp.ppe
Class Ec2InstanceType
java.lang.Object
com.norbl.cbp.ppe.Ec2InstanceType
- All Implemented Interfaces:
- TableModelRowable, java.io.Serializable
public class Ec2InstanceType
- extends java.lang.Object
- implements TableModelRowable, java.io.Serializable
Some descriptive information about ec2 instance types. This
class contains static functions for getting the list of
Ec2InstanceType
s from s3 (and putting them there).
- See Also:
- Serialized Form
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
instanceType
public com.amazonaws.services.ec2.model.InstanceType instanceType
vt
public Ec2InstanceType.VirtualizationType vt
nCores
public int nCores
ramGB
public double ramGB
clusterSupport
public boolean clusterSupport
pricePiph
public double pricePiph
description
public java.lang.String description
Ec2InstanceType
public Ec2InstanceType(com.amazonaws.services.ec2.model.InstanceType instanceType,
int nCores,
double ramGB,
boolean clusterSupport,
Ec2InstanceType.VirtualizationType vt,
double pricePiph,
java.lang.String description)
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
isPv
public boolean isPv()
isHvm
public boolean isHvm()
getDescription
public java.lang.String getDescription()
getInstanceType
public static com.amazonaws.services.ec2.model.InstanceType getInstanceType(java.lang.String instanceTypeName)
throws java.lang.IllegalArgumentException
- NOTE/WARNING: there is a bug in the aws implementation of
InstanceType.valueOf(java.lang.String)
.
It throws an exception on t1.micro even if it obtained from
InstanceType.values()
.toString(). They've added a kluge method
InstanceType.fromValue(java.lang.String)
that solves the problem.
That method is used in this function. All instance type translation should
be done with this method only.
- Parameters:
instanceTypeName
-
- Returns:
-
- Throws:
java.lang.IllegalArgumentException
getEc2InstanceType
public static Ec2InstanceType getEc2InstanceType(java.util.List<Ec2InstanceType> eits,
com.amazonaws.services.ec2.model.InstanceType iType)
throws java.io.FileNotFoundException,
java.io.IOException,
java.lang.NullPointerException
- Throws:
java.io.FileNotFoundException
java.io.IOException
java.lang.NullPointerException
isPv
public static boolean isPv(java.lang.String s)
- There may be an inconsistency in AWS's strings for virtualization
type. It may be that both 'pv' and 'paravitual' are used. So
isHvm
public static boolean isHvm(java.lang.String s)
getColumnClass
public java.lang.Class getColumnClass(int colIndex)
- Specified by:
getColumnClass
in interface TableModelRowable
getColumnName
public java.lang.String getColumnName(int colIndex)
- Specified by:
getColumnName
in interface TableModelRowable
getColumnValue
public java.lang.Object getColumnValue(int colIndex)
- Specified by:
getColumnValue
in interface TableModelRowable
getNColumns
public int getNColumns()
- Specified by:
getNColumns
in interface TableModelRowable
setColumnValue
public void setColumnValue(int colIndex,
java.lang.Object value)
- Specified by:
setColumnValue
in interface TableModelRowable
isFullySpecified
public boolean isFullySpecified()
getInstanceTypes
public static java.util.List<Ec2InstanceType> getInstanceTypes()
throws java.lang.Exception
- Retrieves the instance types from s3.
- Returns:
-
- Throws:
java.lang.Exception