types

package
v0.0.0-...-fe7098b Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckDirectory

func CheckDirectory(dir string) error

CheckDirectory checks to see if a given absolute path exists and is a directory.

Types

type CreateArgs

type CreateArgs struct {
	Name         string
	WorkloadName string
	Debug        bool
	Update       bool
	CustomSpec   VMSpec
	HTTPProxy    string
	HTTPSProxy   string
	NoProxy      string
	GoPath       string
	Kernel       string
	KernelArgs   string
	QEMUPath     string
	CPU          string
}

CreateArgs contains all the information necessary to create a new ccloudvm instance.

type CreateResult

type CreateResult struct {
	Name     string
	Finished bool
	Line     string
}

CreateResult contains information about the status of an instance creation request. It has two fields. Finished, if true, indicates that the creation request has finished and Line containing a lines of output.

type Drive

type Drive struct {
	Path    string
	Format  string
	Options string
}

Drive contains information about additional drives to mount in the guest

func (Drive) String

func (d Drive) String() string

type InstanceDetails

type InstanceDetails struct {
	Name     string
	SSH      SSHDetails
	Workload string
	VMSpec   VMSpec
}

InstanceDetails contains information about an instance

type Mount

type Mount struct {
	Tag           string `yaml:"tag"`
	SecurityModel string `yaml:"security_model"`
	Path          string `yaml:"path"`
}

Mount contains information about a host path to be mounted inside the guest

func (Mount) String

func (m Mount) String() string

type PortMapping

type PortMapping struct {
	Host  int `yaml:"host"`
	Guest int `yaml:"guest"`
}

PortMapping exposes a guest resident service on the host

func (PortMapping) String

func (p PortMapping) String() string

type SSHDetails

type SSHDetails struct {
	KeyPath string
	Port    int
}

SSHDetails contains SSH connection information for an instance

type StartArgs

type StartArgs struct {
	Name   string
	VMSpec VMSpec
}

StartArgs contain all the information needed to start a stopped instance.

type VMSpec

type VMSpec struct {
	MemMiB       int           `yaml:"mem_mib"`
	DiskGiB      int           `yaml:"disk_gib"`
	CPUs         int           `yaml:"cpus"`
	PortMappings []PortMapping `yaml:"ports"`
	Mounts       []Mount       `yaml:"mounts"`
	Drives       []Drive       `yaml:"drives"`
	Qemuport     uint          `yaml:"qemuport"`
	HostIP       net.IP        `yaml:"host_ip"`
}

VMSpec holds the per-VM state.

func (*VMSpec) Merge

func (in *VMSpec) Merge(parent *VMSpec)

Merge from a parent spec into the current spec

func (*VMSpec) MergeCustom

func (in *VMSpec) MergeCustom(customSpec *VMSpec) error

MergeCustom merges one VMSpec into another. In addition to merging mounts, drives and ports, other fields in the receiver VM spec, such as MemMiB, are also updated, with values provided by the customSpec parameter, if they are not already defined.

func (*VMSpec) MergeDrives

func (in *VMSpec) MergeDrives(d []Drive)

MergeDrives merges a slice of drives into an existing VMSpec. Drives supplied in the d parameter override existing drives in the VMSpec.

func (*VMSpec) MergeMounts

func (in *VMSpec) MergeMounts(m []Mount)

MergeMounts merges a slice of mounts into an existing VMSpec. Mounts supplied in the m parameter override existing mounts in the VMSpec.

func (*VMSpec) MergePorts

func (in *VMSpec) MergePorts(p []PortMapping)

MergePorts merges a slice of ports into an existing VMSpec. Ports supplied in the p parameter override existing ports in the VMSpec.

func (*VMSpec) SSHPort

func (in *VMSpec) SSHPort() (int, error)

SSHPort returns the port on the host which can be used to access the instance described by the VMSpec.

Jump to

Keyboard shortcuts

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