models

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OverwriteDevModelFromFile

func OverwriteDevModelFromFile(fileName string, model DevModel) error

OverwriteDevModelFromFile replace default config with config from provided file

Types

type DevModel

type DevModel interface {
	Adapters() []*config.SystemAdapter
	SetAdapters([]*config.SystemAdapter)
	Networks() []*config.NetworkConfig
	SetNetworks([]*config.NetworkConfig)
	PhysicalIOs() []*config.PhysicalIO
	SetPhysicalIOs([]*config.PhysicalIO)
	VlanAdapters() []*config.VlanAdapter
	SetVlanAdapters([]*config.VlanAdapter)
	BondAdapters() []*config.BondAdapter
	SetBondAdapters([]*config.BondAdapter)
	AdapterForSwitches() []string
	DevModelType() string
	SetWiFiParams(ssid string, psk string)
	GetPortConfig(ssid string, psk string) string
	DiskFormat() string
	DiskReadyMessage() string
	Config() map[string]interface{}
}

DevModel is an interface to use for describe device

func GetDevModel

func GetDevModel(devModelType devModelType) (DevModel, error)

GetDevModel return DevModel object by DevModelType

func GetDevModelByName

func GetDevModelByName(modelType string) (DevModel, error)

GetDevModelByName return DevModel object by DevModelType string

type DevModelGCP

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

DevModelGCP is dev model fields

func (*DevModelGCP) AdapterForSwitches

func (ctx *DevModelGCP) AdapterForSwitches() []string

AdapterForSwitches returns adapterForSwitches of devModel

func (*DevModelGCP) Adapters

func (ctx *DevModelGCP) Adapters() []*config.SystemAdapter

Adapters returns adapters of devModel

func (*DevModelGCP) BondAdapters added in v1.0.0

func (ctx *DevModelGCP) BondAdapters() []*config.BondAdapter

BondAdapters returns Bond adapters of devModel

func (*DevModelGCP) Config

func (ctx *DevModelGCP) Config() map[string]interface{}

Config returns map with config overwrites

func (*DevModelGCP) DevModelType

func (ctx *DevModelGCP) DevModelType() string

DevModelType returns devModelType of devModel

func (*DevModelGCP) DiskFormat

func (ctx *DevModelGCP) DiskFormat() string

DiskFormat to use for build image

func (*DevModelGCP) DiskReadyMessage

func (ctx *DevModelGCP) DiskReadyMessage() string

DiskReadyMessage to show when image is ready

func (*DevModelGCP) GetPortConfig

func (ctx *DevModelGCP) GetPortConfig(_ string, _ string) string

GetPortConfig returns PortConfig overwrite

func (*DevModelGCP) Networks

func (ctx *DevModelGCP) Networks() []*config.NetworkConfig

Networks returns networks of devModel

func (*DevModelGCP) PhysicalIOs

func (ctx *DevModelGCP) PhysicalIOs() []*config.PhysicalIO

PhysicalIOs returns physicalIOs of devModel

func (*DevModelGCP) SetAdapters added in v1.0.0

func (ctx *DevModelGCP) SetAdapters(adapters []*config.SystemAdapter)

SetAdapters sets systems adapters of devModel

func (*DevModelGCP) SetBondAdapters added in v1.0.0

func (ctx *DevModelGCP) SetBondAdapters(bonds []*config.BondAdapter)

SetBondAdapters sets Bond adapters of devModel

func (*DevModelGCP) SetNetworks added in v1.0.0

func (ctx *DevModelGCP) SetNetworks(networks []*config.NetworkConfig)

SetNetworks sets networks of devModel

func (*DevModelGCP) SetPhysicalIOs

func (ctx *DevModelGCP) SetPhysicalIOs(physicalIOs []*config.PhysicalIO)

SetPhysicalIOs sets physicalIOs of devModel

func (*DevModelGCP) SetVlanAdapters added in v1.0.0

func (ctx *DevModelGCP) SetVlanAdapters(vlans []*config.VlanAdapter)

SetVlanAdapters sets Vlan adapters of devModel

func (*DevModelGCP) SetWiFiParams

func (ctx *DevModelGCP) SetWiFiParams(_ string, _ string)

SetWiFiParams not implemented for Qemu

func (*DevModelGCP) VlanAdapters added in v1.0.0

func (ctx *DevModelGCP) VlanAdapters() []*config.VlanAdapter

