machine1

package
v0.0.0-...-22b03c5 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2019 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Integration with the systemd machined API. See http://www.freedesktop.org/wiki/Software/systemd/machined/

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Conn

type Conn struct {
	// contains filtered or unexported fields
}

Conn is a connection to systemds dbus endpoint.

func New

func New() (*Conn, error)

New() establishes a connection to the system bus and authenticates.

func (*Conn) DescribeMachine

func (c *Conn) DescribeMachine(name string) (machineProps map[string]interface{}, err error)

DescribeMachine gets the properties of a machine

func (*Conn) GetImage

func (c *Conn) GetImage(name string) (dbus.ObjectPath, error)

GetImage gets a specific image with systemd-machined

func (*Conn) GetMachine

func (c *Conn) GetMachine(name string) (dbus.ObjectPath, error)

GetMachine gets a specific container with systemd-machined

func (*Conn) GetMachineAddresses

func (c *Conn) GetMachineAddresses(name string) (dbus.ObjectPath, error)

GetMachineAddresses gets a list of IP addresses

func (*Conn) GetMachineByPID

func (c *Conn) GetMachineByPID(pid uint) (dbus.ObjectPath, error)

GetMachineByPID gets a machine specified by a PID from systemd-machined

func (*Conn) KillMachine

func (c *Conn) KillMachine(name, who string, sig syscall.Signal) error

KillMachine sends a signal to a machine

func (*Conn) ListImages

func (c *Conn) ListImages() ([]ImageStatus, error)

ListImages returns an array of all currently available images.

func (*Conn) ListMachines

func (c *Conn) ListMachines() ([]MachineStatus, error)

ListMachines returns an array of all currently running machines.

func (*Conn) RegisterMachine

func (c *Conn) RegisterMachine(name string, id []byte, service string, class string, pid int, root_directory string) error

RegisterMachine registers the container with the systemd-machined

func (*Conn) TerminateMachine

func (c *Conn) TerminateMachine(name string) error

TerminateMachine causes systemd-machined to terminate a machine, killing its processes

type ImageStatus

type ImageStatus struct {
	Name       string          // The primary image name as string
	ImageType  string          // The image type as string
	Readonly   bool            // whether it's readonly or not
	CreateTime uint64          // time when it's created
	ModifyTime uint64          // time when it's modified
	DiskUsage  uint64          // used disk space
	JobPath    dbus.ObjectPath // The job object path
}

ImageStatus is a set of necessary info for each machine image

type MachineStatus

type MachineStatus struct {
	Name    string          // The primary machine name as string
	Class   string          // The machine class as string
	Service string          // The machine service as string
	JobPath dbus.ObjectPath // The job object path
}

MachineStatus is a set of necessary info for each machine

Jump to

Keyboard shortcuts

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