Documentation ¶
Index ¶
Constants ¶
View Source
const ( // default connection mode for vrnetlab based containers VrDefConnMode = "tc" // keys for the map returned by GetImages ImageKey = "image" KernelKey = "kernel" SandboxKey = "sandbox" )
View Source
const ( NodeKindBridge = "bridge" NodeKindCEOS = "ceos" NodeKindCVX = "cvx" NodeKindCRPD = "crpd" NodeKindHOST = "host" NodeKindLinux = "linux" NodeKindMySocketIO = "mysocketio" NodeKindOVS = "ovs-bridge" NodeKindSonic = "sonic-vs" NodeKindSRL = "srl" NodeKindVrCSR = "vr-csr" NodeKindVrPAN = "vr-pan" NodeKindVrN9KV = "vr-n9kv" NodeKindVrFTOSV = "vr-ftosv" NodeKindVrROS = "vr-ros" NodeKindVrSROS = "vr-sros" NodeKindVrVEOS = "vr-veos" NodeKindVrVMX = "vr-vmx" NodeKindVrVQFX = "vr-vqfx" NodeKindVrXRV = "vr-xrv" NodeKindVrXRV9K = "vr-xrv9k" NodeKindVrNXOS = "vr-nxos" )
Variables ¶
View Source
var DefaultConfigTemplates = map[string]string{
"vr-sros": "",
}
View Source
var DefaultCredentials = map[string][]string{
"srl": {"admin", "admin"},
"vr-pan": {"admin", "Admin@123"},
"vr-n9kv": {"admin", "admin"},
"vr-ftosv": {"admin", "admin"},
"vr-sros": {"admin", "admin"},
"vr-vmx": {"admin", "admin@123"},
"vr-vqfx": {"admin", "admin@123"},
"vr-xrv9k": {"clab", "clab@123"},
}
DefaultCredentials holds default username and password per each kind
View Source
var NodeKind string
View Source
var Nodes = map[string]Initializer{}
View Source
var NonDefaultRuntimes = map[string]string{ NodeKindCVX: runtime.IgniteRuntime, }
a map of node kinds overriding the default global runtime
Functions ¶
func Register ¶
func Register(name string, initFn Initializer)
Types ¶
type Initializer ¶
type Initializer func() Node
type Node ¶
type Node interface { Init(*types.NodeConfig, ...NodeOption) error Config() *types.NodeConfig PreDeploy(configName, labCADir, labCARoot string) error Deploy(context.Context) error PostDeploy(context.Context, map[string]Node) error WithMgmtNet(*types.MgmtNet) WithRuntime(runtime.ContainerRuntime) SaveConfig(context.Context) error Delete(context.Context) error GetImages() map[string]string GetRuntime() runtime.ContainerRuntime }
type NodeOption ¶
type NodeOption func(Node)
func WithMgmtNet ¶
func WithMgmtNet(mgmt *types.MgmtNet) NodeOption
func WithRuntime ¶
func WithRuntime(r runtime.ContainerRuntime) NodeOption
Click to show internal directories.
Click to hide internal directories.