cli

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultProject = "default"
View Source
const Running = "Running"

Variables

This section is empty.

Functions

func ListOSTypes added in v0.5.0

func ListOSTypes()

func MinNumber

func MinNumber(numbers []*util.NamedNumber) int

func QualifiedContainerName

func QualifiedContainerName(project string, container string) string

Types

type AddressPrinter

type AddressPrinter interface {
	Print(addresses []*srv.HostAddress, writer io.Writer) error
}

type AssignNumbers

type AssignNumbers struct {
	Client  srv.Client
	File    string `name:"f" usage:"numbers CSV file (container,number)"`
	First   int    `name:"first" usage:"first number"`
	Last    int    `name:"last" usage:"last number (optional)"`
	Project string `name:"project" usage:"add containers from LXD project"`
	Running bool   `name:"r" usage:"use only running containers from specified project"`
	Clean   bool   `name:"clean" usage:"remove numbers for containers that are not selected"`
}

Assign persistent number to containers. Used to assign a unique ssh port to each container

func (*AssignNumbers) AddNumbers

func (t *AssignNumbers) AddNumbers(numbers []*util.NamedNumber, names []string) ([]*util.NamedNumber, error)

func (*AssignNumbers) Configured

func (t *AssignNumbers) Configured() error

func (*AssignNumbers) Run

func (t *AssignNumbers) Run(containers []string) error

type Cloudconfig added in v0.4.0

type Cloudconfig struct {
	Client srv.Client `name:"-"`
	OSType string     `name:"ostype" usage:"OS type.  Use ? for a list."`
	// contains filtered or unexported fields
}

Cloudconfig - cloudconfig operations

func (*Cloudconfig) Configured added in v0.4.0

func (t *Cloudconfig) Configured() error

func (*Cloudconfig) NewConfigurer added in v0.4.0

func (t *Cloudconfig) NewConfigurer(instance string) (*cloudconfig.Configurer, error)

type CloudconfigInstanceOps added in v0.4.0

type CloudconfigInstanceOps struct {
	Cloudconfig *Cloudconfig
	Instance    string `name:"i" usage:"instance to configure"`
}

CloudconfigInstanceOps - runs cloudconfig files on one instance

func (*CloudconfigInstanceOps) Apply added in v0.4.0

func (t *CloudconfigInstanceOps) Apply(configFiles ...string) error

func (*CloudconfigInstanceOps) Configured added in v0.4.0

func (t *CloudconfigInstanceOps) Configured() error

type CloudconfigOps added in v0.3.0

type CloudconfigOps struct {
	Cloudconfig *Cloudconfig
	Instance    string `name:"i" usage:"instance"`
	File        string `name:"f" usage:"cloudconfig file"`
}

CloudconfigOps - runs one cloudconfig file to multiple instances

func (*CloudconfigOps) Apply added in v0.3.0

func (t *CloudconfigOps) Apply(args ...string) error

func (*CloudconfigOps) ApplyFiles added in v0.4.0

func (t *CloudconfigOps) ApplyFiles(configFiles ...string) error

func (*CloudconfigOps) ApplyInstances added in v0.4.0

func (t *CloudconfigOps) ApplyInstances(instances ...string) error

func (*CloudconfigOps) Configured added in v0.4.0

func (t *CloudconfigOps) Configured() error

type ConvertOps added in v0.5.0

type ConvertOps struct {
	OutputFile string `name:"o" usage:"output file"`
	Force      bool   `name:"f" usage:"force conversion even if existing format is the latest"`
}

func (*ConvertOps) Convert added in v0.5.0

func (t *ConvertOps) Convert(args ...string) error

func (*ConvertOps) ConvertFile added in v0.5.0

func (t *ConvertOps) ConvertFile(inputFile, outputFile string) error

type CsvAddressPrinter

type CsvAddressPrinter struct {
	Headers bool
}

func (*CsvAddressPrinter) Print

func (t *CsvAddressPrinter) Print(addresses []*srv.HostAddress, writer io.Writer) error

type InstanceImageSorter

type InstanceImageSorter []srv.InstanceImage

func (InstanceImageSorter) Len

func (t InstanceImageSorter) Len() int

func (InstanceImageSorter) Less

func (t InstanceImageSorter) Less(i, j int) bool

func (InstanceImageSorter) Swap

func (t InstanceImageSorter) Swap(i, j int)

type InstanceOps

type InstanceOps struct {
	Client srv.Client         `name:"-"`
	Server srv.InstanceServer `name:"-"`
}

InstanceOps - operations on instances

func (*InstanceOps) Configured

func (t *InstanceOps) Configured() error

func (*InstanceOps) Devices

func (t *InstanceOps) Devices(instance string) error

func (*InstanceOps) Info added in v0.5.0

func (t *InstanceOps) Info(instance string) error

func (*InstanceOps) ListHwaddr

func (t *InstanceOps) ListHwaddr() error

func (*InstanceOps) ListImages

func (t *InstanceOps) ListImages() error

func (*InstanceOps) Profiles

func (t *InstanceOps) Profiles(instance string) error

func (*InstanceOps) Wait

func (t *InstanceOps) Wait(args []string) error

type NetworkManager

type NetworkManager struct {
	Client srv.Client
}

func (*NetworkManager) GetAddresses

func (t *NetworkManager) GetAddresses(family string) ([]*srv.HostAddress, error)

func (*NetworkManager) ParseAddress

func (t *NetworkManager) ParseAddress(addr string) string

type NetworkOp

type NetworkOp struct {
	Client     srv.Client `name:"-"`
	OutputFile string     `name:"o" usage:"output file"`
	Format     string     `name:"format" usage:"include format: csv | yaml"`
	Headers    bool       `name:"headers" usage:"include headers"`
	Family     string     `name:"family" usage:"network family: inet | inet6"`
}

func (*NetworkOp) ExportAddresses

func (t *NetworkOp) ExportAddresses() error

func (*NetworkOp) Init

func (t *NetworkOp) Init() error

type ProfileExportOps added in v0.4.0

type ProfileExportOps struct {
	Client srv.Client `name:"-"`
	Dir    string     `name:"d" usage:"export directory"`
	All    bool       `name:"all" usage:"export all profiles"`
}

func (*ProfileExportOps) Export added in v0.4.0

func (t *ProfileExportOps) Export(profiles ...string) error

func (*ProfileExportOps) ExportProfile added in v0.4.0

func (t *ProfileExportOps) ExportProfile(server srv.InstanceServer, name string) error

type ProfileOps

type ProfileOps struct {
	Client srv.Client `name:"-"`
}

func (*ProfileOps) Import

func (t *ProfileOps) Import(files []string) error

func (*ProfileOps) ImportProfile

func (t *ProfileOps) ImportProfile(server srv.InstanceServer, file string, existingProfiles map[string]bool) error

func (*ProfileOps) ProfileExists

func (t *ProfileOps) ProfileExists(profile string) error

type ShiftIds added in v0.5.0

type ShiftIds struct {
	UidShift int  `name:"u" usage:"uid shift"`
	GidShift int  `name:"g" usage:"gid shift"`
	Verbose  bool `name:"v"`
}

func (*ShiftIds) Run added in v0.5.0

func (t *ShiftIds) Run(dirs ...string) error

type YamlAddressPrinter

type YamlAddressPrinter struct {
}

func (*YamlAddressPrinter) Print

func (t *YamlAddressPrinter) Print(addresses []*srv.HostAddress, writer io.Writer) error

Jump to

Keyboard shortcuts

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