...

Package machine1

import "github.com/coreos/go-systemd/v22/machine1"
Overview
Index

Overview ▾

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

type Conn

Conn is a connection to systemds dbus endpoint.

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

func New

func New() (*Conn, error)

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

func (*Conn) Connected

func (c *Conn) Connected() bool

Connected returns whether conn is connected

func (*Conn) CreateMachine

func (c *Conn) CreateMachine(name string, id []byte, service string, class string, pid int, root_directory string, scope_properties []sd_dbus.Property) error

CreateMachine creates a new virtual machine or container with systemd-machined, generating a scope unit for it

func (*Conn) CreateMachineWithNetwork

func (c *Conn) CreateMachineWithNetwork(name string, id []byte, service string, class string, pid int, root_directory string, ifindices []int, scope_properties []sd_dbus.Property) error

CreateMachineWithNetwork creates the container with its network config with systemd-machined

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) RegisterMachineWithNetwork

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

RegisterMachineWithNetwork registers the container with its network with 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

ImageStatus is a set of necessary info for each machine image

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
}

type MachineStatus

MachineStatus is a set of necessary info for each machine

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
}