manager

package
v0.0.0-...-d8f7d12 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2020 License: Apache-2.0 Imports: 54 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DhcpServer

type DhcpServer interface {
	AddLease(address proto.Address, hostname string) error
	AddSubnet(subnet proto.Subnet)
	MakeAcknowledgmentChannel(ipAddr net.IP) <-chan struct{}
	MakeRequestChannel(macAddr string) <-chan net.IP
	RemoveLease(ipAddr net.IP)
	RemoveSubnet(subnetId string)
}

type Manager

type Manager struct {
	StartOptions
	// contains filtered or unexported fields
}

func New

func New(startOptions StartOptions) (*Manager, error)

func (*Manager) AcknowledgeVm

func (m *Manager) AcknowledgeVm(ipAddr net.IP,
	authInfo *srpc.AuthInformation) error

func (*Manager) AddAddressesToPool

func (m *Manager) AddAddressesToPool(addresses []proto.Address) error

func (*Manager) AddVmVolumes

func (m *Manager) AddVmVolumes(ipAddr net.IP,
	authInfo *srpc.AuthInformation, volumeSizes []uint64) error

func (*Manager) BecomePrimaryVmOwner

func (m *Manager) BecomePrimaryVmOwner(ipAddr net.IP,
	authInfo *srpc.AuthInformation) error

func (*Manager) ChangeOwners

func (m *Manager) ChangeOwners(ownerGroups, ownerUsers []string) error

func (*Manager) ChangeVmConsoleType

func (m *Manager) ChangeVmConsoleType(ipAddr net.IP,
	authInfo *srpc.AuthInformation, consoleType proto.ConsoleType) error

func (*Manager) ChangeVmDestroyProtection

func (m *Manager) ChangeVmDestroyProtection(ipAddr net.IP,
	authInfo *srpc.AuthInformation, destroyProtection bool) error

func (*Manager) ChangeVmOwnerUsers

func (m *Manager) ChangeVmOwnerUsers(ipAddr net.IP,
	authInfo *srpc.AuthInformation, extraUsers []string) error

func (*Manager) ChangeVmSize

func (m *Manager) ChangeVmSize(ipAddr net.IP, authInfo *srpc.AuthInformation,
	memoryInMiB uint64, milliCPUs uint) error

func (*Manager) ChangeVmTags

func (m *Manager) ChangeVmTags(ipAddr net.IP, authInfo *srpc.AuthInformation,
	tgs tags.Tags) error

func (*Manager) CheckOwnership

func (m *Manager) CheckOwnership(authInfo *srpc.AuthInformation) bool

func (*Manager) CheckVmHasHealthAgent

func (m *Manager) CheckVmHasHealthAgent(ipAddr net.IP) (bool, error)

func (*Manager) CloseUpdateChannel

func (m *Manager) CloseUpdateChannel(channel <-chan proto.Update)

func (*Manager) CommitImportedVm

func (m *Manager) CommitImportedVm(ipAddr net.IP,
	authInfo *srpc.AuthInformation) error

func (*Manager) ConnectToVmConsole

func (m *Manager) ConnectToVmConsole(ipAddr net.IP,
	authInfo *srpc.AuthInformation) (net.Conn, error)

func (*Manager) ConnectToVmSerialPort

func (m *Manager) ConnectToVmSerialPort(ipAddr net.IP,
	authInfo *srpc.AuthInformation,
	portNumber uint) (chan<- byte, <-chan byte, error)

func (*Manager) CopyVm

func (m *Manager) CopyVm(conn *srpc.Conn, request proto.CopyVmRequest) error

func (*Manager) CreateVm

func (m *Manager) CreateVm(conn *srpc.Conn) error

func (*Manager) DeleteVmVolume

func (m *Manager) DeleteVmVolume(ipAddr net.IP, authInfo *srpc.AuthInformation,
	accessToken []byte, volumeIndex uint) error

func (*Manager) DestroyVm

func (m *Manager) DestroyVm(ipAddr net.IP,
	authInfo *srpc.AuthInformation, accessToken []byte) error

func (*Manager) DiscardVmAccessToken

func (m *Manager) DiscardVmAccessToken(ipAddr net.IP,
	authInfo *srpc.AuthInformation, accessToken []byte) error

func (*Manager) DiscardVmOldImage

func (m *Manager) DiscardVmOldImage(ipAddr net.IP,
	authInfo *srpc.AuthInformation) error

func (*Manager) DiscardVmOldUserData

func (m *Manager) DiscardVmOldUserData(ipAddr net.IP,
	authInfo *srpc.AuthInformation) error

func (*Manager) DiscardVmSnapshot

func (m *Manager) DiscardVmSnapshot(ipAddr net.IP,
	authInfo *srpc.AuthInformation) error

func (*Manager) ExportLocalVm

func (m *Manager) ExportLocalVm(authInfo *srpc.AuthInformation,
	request proto.ExportLocalVmRequest) (*proto.ExportLocalVmInfo, error)

func (*Manager) GetHealthStatus

func (m *Manager) GetHealthStatus() string

func (*Manager) GetImageServerAddress

func (m *Manager) GetImageServerAddress() string

func (*Manager) GetNumVMs

func (m *Manager) GetNumVMs() (uint, uint)

func (*Manager) GetRootCookiePath

func (m *Manager) GetRootCookiePath() string

func (*Manager) GetVmAccessToken

func (m *Manager) GetVmAccessToken(ipAddr net.IP,
	authInfo *srpc.AuthInformation, lifetime time.Duration) ([]byte, error)

func (*Manager) GetVmBootLog

