grpcserver_libvirt

package
v0.0.0-...-1b70f73 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2022 License: AGPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// some jobs require special handling right before they are pushed to the worker. They have a custom type (listed here) which corresponds to a handler.
	// jobs with no type are exepcted to json decode as a rhyzome_protos.LibvirtEvent, which will be pushed to the worker.
	// note that some of these don't actually need special handling but haven't been refactored to use the common format
	CreateInstanceJobTypeV1 = "instance/create/v1"
	StartInstanceJobTypeV1  = "instance/start/v1"
	StopInstanceJobTypeV1   = "instance/stop/v1"
	DeleteInstanceJobTypeV1 = "instance/delete/v1"

	JobStatePENDING = 0
	JobStateRUNNING = 1
	JobStateDONE    = 2
	JobStateERROR   = 3
)

Variables

This section is empty.

Functions

func AttachNIC

func AttachNIC(ctx context.Context, instanceID string, nic NetworkInterface) error

func DeleteInstance

func DeleteInstance(ctx context.Context, request json.RawMessage) error

func InstanceStarted

InstanceStarted callback is called when a VM starts up

func InstanceStopped

InstanceStopped call the on vm stop hook

func StartInstance

func StartInstance(ctx context.Context, request json.RawMessage) error

StartInstance requests that libvirt boot a VM

func StopInstance

func StopInstance(ctx context.Context, request json.RawMessage) error

StopInstance requests that libvirt boot a VM

Types

type CreateRequest

type CreateRequest struct {
	Id       string
	Tenant   string
	UserData []byte
	Memory   int
	Cores    int
	VLANs    []int32

	// settings for the root volume
	RootVolumeID string
	BaseImage    string
	VolumeSize   int

	AdditionalVolumes []string
	NetworkInterfaces []NetworkInterface
}

type DeleteRequest

type DeleteRequest struct {
	Id string
}

type NetworkInterface

type NetworkInterface struct {
	ResourceID string
	MAC        string
	VLAN       int
	Tagged     bool
}

type StartStopRequest

type StartStopRequest struct {
	ResourceID string
}

Jump to

Keyboard shortcuts

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