hypervisor

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2023 License: Apache-2.0 Imports: 9 Imported by: 72

Documentation

Index

Constants

View Source
const (
	ConsoleNone  = 0
	ConsoleDummy = 1
	ConsoleVNC   = 2

	StateStarting      = 0
	StateRunning       = 1
	StateFailedToStart = 2
	StateStopping      = 3
	StateStopped       = 4
	StateDestroying    = 5
	StateMigrating     = 6
	StateExporting     = 7
	StateCrashed       = 8
	StateDebugging     = 9

	VolumeFormatRaw   = 0
	VolumeFormatQCOW2 = 1

	VolumeTypePersistent = 0
	VolumeTypeMemory     = 1
)

Variables

This section is empty.

Functions

func CompareIPs

func CompareIPs(left, right net.IP) bool

CompareIP returns true if the two IPs are equivalent, else false.

func IpListsEqual

func IpListsEqual(left, right []net.IP) bool

func ShrinkIP

func ShrinkIP(netIP net.IP) net.IP

Types

type AcknowledgeVmRequest

type AcknowledgeVmRequest struct {
	IpAddress net.IP
}

type AcknowledgeVmResponse

type AcknowledgeVmResponse struct {
	Error string
}

type AddVmVolumesRequest

type AddVmVolumesRequest struct {
	IpAddress   net.IP
	VolumeSizes []uint64
}

type AddVmVolumesResponse

type AddVmVolumesResponse struct {
	Error string
}

type Address

type Address struct {
	IpAddress  net.IP `json:",omitempty"`
	MacAddress string
}

func (*Address) Equal

func (left *Address) Equal(right *Address) bool

func (*Address) Set

func (address *Address) Set(value string) error

func (*Address) Shrink

func (address *Address) Shrink()

func (*Address) String

func (address *Address) String() string

type AddressList

type AddressList []Address

func (*AddressList) Set

func (al *AddressList) Set(value string) error

func (*AddressList) String

func (al *AddressList) String() string

type BecomePrimaryVmOwnerRequest

type BecomePrimaryVmOwnerRequest struct {
	IpAddress net.IP
}

type BecomePrimaryVmOwnerResponse

type BecomePrimaryVmOwnerResponse struct {
	Error string
}

type ChangeAddressPoolRequest

type ChangeAddressPoolRequest struct {
	AddressesToAdd       []Address       // Will be added to free pool.
	AddressesToRemove    []Address       // Will be removed from free pool.
	MaximumFreeAddresses map[string]uint // Key: subnet ID.
}

type ChangeAddressPoolResponse

type ChangeAddressPoolResponse struct {
	Error string
}

type ChangeOwnersRequest

type ChangeOwnersRequest struct {
	OwnerGroups []string `json:",omitempty"`
	OwnerUsers  []string `json:",omitempty"`
}

type ChangeOwnersResponse

type ChangeOwnersResponse struct {
	Error string
}

type ChangeVmConsoleTypeRequest

type ChangeVmConsoleTypeRequest struct {
	ConsoleType ConsoleType
	IpAddress   net.IP
}

type ChangeVmConsoleTypeResponse

type ChangeVmConsoleTypeResponse struct {
	Error string
}

type ChangeVmDestroyProtectionRequest

type ChangeVmDestroyProtectionRequest struct {
	DestroyProtection bool
	IpAddress         net.IP
}

type ChangeVmDestroyProtectionResponse

type ChangeVmDestroyProtectionResponse struct {
	Error string
}

type ChangeVmOwnerUsersRequest

type ChangeVmOwnerUsersRequest struct {
	IpAddress  net.IP
	OwnerUsers []string
}

type ChangeVmOwnerUsersResponse

type ChangeVmOwnerUsersResponse struct {
	Error string
}

type ChangeVmSizeRequest

type ChangeVmSizeRequest struct {
	IpAddress   net.IP
	MemoryInMiB uint64
	MilliCPUs   uint
	VirtualCPUs uint
}

type ChangeVmSizeResponse

type ChangeVmSizeResponse struct {
	Error string
}

type ChangeVmTagsRequest

type ChangeVmTagsRequest struct {
	IpAddress net.IP
	Tags      tags.Tags
}

type ChangeVmTagsResponse

type ChangeVmTagsResponse struct {
	Error string
}

type ChangeVmVolumeSizeRequest added in v0.3.2

type ChangeVmVolumeSizeRequest struct {
	IpAddress   net.IP
	VolumeIndex uint
	VolumeSize  uint64
}

type ChangeVmVolumeSizeResponse added in v0.3.2

type ChangeVmVolumeSizeResponse struct {
	Error string
}

type CommitImportedVmRequest

type CommitImportedVmRequest struct {
	IpAddress net.IP
}

type CommitImportedVmResponse

type CommitImportedVmResponse struct {
	Error string
}

type ConnectToVmConsoleRequest

type ConnectToVmConsoleRequest struct {
	IpAddress net.IP
}

The ConnectToVmConsole RPC is fully streamed. After the request/response, the connection/client is hijacked and each side of the connection will send a stream of bytes.

type ConnectToVmConsoleResponse

type ConnectToVmConsoleResponse struct {
	Error string
}

type ConnectToVmManagerRequest added in v0.3.3

type ConnectToVmManagerRequest struct {
	IpAddress net.IP
}

The ConnectToVmManger RPC is fully streamed. After the request/response, the connection/client is hijacked and each side of the connection will send a stream of bytes.

type ConnectToVmManagerResponse added in v0.3.3

type ConnectToVmManagerResponse struct {
	Error string
}

type ConnectToVmSerialPortRequest

type ConnectToVmSerialPortRequest struct {
	IpAddress  net.IP
	PortNumber uint
}

The ConnectToVmSerialPort RPC is fully streamed. After the request/response, the connection/client is hijacked and each side of the connection will send a stream of bytes.

type ConnectToVmSerialPortResponse

type ConnectToVmSerialPortResponse struct {
	Error string
}

type ConsoleType

type ConsoleType uint

func (*ConsoleType) CheckValid

func (consoleType *ConsoleType) CheckValid() error

func (ConsoleType) MarshalText

func (consoleType ConsoleType) MarshalText() ([]byte, error)

func (*ConsoleType) Set

func (consoleType *ConsoleType) Set(value string) error

func (ConsoleType) String

func (consoleType ConsoleType) String() string

func (*ConsoleType) UnmarshalText

func (consoleType *ConsoleType) UnmarshalText(text []byte) error

type CopyVmRequest

type CopyVmRequest struct {
	AccessToken      []byte
	IpAddress        net.IP
	SkipMemoryCheck  bool
	SourceHypervisor string
	VmInfo
}

type CopyVmResponse

type CopyVmResponse struct {
	Error           string
	Final           bool // If true, this is the final response.
	IpAddress       net.IP
	ProgressMessage string
}

type CreateVmRequest

type CreateVmRequest struct {
	DhcpTimeout          time.Duration // <0: no DHCP; 0: no wait; >0 DHPC wait.
	DoNotStart           bool
	EnableNetboot        bool
	IdentityCertificate  []byte // PEM encoded.
	IdentityKey          []byte // PEM encoded.
	ImageDataSize        uint64
	ImageTimeout         time.Duration
	MinimumFreeBytes     uint64
	OverlayDirectories   []string
	OverlayFiles         map[string][]byte
	RoundupPower         uint64
	SecondaryVolumes     []Volume
	SecondaryVolumesData bool // Exclusive of SecondaryVolumesInit.
	SecondaryVolumesInit []VolumeInitialisationInfo
	SkipBootloader       bool
	SkipMemoryCheck      bool
	UserDataSize         uint64
	VmInfo

} // The following data are streamed afterwards in the following order:

type CreateVmResponse

type CreateVmResponse struct {
	DhcpTimedOut    bool
	Final           bool // If true, this is the final response.
	IpAddress       net.IP
	ProgressMessage string
	Error           string
}

type DebugVmImageRequest added in v0.3.2

type DebugVmImageRequest struct {
	DhcpTimeout      time.Duration // <0: no DHCP; 0: no wait; >0 DHPC wait.
	ImageDataSize    uint64
	ImageName        string
	ImageTimeout     time.Duration
	ImageURL         string
	IpAddress        net.IP
	MinimumFreeBytes uint64
	OverlayFiles     map[string][]byte
	RoundupPower     uint64

} // The following data are streamed afterwards in the following order:

type DebugVmImageResponse added in v0.3.2

type DebugVmImageResponse struct {
	DhcpTimedOut    bool
	Final           bool // If true, this is the final response.
	ProgressMessage string
	Error           string
}

type DeleteVmVolumeRequest

type DeleteVmVolumeRequest struct {
	AccessToken []byte
	IpAddress   net.IP
	VolumeIndex uint
}

type DeleteVmVolumeResponse

type DeleteVmVolumeResponse struct {
	Error string
}

type DestroyVmRequest

type DestroyVmRequest struct {
	AccessToken []byte
	IpAddress   net.IP
}

type DestroyVmResponse

type DestroyVmResponse struct {
	Error string
}

type DiscardVmAccessTokenRequest

type DiscardVmAccessTokenRequest struct {
	AccessToken []byte
	IpAddress   net.IP
}

type DiscardVmAccessTokenResponse

type DiscardVmAccessTokenResponse struct {
	Error string
}

type DiscardVmOldImageRequest

type DiscardVmOldImageRequest struct {
	IpAddress net.IP
}

type DiscardVmOldImageResponse

type DiscardVmOldImageResponse struct {
	Error string
}

type DiscardVmOldUserDataRequest

type DiscardVmOldUserDataRequest struct {
	IpAddress net.IP
}

type DiscardVmOldUserDataResponse

type DiscardVmOldUserDataResponse struct {
	Error string
}

type DiscardVmSnapshotRequest

type DiscardVmSnapshotRequest struct {
	IpAddress net.IP
}

type DiscardVmSnapshotResponse

type DiscardVmSnapshotResponse struct {
	Error string
}

type ExportLocalVmInfo

type ExportLocalVmInfo struct {
	Bridges []string
	LocalVmInfo
}

type ExportLocalVmRequest

type ExportLocalVmRequest struct {
	IpAddress          net.IP
	VerificationCookie []byte `json:",omitempty"`
}

type ExportLocalVmResponse

type ExportLocalVmResponse struct {
	Error  string
	VmInfo ExportLocalVmInfo
}

type GetRootCookiePathRequest

type GetRootCookiePathRequest struct{}

type GetRootCookiePathResponse

type GetRootCookiePathResponse struct {
	Error string
	Path  string
}

type GetUpdatesRequest

type GetUpdatesRequest struct {
	RegisterExternalLeasesRequest *RegisterExternalLeasesRequest
}

type GetVmAccessTokenRequest

type GetVmAccessTokenRequest struct {
	IpAddress net.IP
	Lifetime  time.Duration
}

type GetVmAccessTokenResponse

type GetVmAccessTokenResponse struct {
	Token []byte `json:",omitempty"`
	Error string
}

type GetVmInfoRequest

type GetVmInfoRequest struct {
	IpAddress net.IP
}

type GetVmInfoResponse

type GetVmInfoResponse struct {
	VmInfo VmInfo
	Error  string
}

type GetVmUserDataRequest

type GetVmUserDataRequest struct {
	AccessToken []byte
	IpAddress   net.IP
}

type GetVmUserDataResponse

type GetVmUserDataResponse struct {
	Error  string
	Length uint64

} // Data (length=Length) are streamed afterwards.

type GetVmVolumeRequest

type GetVmVolumeRequest struct {
	AccessToken      []byte
	GetExtraFiles    bool
	IgnoreExtraFiles bool
	IpAddress        net.IP
	VolumeIndex      uint
}

type GetVmVolumeResponse

type GetVmVolumeResponse struct {
	Error      string
	ExtraFiles map[string][]byte // May contain "kernel", "initrd" and such.
}

type HoldLockRequest added in v0.3.3

type HoldLockRequest struct {
	Timeout   time.Duration
	WriteLock bool
}

type HoldLockResponse added in v0.3.3

type HoldLockResponse struct {
	Error string
}

type HoldVmLockRequest added in v0.3.3

type HoldVmLockRequest struct {
	IpAddress net.IP
	Timeout   time.Duration
	WriteLock bool
}

type HoldVmLockResponse added in v0.3.3

type HoldVmLockResponse struct {
	Error string
}