VlanAdapters returns Vlan adapters of devModel

type DevModelGeneral

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

DevModelGeneral is dev model fields

func (*DevModelGeneral) AdapterForSwitches

func (ctx *DevModelGeneral) AdapterForSwitches() []string

AdapterForSwitches returns adapterForSwitches of devModel

func (*DevModelGeneral) Adapters

func (ctx *DevModelGeneral) Adapters() []*config.SystemAdapter

Adapters returns adapters of devModel

func (*DevModelGeneral) BondAdapters added in v1.0.0

func (ctx *DevModelGeneral) BondAdapters() []*config.BondAdapter

BondAdapters returns Bond adapters of devModel

func (*DevModelGeneral) Config

func (ctx *DevModelGeneral) Config() map[string]interface{}

Config returns map with config overwrites

func (*DevModelGeneral) DevModelType

func (ctx *DevModelGeneral) DevModelType() string

DevModelType returns devModelType of devModel

func (*DevModelGeneral) DiskFormat

func (ctx *DevModelGeneral) DiskFormat() string

DiskFormat to use for build image

func (*DevModelGeneral) DiskReadyMessage

func (ctx *DevModelGeneral) DiskReadyMessage() string

DiskReadyMessage to show when image is ready

func (*DevModelGeneral) GetPortConfig

func (ctx *DevModelGeneral) GetPortConfig(_ string, _ string) string

GetPortConfig returns PortConfig overwrite

func (*DevModelGeneral) Networks

func (ctx *DevModelGeneral) Networks() []*config.NetworkConfig

Networks returns networks of devModel

func (*DevModelGeneral) PhysicalIOs

func (ctx *DevModelGeneral) PhysicalIOs() []*config.PhysicalIO

PhysicalIOs returns physicalIOs of devModel

func (*DevModelGeneral) SetAdapters added in v1.0.0

func (ctx *DevModelGeneral) SetAdapters(adapters []*config.SystemAdapter)

SetAdapters sets systems adapters of devModel

func (*DevModelGeneral) SetBondAdapters added in v1.0.0

func (ctx *DevModelGeneral) SetBondAdapters(bonds []*config.BondAdapter)

SetBondAdapters sets Bond adapters of devModel

func (*DevModelGeneral) SetNetworks added in v1.0.0

func (ctx *DevModelGeneral) SetNetworks(networks []*config.NetworkConfig)

SetNetworks sets networks of devModel

func (*DevModelGeneral) SetPhysicalIOs

func (ctx *DevModelGeneral) SetPhysicalIOs(physicalIOs []*config.PhysicalIO)

SetPhysicalIOs sets physicalIOs of devModel

func (*DevModelGeneral) SetVlanAdapters added in v1.0.0

func (ctx *DevModelGeneral) SetVlanAdapters(vlans []*config.VlanAdapter)

SetVlanAdapters sets Vlan adapters of devModel

func (*DevModelGeneral) SetWiFiParams

func (ctx *DevModelGeneral) SetWiFiParams(_ string, _ string)

SetWiFiParams not implemented for Qemu

func (*DevModelGeneral) VlanAdapters added in v1.0.0

func (ctx *DevModelGeneral) VlanAdapters() []*config.VlanAdapter

VlanAdapters returns Vlan adapters of devModel

type DevModelParallels

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

DevModelParallels is dev model fields

func (*DevModelParallels) AdapterForSwitches

func (ctx *DevModelParallels) AdapterForSwitches() []string

AdapterForSwitches returns adapterForSwitches of devModel

func (*DevModelParallels) Adapters

func (ctx *DevModelParallels) Adapters() []*config.SystemAdapter

Adapters returns adapters of devModel

func (*DevModelParallels) BondAdapters added in v1.0.0

func (ctx *DevModelParallels) BondAdapters() []*config.BondAdapter

BondAdapters returns Bond adapters of devModel

func (*DevModelParallels) Config

func (ctx *DevModelParallels) Config() map[string]interface{}

Config returns map with config overwrites

func (*DevModelParallels) DevModelType

func (ctx *DevModelParallels) DevModelType() string

DevModelType returns devModelType of devModel

func (*DevModelParallels) DiskFormat

func (ctx *DevModelParallels) DiskFormat() string

DiskFormat to use for build image

func (*DevModelParallels) DiskReadyMessage

func (ctx *DevModelParallels) DiskReadyMessage() string

