Documentation ¶
Index ¶
- Variables
- func GetDefaultProfile(pt string) (*config.Profile, error)
- func ZipPlatformProfileNats(platformTCPPorts, platformUDPPorts []int) (tcpNats, udpNats []*config.NatPortPair)
- type Boxen
- func (b *Boxen) DeProvision(instance string) error
- func (b *Boxen) GetGroupInstances(group string) ([]string, error)
- func (b *Boxen) Init(d string) error
- func (b *Boxen) Install(disk, username, password, vendor, platform, version string) error
- func (b *Boxen) PackageBuild(disk, username, password, repo, tag, vendor, platform, version string) error
- func (b *Boxen) PackageInstall() error
- func (b *Boxen) PackageStart(username, password, hostname, config string) error
- func (b *Boxen) Provision(instance, vendor, platform, sourceDisk, profile string) error
- func (b *Boxen) RenderInitialConfig(name string) ([]string, error)
- func (b *Boxen) Start(name string) error
- func (b *Boxen) Stop(name string) error
- func (b *Boxen) UnInstall(pT, disk string) error
- type Disk
- type Option
Constants ¶
This section is empty.
Variables ¶
var Version = "0.0.0" //nolint: gochecknoglobals
Functions ¶
func GetDefaultProfile ¶
GetDefaultProfile fetches the default instance profile for a given platform type 'pt'.
func ZipPlatformProfileNats ¶ added in v0.0.4
func ZipPlatformProfileNats( platformTCPPorts, platformUDPPorts []int, ) (tcpNats, udpNats []*config.NatPortPair)
ZipPlatformProfileNats receives the lists of TCP and UDP ports that are defined in a platform profile yaml. For each received tcp/udp instance port a host port is allocated sequentially from the hostPortBase port number. These port mappings are used in packaging workflow (e.g. when building for containerlab).
Types ¶
type Boxen ¶
type Boxen struct { ConfigPath string Config *config.Config Instances map[string]platforms.Platform Logger *logging.Instance // contains filtered or unexported fields }
Boxen is the main "manager"/instance containing all the configuration data and maps of instances.
func (*Boxen) DeProvision ¶
DeProvision does what it says -- it "deprovisions" an instance from the Boxen configuration. This is only useful/relevant for "local" boxen operations, i.e. VMs not containerized/packaged as you would use with Containerlab.
func (*Boxen) GetGroupInstances ¶
GetGroupInstances returns a slice of instance names for a provided group.
func (*Boxen) Install ¶
Install "installs" a disk as a source disk which local instances can be provisioned to boot from. This is only useful/relevant in the local VM (not Containerlab) mode of operation. Install handles disabling initial config dialogs/prompts, setting base credentials, and then storing the image for use for later provisioned instances.
func (*Boxen) PackageBuild ¶
func (b *Boxen) PackageBuild( disk, username, password, repo, tag, vendor, platform, version string, ) error
PackageBuild is the initial entrypoint for "packaging" an instance as a container image. This function will create a copy of the provided disk, build an install container image, then run that image which will kick off the PackageInstall function. After installation (dealing with the initial prompts and installing a base config and such) is complete, the disk image is copied out of the install container, the install container is then destroyed, with the initial build image. Finally, this function will build a final container image, copying in the provisioned disk into the final image.
func (*Boxen) PackageInstall ¶
PackageInstall is the function that is run *in* the initially built container image. This function handles the initial provisioning of the instance.
func (*Boxen) PackageStart ¶
PackageStart starts the qemu instance vm inside a packaged boxen container.
func (*Boxen) Provision ¶
Provision creates all the required config objects/port allocation/etc. for a local boxen instance.
func (*Boxen) RenderInitialConfig ¶
RenderInitialConfig renders the initial installation config template.
type Option ¶
type Option func(*args) error
func WithConfig ¶
WithConfig allows for passing a config file path f to the NewBoxen function.
func WithLogger ¶
WithLogger allows for passing a boxen logging.Instance l to the NewBoxen function.