type ImportLocalVmRequest

type ImportLocalVmRequest struct {
	SkipMemoryCheck    bool
	VerificationCookie []byte `json:",omitempty"`
	VmInfo
	VolumeFilenames []string
}

type ImportLocalVmResponse

type ImportLocalVmResponse struct {
	Error string
}

type ListSubnetsRequest

type ListSubnetsRequest struct {
	Sort bool
}

type ListSubnetsResponse

type ListSubnetsResponse struct {
	Error   string
	Subnets []Subnet `json:",omitempty"`
}

type ListVMsRequest

type ListVMsRequest struct {
	IgnoreStateMask uint64
	OwnerGroups     []string
	OwnerUsers      []string
	Sort            bool
	VmTagsToMatch   tags.MatchTags // Empty: match all tags.
}

type ListVMsResponse

type ListVMsResponse struct {
	IpAddresses []net.IP
}

type ListVolumeDirectoriesRequest

type ListVolumeDirectoriesRequest struct{}

type ListVolumeDirectoriesResponse

type ListVolumeDirectoriesResponse struct {
	Directories []string
	Error       string
}

type LocalVmInfo

type LocalVmInfo struct {
	VmInfo
	VolumeLocations []LocalVolume
}

type LocalVolume

type LocalVolume struct {
	DirectoryToCleanup string
	Filename           string
}

type MigrateVmRequest

type MigrateVmRequest struct {
	AccessToken      []byte
	DhcpTimeout      time.Duration
	IpAddress        net.IP
	SkipMemoryCheck  bool
	SourceHypervisor string
}

type MigrateVmResponse

type MigrateVmResponse struct {
	Error           string
	Final           bool // If true, this is the final response.
	ProgressMessage string
	RequestCommit   bool
}

type MigrateVmResponseResponse

type MigrateVmResponseResponse struct {
	Commit bool
}

type NetbootMachineRequest

type NetbootMachineRequest struct {
	Address                      Address
	Files                        map[string][]byte
	FilesExpiration              time.Duration
	Hostname                     string
	NumAcknowledgementsToWaitFor uint
	OfferExpiration              time.Duration
	Subnet                       *Subnet
	WaitTimeout                  time.Duration
}

type NetbootMachineResponse

type NetbootMachineResponse struct {
	Error string
}

type PatchVmImageRequest

type PatchVmImageRequest struct {
	ImageName    string
	ImageTimeout time.Duration
	IpAddress    net.IP
}

type PatchVmImageResponse

type PatchVmImageResponse struct {
	Final           bool // If true, this is the final response.
	ProgressMessage string
	Error           string
}

type PowerOffRequest

type PowerOffRequest struct {
	StopVMs bool // true: attempt to stop VMs; false: running VMs block poweroff
}

type PowerOffResponse

type PowerOffResponse struct {
	Error string
}

type PrepareVmForMigrationRequest

type PrepareVmForMigrationRequest struct {
	AccessToken []byte
	Enable      bool
	IpAddress   net.IP
}

type PrepareVmForMigrationResponse

type PrepareVmForMigrationResponse struct {
	Error string
}

type ProbeVmPortRequest

type ProbeVmPortRequest struct {
	IpAddress  net.IP
	PortNumber uint
	Timeout    time.Duration
}

type ProbeVmPortResponse

type ProbeVmPortResponse struct {
	PortIsOpen bool
	Error      string
}

type RebootVmRequest added in v0.3.2

type RebootVmRequest struct {
	DhcpTimeout time.Duration
	IpAddress   net.IP
}

type RebootVmResponse added in v0.3.2

type RebootVmResponse struct {
	DhcpTimedOut bool
	Error        string
}

type RegisterExternalLeasesRequest

type RegisterExternalLeasesRequest struct {
	Addresses AddressList
	Hostnames []string `json:",omitempty"`
}

type RegisterExternalLeasesResponse

type RegisterExternalLeasesResponse struct {
	Error string
}

type ReorderVmVolumesRequest added in v0.3.2

type ReorderVmVolumesRequest struct {
	AccessToken   []byte
	IpAddress     net.IP
	VolumeIndices []uint
}

type ReorderVmVolumesResponse added in v0.3.2

type ReorderVmVolumesResponse struct {
	Error string
}

