libguestd

package
v0.0.0-...-c9875e2 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GuestAddSshKeys

func GuestAddSshKeys(l *libvirt.Libvirt, domain libvirt.Domain, AgentInfo GuestAgentInfo, Username string, Keys []string, reset bool) error

func GuestChangeUserPassword

func GuestChangeUserPassword(l *libvirt.Libvirt, domain libvirt.Domain, AgentInfo GuestAgentInfo, Username string, Password string) error

func GuestExecStart

func GuestExecStart(l *libvirt.Libvirt, domain libvirt.Domain, AgentInfo GuestAgentInfo, path string, args []string, env []string, stdin []byte) (int, error)

Starts command on guest using guest-exec Returns PID of started process User MUST call GuestCommandStatus after command finished running to get output and reap process.

func GuestFileRead

func GuestFileRead(l *libvirt.Libvirt, domain libvirt.Domain, AgentInfo GuestAgentInfo, filename string) ([]byte, error)

func GuestFileWrite

func GuestFileWrite(l *libvirt.Libvirt, domain libvirt.Domain, AgentInfo GuestAgentInfo, filename string, content []byte) error

func GuestGetHostName

func GuestGetHostName(l *libvirt.Libvirt, domain libvirt.Domain, AgentInfo GuestAgentInfo) (string, error)

func GuestGetSshKeys

func GuestGetSshKeys(l *libvirt.Libvirt, domain libvirt.Domain, AgentInfo GuestAgentInfo, Username string) ([]string, error)

func GuestGetTime

func GuestGetTime(l *libvirt.Libvirt, domain libvirt.Domain, AgentInfo GuestAgentInfo) (int64, error)

func GuestPing

func GuestPing(l *libvirt.Libvirt, domain libvirt.Domain) error

GuestPing returns error when agent didn't respond or something bad happened Returns nil on success.

func GuestRemoveSshKeys

func GuestRemoveSshKeys(l *libvirt.Libvirt, domain libvirt.Domain, AgentInfo GuestAgentInfo, Username string, Keys []string) error

Types

type GuestAgentCommandInfo

type GuestAgentCommandInfo struct {
	Name            string `json:"name"`
	Enabled         bool   `json:"enabled"`
	SuccessResponse bool   `json:"success-response"`
}

type GuestAgentInfo

type GuestAgentInfo struct {
	Version           string                  `json:"version"`
	SupportedCommands []GuestAgentCommandInfo `json:"supported_commands"`
}

func GuestInfo

func GuestInfo(l *libvirt.Libvirt, domain libvirt.Domain) (GuestAgentInfo, error)

func (*GuestAgentInfo) Dump

func (ga *GuestAgentInfo) Dump()

type GuestAgentInfoWrapper

type GuestAgentInfoWrapper struct {
	Result GuestAgentInfo `json:"return"`
}

type GuestDiskAddress

type GuestDiskAddress struct {
	PciController GuestPCIAddress `json:"pci-controller"`
	BusType       string          `json:"bus-type"`
	Bus           int             `json:"bus"`
	Target        int             `json:"target"`
	Unit          int             `json:"unit"`
	Serial        string          `json:"serial"`
	Dev           string          `json:"dev"`
}

func (*GuestDiskAddress) String

func (gdi *GuestDiskAddress) String() string

type GuestDiskInfo

type GuestDiskInfo struct {
	Name         string           `json:"name"`
	Partition    bool             `json:"partition"`
	Dependencies []string         `json:"dependencies"`
	Alias        string           `json:"alias"`
	Address      GuestDiskAddress `json:"address"`
}

func GuestGetDisks

func GuestGetDisks(l *libvirt.Libvirt, domain libvirt.Domain, AgentInfo GuestAgentInfo) ([]GuestDiskInfo, error)

func (*GuestDiskInfo) Dump

func (gdi *GuestDiskInfo) Dump()

type GuestDiskInfoWrapper

type GuestDiskInfoWrapper struct {
	Return []GuestDiskInfo `json:"return"`
}

type GuestDiskStatInfo

type GuestDiskStatInfo struct {
	Name  string         `json:"name"`
	Major int            `json:"major"`
	Minor int            `json:"minor"`
	Stats GuestDiskStats `json:"stats"`
}

func GuestGetDiskstats

func GuestGetDiskstats(l *libvirt.Libvirt, domain libvirt.Domain, AgentInfo GuestAgentInfo) ([]GuestDiskStatInfo, error)

func (*GuestDiskStatInfo) Dump

func (gdsi *GuestDiskStatInfo) Dump()

type GuestDiskStatInfoWrapper

type GuestDiskStatInfoWrapper struct {
	Return []GuestDiskStatInfo `json:"return"`
}

type GuestDiskStats

type GuestDiskStats struct {
	ReadSectors    int `json:"read-sectors"`
	ReadIos        int `json:"read-ios"`
	ReadMerges     int `json:"read-merges"`
	WriteSectors   int `json:"write-sectors"`
	WriteIos       int `json:"write-ios"`
	WriteMerges    int `json:"write-merges"`
	DiscardSectors int `json:"discard-sectors"`
	DiscardIos     int `json:"discard-ios"`
	DiscardMerges  int `json:"discard-merges"`
	FlushIos       int `json:"flush-ios"`
	ReadTicks      int `json:"read-ticks"`
	WriteTicks     int `json:"write-ticks"`
	DiscardTicks   int `json:"discard-ticks"`
	FlushTicks     int `json:"flush-ticks"`
	IosPgr         int `json:"ios-pgr"`
	TotalTicks     int `json:"total-ticks"`
	WeightTicks    int `json:"weight-ticks"`
}

