instances

package
v0.0.0-...-6337964 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 13, 2014 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CpuPower

func CpuPower(power uint64) *uint64

Types

type Image

type Image struct {
	Id   string
	Arch string
	// The type of virtualisation supported by this image.
	VirtType string
}

Image holds the attributes that vary amongst relevant images for a given series in a given region.

func ImageMetadataToImages

func ImageMetadataToImages(inputs []*imagemetadata.ImageMetadata) []Image

ImageMetadataToImages converts an array of ImageMetadata pointers (as returned by imagemetadata.Fetch) to an array of Image objects (as required by instances.FindInstanceSpec).

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
	// contains filtered or unexported fields
}

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
	RootDisk uint64
	// These attributes are not supported by all clouds.
	VirtType *string // The type of virtualisation used by the hypervisor, must match the image.
	CpuPower *uint64
	Tags     []string
}

InstanceType holds all relevant attributes of the various instance types.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL