Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseVirtualMachineNotFoundError ¶
BaseVirtualMachineNotFoundError is returned if a base virtual machine isn't found.
func (BaseVirtualMachineNotFoundError) Error ¶
func (e BaseVirtualMachineNotFoundError) Error() string
type Instance ¶
type Instance struct { ID string `db:"id"` IPAddresses []string State string CreatedAt time.Time `db:"created_at"` DestroyedAt pq.NullTime `db:"destroyed_at"` }
Instance is our representation of an instance woop woop
type InstanceConfig ¶ added in v1.1.0
type InstanceConfig struct { // Type is the type of data in the payload and is required to be "instances". // The endpoint for creating new instances will check this value for correctness. Type string `json:"type"` // BaseImage is the VM name of the image the new instance will be cloned from. BaseImage string `json:"base-image"` // CPUCount is the number of CPUs the new instance should have. // If CPUCount is 0, the number of CPUs will not be changed from what is configured // in the base image. CPUCount int `json:"cpus"` // RAM is the amount of RAM in MB that the new instance should have. // If RAM is 0, the amount of RAM will not be changed from what is configured in the // base image. RAM int `json:"ram"` }
InstanceConfig specifies how a new instance should be configured
func (InstanceConfig) ConfigSpec ¶ added in v1.1.0
func (c InstanceConfig) ConfigSpec() *types.VirtualMachineConfigSpec
ConfigSpec constructs a spec for reconfiguring the VM after it is cloned. ConfigSpec returns nil if none of the config parameters for the VM are set. In that case, no reconfigure task for the VM should be run.
func (InstanceConfig) Track ¶ added in v1.1.0
func (c InstanceConfig) Track(ctx context.Context)
Track adds fields to the current Honeycomb event with information about the VM config that was requested.
type InstanceManager ¶
type InstanceManager interface { Fetch(context.Context, string) (*Instance, error) List(context.Context) ([]*Instance, error) Start(context.Context, InstanceConfig) (*Instance, error) Terminate(context.Context, string) error }
InstanceManager is the interface used for managing instances wow!
func NewVSphereInstanceManager ¶
func NewVSphereInstanceManager(log *logrus.Logger, vSphereURL *url.URL, paths VSpherePaths, readConcurrency, createConcurrency, deleteConcurrency int) InstanceManager
NewVSphereInstanceManager creates a new instance manager backed by vSphere
type VSpherePaths ¶
type VSpherePaths struct { // BasePath is the path to a folder in which the base VMs that the // instance manager use to create VMs are. These VMs should have a // snapshot named "base", and new VMs will spin up from this snapshot. // The path should end with a slash. BasePath string // VMPath is the path to a folder in which VMs will be cloned into. Any // VM in this folder can be displayed and stopped with the instance // manager. The path should end with a slash. VMPath string // ClusterPath is the inventory path to a ClusterComputeResource that // is used as the resource pool for new VMs. ClusterPath string }
VSpherePaths holds some vSphere inventory paths that are required for the InstanceManager to function properly.
type VirtualMachineNotFoundError ¶
VirtualMachineNotFoundError is returned if a virtual machine isn't found.
func (VirtualMachineNotFoundError) Error ¶
func (e VirtualMachineNotFoundError) Error() string
Directories
¶
Path | Synopsis |
---|---|
cmd
|
|
Package metrics provides easy methods to send metrics
|
Package metrics provides easy methods to send metrics |
pkg
|
|
Package server contains an HTTP API server to interface with the Jupiter Brain API.
|
Package server contains an HTTP API server to interface with the Jupiter Brain API. |