type ReplaceVmCredentialsRequest added in v0.3.3

type ReplaceVmCredentialsRequest struct {
	IdentityCertificate []byte // PEM encoded.
	IdentityKey         []byte // PEM encoded.
	IpAddress           net.IP
}

type ReplaceVmCredentialsResponse added in v0.3.3

type ReplaceVmCredentialsResponse struct {
	Error string
}

type ReplaceVmImageRequest

type ReplaceVmImageRequest struct {
	DhcpTimeout      time.Duration
	ImageDataSize    uint64
	ImageName        string `json:",omitempty"`
	ImageTimeout     time.Duration
	ImageURL         string `json:",omitempty"`
	IpAddress        net.IP
	MinimumFreeBytes uint64
	OverlayFiles     map[string][]byte
	RoundupPower     uint64
	SkipBootloader   bool

} // RAW image data (length=ImageDataSize) is streamed afterwards.

type ReplaceVmImageResponse

type ReplaceVmImageResponse struct {
	DhcpTimedOut    bool
	Final           bool // If true, this is the final response.
	ProgressMessage string
	Error           string
}

type ReplaceVmUserDataRequest

type ReplaceVmUserDataRequest struct {
	IpAddress net.IP
	Size      uint64

} // User data (length=Size) are streamed afterwards.

type ReplaceVmUserDataResponse

type ReplaceVmUserDataResponse struct {
	Error string
}

type RestoreVmFromSnapshotRequest

type RestoreVmFromSnapshotRequest struct {
	IpAddress         net.IP
	ForceIfNotStopped bool
}

type RestoreVmFromSnapshotResponse

type RestoreVmFromSnapshotResponse struct {
	Error string
}

type RestoreVmImageRequest

type RestoreVmImageRequest struct {
	IpAddress net.IP
}

type RestoreVmImageResponse

type RestoreVmImageResponse struct {
	Error string
}

type RestoreVmUserDataRequest

type RestoreVmUserDataRequest struct {
	IpAddress net.IP
}

type RestoreVmUserDataResponse

type RestoreVmUserDataResponse struct {
	Error string
}

type ScanVmRootRequest

type ScanVmRootRequest struct {
	IpAddress net.IP
	Filter    *filter.Filter
}

type ScanVmRootResponse

type ScanVmRootResponse struct {
	Error      string
	FileSystem *filesystem.FileSystem
}

type SetDisabledStateRequest added in v0.3.3

type SetDisabledStateRequest struct {
	Disable bool
}

type SetDisabledStateResponse added in v0.3.3

type SetDisabledStateResponse struct {
	Error string
}

type SnapshotVmRequest

type SnapshotVmRequest struct {
	IpAddress         net.IP
	ForceIfNotStopped bool
	RootOnly          bool
}

type SnapshotVmResponse

type SnapshotVmResponse struct {
	Error string
}

type StartVmRequest

type StartVmRequest struct {
	AccessToken []byte
	DhcpTimeout time.Duration
	IpAddress   net.IP
}

type StartVmResponse

type StartVmResponse struct {
	DhcpTimedOut bool
	Error        string
}

type State

type State uint

func (State) MarshalText

func (state State) MarshalText() ([]byte, error)

func (State) String

func (state State) String() string

func (*State) UnmarshalText

func (state *State) UnmarshalText(text []byte) error

type StopVmRequest

type StopVmRequest struct {
	AccessToken []byte
	IpAddress   net.IP
}

type StopVmResponse

type StopVmResponse struct {
	Error string
}

type Subnet

type Subnet struct {
	Id                string
	IpGateway         net.IP
	IpMask            net.IP // net.IPMask can't be JSON {en,de}coded.
	DomainName        string `json:",omitempty"`
	DomainNameServers []net.IP
	DisableMetadata   bool     `json:",omitempty"`
	Manage            bool     `json:",omitempty"`
	VlanId            uint     `json:",omitempty"`
	AllowedGroups     []string `json:",omitempty"`
	AllowedUsers      []string `json:",omitempty"`
	FirstDynamicIP    net.IP   `json:",omitempty"`
	LastDynamicIP     net.IP   `json:",omitempty"`
}

func (*Subnet) Equal