DiskReadyMessage ready message

func (*DevModelParallels) GetPortConfig

func (ctx *DevModelParallels) GetPortConfig(_ string, _ string) string

GetPortConfig not implemented for parallels

func (*DevModelParallels) Networks

func (ctx *DevModelParallels) Networks() []*config.NetworkConfig

Networks returns networks of devModel

func (*DevModelParallels) PhysicalIOs

func (ctx *DevModelParallels) PhysicalIOs() []*config.PhysicalIO

PhysicalIOs returns physicalIOs of devModel

func (*DevModelParallels) SetAdapters added in v1.0.0

func (ctx *DevModelParallels) SetAdapters(adapters []*config.SystemAdapter)

SetAdapters sets systems adapters of devModel

func (*DevModelParallels) SetBondAdapters added in v1.0.0

func (ctx *DevModelParallels) SetBondAdapters(bonds []*config.BondAdapter)

SetBondAdapters sets Bond adapters of devModel

func (*DevModelParallels) SetNetworks added in v1.0.0

func (ctx *DevModelParallels) SetNetworks(networks []*config.NetworkConfig)

SetNetworks sets networks of devModel

func (*DevModelParallels) SetPhysicalIOs

func (ctx *DevModelParallels) SetPhysicalIOs(physicalIOs []*config.PhysicalIO)

SetPhysicalIOs sets physicalIOs of devModel

func (*DevModelParallels) SetVlanAdapters added in v1.0.0

func (ctx *DevModelParallels) SetVlanAdapters(vlans []*config.VlanAdapter)

SetVlanAdapters sets Vlan adapters of devModel

func (*DevModelParallels) SetWiFiParams

func (ctx *DevModelParallels) SetWiFiParams(_ string, _ string)

SetWiFiParams not implemented for parallels

func (*DevModelParallels) VlanAdapters added in v1.0.0

func (ctx *DevModelParallels) VlanAdapters() []*config.VlanAdapter

VlanAdapters returns Vlan adapters of devModel

type DevModelQemu

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

DevModelQemu is dev model fields

func (*DevModelQemu) AdapterForSwitches

func (ctx *DevModelQemu) AdapterForSwitches() []string

AdapterForSwitches returns adapterForSwitches of devModel

func (*DevModelQemu) Adapters

func (ctx *DevModelQemu) Adapters() []*config.SystemAdapter

Adapters returns adapters of devModel

func (*DevModelQemu) BondAdapters added in v1.0.0

func (ctx *DevModelQemu) BondAdapters() []*config.BondAdapter

BondAdapters returns Bond adapters of devModel

func (*DevModelQemu) Config

func (ctx *DevModelQemu) Config() map[string]interface{}

Config returns map with config overwrites

func (*DevModelQemu) DevModelType

func (ctx *DevModelQemu) DevModelType() string

DevModelType returns devModelType of devModel

func (*DevModelQemu) DiskFormat

func (ctx *DevModelQemu) DiskFormat() string

DiskFormat to use for build image

func (*DevModelQemu) DiskReadyMessage

func (ctx *DevModelQemu) DiskReadyMessage() string

DiskReadyMessage to show when image is ready

func (*DevModelQemu) GetPortConfig

func (ctx *DevModelQemu) GetPortConfig(_ string, _ string) string

GetPortConfig returns PortConfig overwrite

func (*DevModelQemu) Networks

func (ctx *DevModelQemu) Networks() []*config.NetworkConfig

Networks returns networks of devModel

func (*DevModelQemu) PhysicalIOs

func (ctx *DevModelQemu) PhysicalIOs() []*config.PhysicalIO

PhysicalIOs returns physicalIOs of devModel

func (*DevModelQemu) SetAdapters added in v1.0.0

func (ctx *DevModelQemu) SetAdapters(adapters []*config.SystemAdapter)

SetAdapters sets systems adapters of devModel

func (*DevModelQemu) SetBondAdapters added in v1.0.0

func (ctx *DevModelQemu) SetBondAdapters(bonds []*config.BondAdapter)

SetBondAdapters sets Bond adapters of devModel

func (*DevModelQemu) SetNetworks added in v1.0.0

func (ctx *DevModelQemu) SetNetworks(networks []*config.NetworkConfig)

SetNetworks sets networks of devModel

func (*DevModelQemu) SetPhysicalIOs

func (ctx *DevModelQemu) SetPhysicalIOs(physicalIOs []*config.PhysicalIO)

SetPhysicalIOs sets physicalIOs of devModel

func (*DevModelQemu) SetVlanAdapters added in v1.0.0

func (ctx *DevModelQemu) SetVlanAdapters(vlans []*config.VlanAdapter)

SetVlanAdapters sets Vlan adapters of devModel

func (*DevModelQemu) SetWiFiParams

func (ctx *DevModelQemu) SetWiFiParams(_ string, _ string)

SetWiFiParams not implemented for Qemu

func (*DevModelQemu) VlanAdapters added in v1.0.0

func (ctx *DevModelQemu) VlanAdapters() []*config.VlanAdapter

VlanAdapters returns Vlan adapters of devModel

type DevModelRpi

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

DevModelRpi is dev model fields

func (*DevModelRpi) AdapterForSwitches

func (ctx *DevModelRpi) AdapterForSwitches() []string

AdapterForSwitches returns adapterForSwitches of devModel

func (*DevModelRpi) Adapters

func (ctx *DevModelRpi) Adapters() []*config.SystemAdapter

Adapters returns adapters of devModel

func (*DevModelRpi) BondAdapters added in v1.0.0

func (ctx *DevModelRpi) BondAdapters() []*config.BondAdapter

BondAdapters returns Bond adapters of devModel

func (*DevModelRpi) Config

func (ctx *DevModelRpi) Config() map[string]interface{}

Config returns map with config overwrites

func (*DevModelRpi) DevModelType

func (ctx *DevModelRpi) DevModelType() string

DevModelType returns devModelType of devModel

func (*DevModelRpi) DiskFormat

func (ctx *DevModelRpi) DiskFormat() string

DiskFormat to use for build image

func (*DevModelRpi) DiskReadyMessage

func (ctx *DevModelRpi) DiskReadyMessage() string

DiskReadyMessage to show when image is ready

func (*DevModelRpi) GetPortConfig

func (ctx *DevModelRpi) GetPortConfig(ssid string, psk string) string

GetPortConfig returns PortConfig overwrite

func (*DevModelRpi) Networks

func (ctx *DevModelRpi) Networks() []*config.NetworkConfig

Networks returns networks of devModel

func (*DevModelRpi) PhysicalIOs

func (ctx *DevModelRpi) PhysicalIOs() []*config.PhysicalIO

PhysicalIOs returns physicalIOs of devModel

func (*DevModelRpi) SetAdapters added in v1.0.0

func (ctx *DevModelRpi) SetAdapters(adapters []*config.SystemAdapter)

SetAdapters sets systems adapters of devModel

func (*DevModelRpi) SetBondAdapters added in v1.0.0

func (ctx *DevModelRpi) SetBondAdapters(bonds []*config.BondAdapter)

SetBondAdapters sets Bond adapters of devModel

func (*DevModelRpi) SetNetworks added in v1.0.0

func (ctx *DevModelRpi) SetNetworks(networks []*config.NetworkConfig)

SetNetworks sets networks of devModel

func (*DevModelRpi) SetPhysicalIOs

func (ctx *DevModelRpi) SetPhysicalIOs(physicalIOs []*config.PhysicalIO)

SetPhysicalIOs sets physicalIOs of devModel

func (*DevModelRpi) SetVlanAdapters added in v1.0.0

func (ctx *DevModelRpi) SetVlanAdapters(vlans []*config.VlanAdapter)

SetVlanAdapters sets Vlan adapters of devModel

func (*DevModelRpi) SetWiFiParams

func (ctx *DevModelRpi) SetWiFiParams(ssid string, psk string)

SetWiFiParams set ssid and psk for RPI

func (*DevModelRpi) VlanAdapters added in v1.0.0

func (ctx *DevModelRpi) VlanAdapters() []*config.VlanAdapter

VlanAdapters returns Vlan adapters of devModel

type DevModelVBox

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

DevModelVBox is dev model fields

func (*DevModelVBox) AdapterForSwitches

func (ctx *DevModelVBox) AdapterForSwitches() []string

AdapterForSwitches returns adapterForSwitches of DevModelVBox

func (*DevModelVBox) Adapters

func (ctx *DevModelVBox) Adapters() []*config.SystemAdapter

Adapters returns adapters of DevModelVBox

func (*DevModelVBox) BondAdapters added in v1.0.0

