Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Image ¶
type Image struct { Id string Arch string // The type of virtualisation supported by this image. VType string }
Image holds the attributes that vary amongst relevant images for a given series in a given region.
type InstanceConstraint ¶
type InstanceConstraint struct { Region string Series string Arches []string Constraints constraints.Value // Optional filtering criteria not supported by all providers. These attributes are not specified // by the user as a constraint but rather passed in by the provider implementation to restrict the // choice of available images. Storage *string }
InstanceConstraint constrains the possible instances that may be chosen by the environment provider.
func (*InstanceConstraint) String ¶
func (ic *InstanceConstraint) String() string
String returns a human readable form of this InstanceConstaint.
type InstanceSpec ¶
type InstanceSpec struct { InstanceType InstanceType Image Image }
InstanceSpec holds an instance type name and the chosen image info.
func FindInstanceSpec ¶
func FindInstanceSpec(possibleImages []Image, ic *InstanceConstraint, allInstanceTypes []InstanceType) (*InstanceSpec, error)
FindInstanceSpec returns an InstanceSpec satisfying the supplied InstanceConstraint. possibleImages contains a list of images matching the InstanceConstraint. allInstanceTypes provides information on every known available instance type (name, memory, cpu cores etc) on which instances can be run. The InstanceConstraint is used to filter allInstanceTypes and then a suitable image compatible with the matching instance types is returned.
type InstanceType ¶
type InstanceType struct { Id string Name string Arches []string CpuCores uint64 Mem uint64 Cost uint64 // These attributes are not supported by all clouds. VType *string // The type of virtualisation used by the hypervisor, must match the image. CpuPower *uint64 }
InstanceType holds all relevant attributes of the various instance types.