func (left *Subnet) Equal(right *Subnet) bool

func (*Subnet) Shrink

func (subnet *Subnet) Shrink()

type TraceVmMetadataRequest

type TraceVmMetadataRequest struct {
	IpAddress net.IP
}

type TraceVmMetadataResponse

type TraceVmMetadataResponse struct {
	Error string

} // A stream of strings (trace paths) follow.

type Update

type Update struct {
	HaveAddressPool  bool               `json:",omitempty"`
	AddressPool      []Address          `json:",omitempty"` // Used & free.
	HaveDisabled     bool               `json:",omitempty"`
	Disabled         bool               `json:",omitempty"`
	MemoryInMiB      *uint64            `json:",omitempty"`
	NumCPUs          *uint              `json:",omitempty"`
	NumFreeAddresses map[string]uint    `json:",omitempty"` // Key: subnet ID.
	HealthStatus     string             `json:",omitempty"`
	HaveSerialNumber bool               `json:",omitempty"`
	SerialNumber     string             `json:",omitempty"`
	HaveSubnets      bool               `json:",omitempty"`
	Subnets          []Subnet           `json:",omitempty"`
	TotalVolumeBytes *uint64            `json:",omitempty"`
	HaveVMs          bool               `json:",omitempty"`
	VMs              map[string]*VmInfo `json:",omitempty"` // Key: IP address.
}

type UpdateSubnetsRequest

type UpdateSubnetsRequest struct {
	Add    []Subnet
	Change []Subnet
	Delete []string
}

type UpdateSubnetsResponse

type UpdateSubnetsResponse struct {
	Error string
}

type VmInfo

type VmInfo struct {
	Address            Address
	ChangedStateOn     time.Time   `json:",omitempty"`
	ConsoleType        ConsoleType `json:",omitempty"`
	CreatedOn          time.Time   `json:",omitempty"`
	DestroyOnPowerdown bool        `json:",omitempty"`
	DestroyProtection  bool        `json:",omitempty"`
	DisableVirtIO      bool        `json:",omitempty"`
	Hostname           string      `json:",omitempty"`
	IdentityName       string      `json:",omitempty"`
	ImageName          string      `json:",omitempty"`
	ImageURL           string      `json:",omitempty"`
	MemoryInMiB        uint64
	MilliCPUs          uint
	OwnerGroups        []string `json:",omitempty"`
	OwnerUsers         []string `json:",omitempty"`
	SpreadVolumes      bool     `json:",omitempty"`
	State              State
	SecondaryAddresses []Address `json:",omitempty"`
	SecondarySubnetIDs []string  `json:",omitempty"`
	SubnetId           string    `json:",omitempty"`
	Tags               tags.Tags `json:",omitempty"`
	Uncommitted        bool      `json:",omitempty"`
	VirtualCPUs        uint      `json:",omitempty"`
	Volumes            []Volume  `json:",omitempty"`
}

func (*VmInfo) Equal

func (left *VmInfo) Equal(right *VmInfo) bool

type Volume

type Volume struct {
	Format VolumeFormat
	Size   uint64
	Type   VolumeType
}

type VolumeFormat

type VolumeFormat uint

func (VolumeFormat) MarshalText

func (volumeFormat VolumeFormat) MarshalText() ([]byte, error)

func (VolumeFormat) String

func (volumeFormat VolumeFormat) String() string

func (*VolumeFormat) UnmarshalText

func (volumeFormat *VolumeFormat) UnmarshalText(text []byte) error

type VolumeInitialisationInfo added in v0.3.2

type VolumeInitialisationInfo struct {
	BytesPerInode            uint64
	Label                    string
	ReservedBlocksPercentage uint16
}

type VolumeType added in v0.3.3

type VolumeType uint

func (VolumeType) MarshalText added in v0.3.3

func (volumeType VolumeType) MarshalText() ([]byte, error)

func (*VolumeType) Set added in v0.3.3

func (volumeType *VolumeType) Set(value string) error

func (VolumeType) String added in v0.3.3

func (volumeType VolumeType) String() string

func (*VolumeType) UnmarshalText added in v0.3.3

func (volumeType *VolumeType) UnmarshalText(text []byte) error

Jump to

Keyboard shortcuts

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