Documentation ¶
Index ¶
- Constants
- func AnnotateLXDError(name string, err error) error
- func ConfigDir() (string, error)
- func FileExists(server lxd.InstanceServer, container string, file string) bool
- func MinNumber(numbers []*util.NamedNumber) int
- func QualifiedContainerName(project string, container string) string
- func SplitSnapshotName(name string) (container, snapshot string)
- func WaitForNetwork(server lxd.InstanceServer, instance string) error
- type AddressPrinter
- type AssignNumbers
- type CsvAddressPrinter
- type Functions
- type HostAddress
- type HostFunctions
- type ImageOps
- type InstanceDevicesOp
- type InstanceOps
- func (t *InstanceOps) Config(instance string) error
- func (t *InstanceOps) Configured() error
- func (t *InstanceOps) Info(instance string) error
- func (t *InstanceOps) ListHwaddr() error
- func (t *InstanceOps) ListImages() error
- func (t *InstanceOps) Network(instance string) error
- func (t *InstanceOps) Profiles(instance string) error
- func (t *InstanceOps) State(instance string) error
- func (t *InstanceOps) Statistics() error
- func (t *InstanceOps) Wait(args []string) error
- type InstanceServer
- type LxcConfig
- type LxdClient
- type NetworkManager
- func (t *NetworkManager) GetAddresses(family string) ([]*HostAddress, error)
- func (t *NetworkManager) GetProjectAddresses(server lxd.InstanceServer, instanceType api.InstanceType, project string, ...) ([]*HostAddress, error)
- func (t *NetworkManager) ParseAddress(addr string) string
- func (t *NetworkManager) WriteAddresses(addresses []*HostAddress, file string, headers bool) error
- type NetworkOp
- type ProfileOps
- type ProjectCopyProfiles
- type ProjectCreate
- type Statistics
- type TemplateOps
- type YamlAddressPrinter
Constants ¶
View Source
const DefaultProject = "default"
View Source
const Running = "Running"
Variables ¶
This section is empty.
Functions ¶
func AnnotateLXDError ¶
func FileExists ¶
func FileExists(server lxd.InstanceServer, container string, file string) bool
func MinNumber ¶
func MinNumber(numbers []*util.NamedNumber) int
func QualifiedContainerName ¶
func SplitSnapshotName ¶
func WaitForNetwork ¶
func WaitForNetwork(server lxd.InstanceServer, instance string) error
Types ¶
type AddressPrinter ¶
type AddressPrinter interface {
Print(addresses []*HostAddress, writer io.Writer) error
}
type AssignNumbers ¶
type AssignNumbers struct { Client *LxdClient 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 CsvAddressPrinter ¶
type CsvAddressPrinter struct {
Headers bool
}
func (*CsvAddressPrinter) Print ¶
func (t *CsvAddressPrinter) Print(addresses []*HostAddress, writer io.Writer) error
type HostAddress ¶
type HostFunctions ¶
type HostFunctions struct { }
func (*HostFunctions) Ipv4 ¶
func (h *HostFunctions) Ipv4() (string, error)
func (*HostFunctions) Ipv6 ¶
func (h *HostFunctions) Ipv6() (string, error)
func (*HostFunctions) PrivateIpv4 ¶
func (h *HostFunctions) PrivateIpv4() (network.Ipv4, error)
func (*HostFunctions) PrivateIpv6 ¶
func (h *HostFunctions) PrivateIpv6() (network.Ipv6, error)
type ImageOps ¶
type ImageOps struct {
Client *LxdClient `name:"-"`
}
func (*ImageOps) Containers ¶
func (*ImageOps) ListFingerprints ¶
type InstanceDevicesOp ¶
type InstanceDevicesOp struct { InstanceOps *InstanceOps `name:""` Yaml bool }
func (*InstanceDevicesOp) Devices ¶
func (t *InstanceDevicesOp) Devices(instance string) error
type InstanceOps ¶
type InstanceOps struct { Client *LxdClient `name:"-"` // contains filtered or unexported fields }
InstanceOps - operations on LXD instances (formerly ContainerOps)
func (*InstanceOps) Config ¶
func (t *InstanceOps) Config(instance string) error
func (*InstanceOps) Configured ¶
func (t *InstanceOps) Configured() error
func (*InstanceOps) Info ¶
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) Network ¶
func (t *InstanceOps) Network(instance string) error
func (*InstanceOps) Profiles ¶
func (t *InstanceOps) Profiles(instance string) error
func (*InstanceOps) State ¶
func (t *InstanceOps) State(instance string) error
func (*InstanceOps) Statistics ¶
func (t *InstanceOps) Statistics() error
func (*InstanceOps) Wait ¶
func (t *InstanceOps) Wait(args []string) error
type InstanceServer ¶
type InstanceServer struct {
Server lxd.InstanceServer
}
func (InstanceServer) ProfileExists ¶
func (t InstanceServer) ProfileExists(profile string) bool
func (InstanceServer) StartContainer ¶
func (t InstanceServer) StartContainer(container string) error
func (InstanceServer) StopContainer ¶
func (t InstanceServer) StopContainer(container string) error
type LxcConfig ¶
type LxcConfig struct {
// contains filtered or unexported fields
}
func (*LxcConfig) CurrentProject ¶
type LxdClient ¶
type LxdClient struct { Socket string Http bool `usage:"connect to LXD using http"` Unix bool `usage:"connect to LXD using unix socket"` LxcConfig // contains filtered or unexported fields }
func (*LxdClient) CurrentServer ¶
func (t *LxdClient) CurrentServer() (lxd.InstanceServer, error)
func (*LxdClient) ProjectServer ¶
func (t *LxdClient) ProjectServer(project string) (lxd.InstanceServer, error)
func (*LxdClient) RootServer ¶
func (t *LxdClient) RootServer() (lxd.InstanceServer, error)
type NetworkManager ¶
type NetworkManager struct {
Client *LxdClient
}
func (*NetworkManager) GetAddresses ¶
func (t *NetworkManager) GetAddresses(family string) ([]*HostAddress, error)
func (*NetworkManager) GetProjectAddresses ¶
func (t *NetworkManager) GetProjectAddresses(server lxd.InstanceServer, instanceType api.InstanceType, project string, family string) ([]*HostAddress, error)
func (*NetworkManager) ParseAddress ¶
func (t *NetworkManager) ParseAddress(addr string) string
func (*NetworkManager) WriteAddresses ¶
func (t *NetworkManager) WriteAddresses(addresses []*HostAddress, file string, headers bool) error
type NetworkOp ¶
type NetworkOp struct { Client *LxdClient `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 ¶
type ProfileOps ¶
type ProfileOps struct { Client *LxdClient `name:"-"` Dir string `name:"d" usage:"export directory"` }
func (*ProfileOps) Export ¶
func (t *ProfileOps) Export(profiles ...string) error
func (*ProfileOps) ExportProfile ¶
func (t *ProfileOps) ExportProfile(server lxd.InstanceServer, name string) error
func (*ProfileOps) Import ¶
func (t *ProfileOps) Import(files []string) error
func (*ProfileOps) ImportProfile ¶
func (t *ProfileOps) ImportProfile(server lxd.InstanceServer, file string, existingProfiles map[string]bool) error
type ProjectCopyProfiles ¶
type ProjectCopyProfiles struct { Client *LxdClient `name:"-"` SourceProject string `name:"source-project" usage:"project to copy profiles from"` TargetProject string `name:"target-project" usage:"project to copy profiles to"` }
func (*ProjectCopyProfiles) CopyProfiles ¶
func (t *ProjectCopyProfiles) CopyProfiles(profiles []string) error
type ProjectCreate ¶
type ProjectCreate struct {
Client *LxdClient `name:"-"`
}
func (*ProjectCreate) Create ¶
func (t *ProjectCreate) Create(projects ...string) error
type Statistics ¶
type TemplateOps ¶
type TemplateOps struct { Client *LxdClient `name:"-"` templatecmd.TemplateOp }
func (*TemplateOps) Apply ¶
func (t *TemplateOps) Apply() error
type YamlAddressPrinter ¶
type YamlAddressPrinter struct { }
func (*YamlAddressPrinter) Print ¶
func (t *YamlAddressPrinter) Print(addresses []*HostAddress, writer io.Writer) error
Click to show internal directories.
Click to hide internal directories.