hypervisor

package
v0.0.0-...-aa74118 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2019 License: Apache-2.0 Imports: 4 Imported by: 18

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

	VolumeFormatRaw   = 0
	VolumeFormatQCOW2 = 1
)

Variables

This section is empty.

Functions

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 Address

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

func (*Address) Equal

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

func (*Address) Shrink

func (address *Address) Shrink()

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 ChangeVmTagsRequest

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

type ChangeVmTagsResponse

type ChangeVmTagsResponse 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 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
	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
	ImageDataSize    uint64
	ImageTimeout     time.Duration
	MinimumFreeBytes uint64
	RoundupPower     uint64
	SecondaryVolumes []Volume
	SkipBootloader   bool
	UserDataSize     uint64
	VmInfo

} // RAW image data (length=ImageDataSize) and user data (length=UserDataSize)

type CreateVmResponse

type CreateVmResponse struct {
	DhcpTimedOut    bool
	Final           bool // If true, this is the final response.
	IpAddress       net.IP
	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 GetUpdateRequest

type GetUpdateRequest struct{}

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
	IpAddress   net.IP
	VolumeIndex uint
}

type GetVmVolumeResponse

type GetVmVolumeResponse struct {
	Error string
}

type ImportLocalVmRequest

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

type ImportLocalVmResponse

type ImportLocalVmResponse struct {
	Error string
}

type ListVMsRequest

type ListVMsRequest struct {
	OwnerUsers []string
	Sort       bool
}

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
	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 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 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
	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 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
	Manage            bool     `json:",omitempty"`
	VlanId            uint     `json:",omitempty"`
	AllowedGroups     []string `json:",omitempty"`
	AllowedUsers      []string `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.
	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"`
	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
	ConsoleType        ConsoleType `json:",omitempty"`
	DestroyProtection  bool        `json:",omitempty"`
	DisableVirtIO      bool        `json:",omitempty"`
	Hostname           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
	Tags               tags.Tags `json:",omitempty"`
	SecondaryAddresses []Address `json:",omitempty"`
	SecondarySubnetIDs []string  `json:",omitempty"`
	SubnetId           string    `json:",omitempty"`
	Uncommitted        bool      `json:",omitempty"`
	Volumes            []Volume  `json:",omitempty"`
}

func (*VmInfo) Equal

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

type Volume

type Volume struct {
	Size   uint64
	Format VolumeFormat
}

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

Jump to

Keyboard shortcuts

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