type GuestExecStatus

type GuestExecStatus struct {
	Exited       bool   `json:"exited"`
	ExitCode     int    `json:"exitcode"`
	Signal       int    `json:"signal"`
	OutDataB64   string `json:"out-data"` //only populated after process exits
	ErrDataB64   string `json:"err-data"` //only populated after process exits
	OutTruncated bool   `json:"out-truncated"`
	ErrTruncated bool   `json:"err-truncated"`
}

func GuestCommandStatus

func GuestCommandStatus(l *libvirt.Libvirt, domain libvirt.Domain, AgentInfo GuestAgentInfo, pid int) (GuestExecStatus, error)

Checks status of executed command.

func GuestWaitForCommand

func GuestWaitForCommand(l *libvirt.Libvirt, domain libvirt.Domain, AgentInfo GuestAgentInfo, pid int) (GuestExecStatus, error)

Periodically calls GuestCommandStatus untill command finishes running. Polls for status immediately, then every 50 milliseconds with exponential backoff.

type GuestExecStatusWrapper

type GuestExecStatusWrapper struct {
	Return GuestExecStatus `json:"return"`
}

type GuestFilesystemInfo

type GuestFilesystemInfo struct {
	Name                 string             `json:"name"`
	Type                 string             `json:"type"`
	Mountpoint           string             `json:"mountpoint"`
	UsedBytes            uint64             `json:"used-bytes"`
	TotalBytes           uint64             `json:"total-bytes"`
	TotalBytesPrivileged uint64             `json:"total-bytes-privileged"`
	Disk                 []GuestDiskAddress `json:"disk"`
}

func GuestGetFilesystemInfo

func GuestGetFilesystemInfo(l *libvirt.Libvirt, domain libvirt.Domain, AgentInfo GuestAgentInfo) ([]GuestFilesystemInfo, error)

func (*GuestFilesystemInfo) Dump

func (gfi *GuestFilesystemInfo) Dump()

type GuestFilesystemInfoWrapper

type GuestFilesystemInfoWrapper struct {
	Result []GuestFilesystemInfo `json:"return"`
}

type GuestIpAddress

type GuestIpAddress struct {
	IPAddress     string `json:"ip-address"`
	IPAddressType string `json:"ip-address-type"`
	Prefix        uint32 `json:"prefix"`
}

type GuestNetworkInterface

type GuestNetworkInterface struct {
	Name            string                    `json:"name"`
	HardwareAddress string                    `json:"hardware-address"`
	IpAddresses     []GuestIpAddress          `json:"ip-addresses"`
	Statistics      GuestNetworkInterfaceStat `json:"statistics"`
}

func GuestGetNetworkInterfaces

func GuestGetNetworkInterfaces(l *libvirt.Libvirt, domain libvirt.Domain, AgentInfo GuestAgentInfo) ([]GuestNetworkInterface, error)

func (*GuestNetworkInterface) Dump

func (gni *GuestNetworkInterface) Dump()

type GuestNetworkInterfaceStat

type GuestNetworkInterfaceStat struct {
	RxBytes   uint64 `json:"rx-bytes"`
	TxBytes   uint64 `json:"tx-bytes"`
	RxErrors  uint64 `json:"rx-errs"`
	TxErrors  uint64 `json:"tx-errs"`
	RxDropped uint64 `json:"rx-dropped"`
	TxDropped uint64 `json:"tx-dropped"`
	RxPackets uint64 `json:"rx-packets"`
	TxPackets uint64 `json:"tx-packets"`
}

func (*GuestNetworkInterfaceStat) String

func (gnis *GuestNetworkInterfaceStat) String() string

type GuestNetworkInterfaceWrapper

type GuestNetworkInterfaceWrapper struct {
	Result []GuestNetworkInterface `json:"return"`
}

type GuestOsInfo

type GuestOsInfo struct {
	KernelRelease string `json:"kernel-release"`
	KernelVersion string `json:"kernel-version"`
	Machine       string `json:"machine"`
	ID            string `json:"id"`
	Name          string `json:"name"`
	PrettyName    string `json:"pretty-name"`
	Version       string `json:"version"`
	VersionId     string `json:"version-id"`
	Variant       string `json:"variant"`
	VariantId     string `json:"variant-id"`
}

func GuestGetOsInfo

func GuestGetOsInfo(l *libvirt.Libvirt, domain libvirt.Domain, AgentInfo GuestAgentInfo) (GuestOsInfo, error)

func (*GuestOsInfo) Dump

func (goi *GuestOsInfo) Dump()

type GuestOsInfoWrapper

type GuestOsInfoWrapper struct {
	Result GuestOsInfo `json:"return"`
}

type GuestPCIAddress

type GuestPCIAddress struct {
	Domain   int `json:"domain"`
	Bus      int `json:"bus"`
	Slot     int `json:"slot"`
	Function int `json:"function"`
}

func (*GuestPCIAddress) String

func (gpi *GuestPCIAddress) String() string

Jump to

Keyboard shortcuts

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