func (m *Manager) GetVmBootLog(ipAddr net.IP) (io.ReadCloser, error)

func (*Manager) GetVmInfo

func (m *Manager) GetVmInfo(ipAddr net.IP) (proto.VmInfo, error)

func (*Manager) GetVmUserData

func (m *Manager) GetVmUserData(ipAddr net.IP) (io.ReadCloser, error)

func (*Manager) GetVmUserDataRPC

func (m *Manager) GetVmUserDataRPC(ipAddr net.IP,
	authInfo *srpc.AuthInformation, accessToken []byte) (
	io.ReadCloser, uint64, error)

func (*Manager) GetVmVolume

func (m *Manager) GetVmVolume(conn *srpc.Conn) error

func (*Manager) ImportLocalVm

func (m *Manager) ImportLocalVm(authInfo *srpc.AuthInformation,
	request proto.ImportLocalVmRequest) error

func (*Manager) ListAvailableAddresses

func (m *Manager) ListAvailableAddresses() []proto.Address

func (*Manager) ListRegisteredAddresses

func (m *Manager) ListRegisteredAddresses() []proto.Address

func (*Manager) ListSubnets

func (m *Manager) ListSubnets(doSort bool) []proto.Subnet

func (*Manager) ListVMs

func (m *Manager) ListVMs(ownerUsers []string, doSort bool) []string

func (*Manager) ListVolumeDirectories

func (m *Manager) ListVolumeDirectories() []string

func (*Manager) MakeSubnetChannel

func (m *Manager) MakeSubnetChannel() <-chan proto.Subnet

func (*Manager) MakeUpdateChannel

func (m *Manager) MakeUpdateChannel() <-chan proto.Update

func (*Manager) MigrateVm

func (m *Manager) MigrateVm(conn *srpc.Conn) error

func (*Manager) NotifyVmMetadataRequest

func (m *Manager) NotifyVmMetadataRequest(ipAddr net.IP, path string)

func (*Manager) PatchVmImage

func (m *Manager) PatchVmImage(conn *srpc.Conn,
	request proto.PatchVmImageRequest) error

func (*Manager) PowerOff

func (m *Manager) PowerOff(stopVMs bool) error

func (*Manager) PrepareVmForMigration

func (m *Manager) PrepareVmForMigration(ipAddr net.IP,
	authInfo *srpc.AuthInformation, accessToken []byte, enable bool) error

func (*Manager) RegisterVmMetadataNotifier

func (m *Manager) RegisterVmMetadataNotifier(ipAddr net.IP,
	authInfo *srpc.AuthInformation, pathChannel chan<- string) error

func (*Manager) RemoveAddressesFromPool

func (m *Manager) RemoveAddressesFromPool(addresses []proto.Address) error

func (*Manager) RemoveExcessAddressesFromPool

func (m *Manager) RemoveExcessAddressesFromPool(maxFree map[string]uint) error

func (*Manager) ReplaceVmImage

func (m *Manager) ReplaceVmImage(conn *srpc.Conn,
	authInfo *srpc.AuthInformation) error

func (*Manager) ReplaceVmUserData

func (m *Manager) ReplaceVmUserData(ipAddr net.IP, reader io.Reader,
	size uint64, authInfo *srpc.AuthInformation) error

func (*Manager) RestoreVmFromSnapshot

func (m *Manager) RestoreVmFromSnapshot(ipAddr net.IP,
	authInfo *srpc.AuthInformation, forceIfNotStopped bool) error

func (*Manager) RestoreVmImage

func (m *Manager) RestoreVmImage(ipAddr net.IP,
	authInfo *srpc.AuthInformation) error

func (*Manager) RestoreVmUserData

func (m *Manager) RestoreVmUserData(ipAddr net.IP,
	authInfo *srpc.AuthInformation) error

func (*Manager) ScanVmRoot

func (m *Manager) ScanVmRoot(ipAddr net.IP, authInfo *srpc.AuthInformation,
	scanFilter *filter.Filter) (*filesystem.FileSystem, error)

func (*Manager) ShutdownVMsAndExit

func (m *Manager) ShutdownVMsAndExit()

func (*Manager) SnapshotVm

func (m *Manager) SnapshotVm(ipAddr net.IP, authInfo *srpc.AuthInformation,
	forceIfNotStopped, snapshotRootOnly bool) error

func (*Manager) StartVm

func (m *Manager) StartVm(ipAddr net.IP, authInfo *srpc.AuthInformation,
	accessToken []byte, dhcpTimeout time.Duration) (
	bool, error)

func (*Manager) StopVm

func (m *Manager) StopVm(ipAddr net.IP, authInfo *srpc.AuthInformation,
	accessToken []byte) error

func (*Manager) UnregisterVmMetadataNotifier

func (m *Manager) UnregisterVmMetadataNotifier(ipAddr net.IP,
	pathChannel chan<- string) error

func (*Manager) UpdateSubnets

func (m *Manager) UpdateSubnets(request proto.UpdateSubnetsRequest) error

func (*Manager) WriteHtml

func (m *Manager) WriteHtml(writer io.Writer)

type StartOptions

type StartOptions struct {
	BridgeMap          map[string]net.Interface // Key: interface name.
	DhcpServer         DhcpServer
	ImageServerAddress string
	Logger             log.DebugLogger
	ObjectCacheBytes   uint64
	ShowVgaConsole     bool
	StateDir           string
	Username           string
	VlanIdToBridge     map[uint]string // Key: VLAN ID, value: bridge interface.
	VolumeDirectories  []string
}

Jump to

Keyboard shortcuts

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