func (ctx *DevModelVBox) BondAdapters() []*config.BondAdapter

BondAdapters returns Bond adapters of devModel

func (*DevModelVBox) Config

func (ctx *DevModelVBox) Config() map[string]interface{}

Config returns map with config overwrites

func (*DevModelVBox) DevModelType

func (ctx *DevModelVBox) DevModelType() string

DevModelType returns devModelType of DevModelVBox

func (*DevModelVBox) DiskFormat

func (ctx *DevModelVBox) DiskFormat() string

DiskFormat to use for build image

func (*DevModelVBox) DiskReadyMessage

func (ctx *DevModelVBox) DiskReadyMessage() string

DiskReadyMessage to show when image is ready

func (*DevModelVBox) GetPortConfig

func (ctx *DevModelVBox) GetPortConfig(_ string, _ string) string

GetPortConfig returns PortConfig overwrite

func (*DevModelVBox) Networks

func (ctx *DevModelVBox) Networks() []*config.NetworkConfig

Networks returns networks of DevModelVBox

func (*DevModelVBox) PhysicalIOs

func (ctx *DevModelVBox) PhysicalIOs() []*config.PhysicalIO

PhysicalIOs returns physicalIOs of DevModelVBox

func (*DevModelVBox) SetAdapters added in v1.0.0

func (ctx *DevModelVBox) SetAdapters(adapters []*config.SystemAdapter)

SetAdapters sets systems adapters of devModel

func (*DevModelVBox) SetBondAdapters added in v1.0.0

func (ctx *DevModelVBox) SetBondAdapters(bonds []*config.BondAdapter)

SetBondAdapters sets Bond adapters of devModel

func (*DevModelVBox) SetNetworks added in v1.0.0

func (ctx *DevModelVBox) SetNetworks(networks []*config.NetworkConfig)

SetNetworks sets networks of devModel

func (*DevModelVBox) SetPhysicalIOs

func (ctx *DevModelVBox) SetPhysicalIOs(physicalIOs []*config.PhysicalIO)

SetPhysicalIOs sets physicalIOs of devModel

func (*DevModelVBox) SetVlanAdapters added in v1.0.0

func (ctx *DevModelVBox) SetVlanAdapters(vlans []*config.VlanAdapter)

SetVlanAdapters sets Vlan adapters of devModel

func (*DevModelVBox) SetWiFiParams

func (ctx *DevModelVBox) SetWiFiParams(_ string, _ string)

SetWiFiParams not implemented for VBox

func (*DevModelVBox) VlanAdapters added in v1.0.0

func (ctx *DevModelVBox) VlanAdapters() []*config.VlanAdapter

VlanAdapters returns Vlan adapters of devModel

type ModelFile

type ModelFile struct {
	IOMemberList []*PhysicalIO         `json:"ioMemberList,omitempty"`
	VlanAdapters []*config.VlanAdapter `json:"vlanAdapters,omitempty"`
	BondAdapters []*config.BondAdapter `json:"bondAdapters,omitempty"`

	// The lists below are usually not part of the device model,
	// but instead are configured dynamically in run-time.
	// However, the separation between static and dynamic config
	// is fully up to the controller, EVE receives config as a whole
	// and is able to handle run-time change of most of the config items.
	// Here in eden we allow to override otherwise hard-coded networks and
	// systemAdapters and to create fully customized configurations.
	Networks       []*config.NetworkConfig `json:"networks,omitempty"`
	SystemAdapters []*config.SystemAdapter `json:"systemAdapterList,omitempty"`
}

ModelFile for loading model from file

type PhysicalIO

type PhysicalIO struct {
	Ztype        evecommon.PhyIoType        `json:"ztype,omitempty"`
	Phylabel     string                     `json:"phylabel,omitempty"`
	Phyaddrs     map[string]string          `json:"phyaddrs,omitempty"`
	Logicallabel string                     `json:"logicallabel,omitempty"`
	Assigngrp    string                     `json:"assigngrp,omitempty"`
	Usage        evecommon.PhyIoMemberUsage `json:"usage,omitempty"`
	UsagePolicy  *config.PhyIOUsagePolicy   `json:"usagePolicy,omitempty"`
	Cbattr       map[string]string          `json:"cbattr,omitempty"`
}

PhysicalIO type for translation models into format of EVE`s config.PhysicalIO

Jump to

Keyboard shortcuts

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