Documentation
¶
Index ¶
- func DecodeCable(props xir.Props) *hw.Cable
- func GetCableSpec(x *xir.Link) *hw.Cable
- func HasAllocMode(x *xir.Node, allocModes ...AllocMode) bool
- func HasRole(x *xir.Node, roles ...Role) bool
- func PrintMaterials(tw *tabwriter.Writer, lom LOM, parentQuantity int, depth int)
- func ToXir(t Testbed, name string) *xir.Net
- type AllocMode
- type BasicInterfaceConfig
- type Cost
- type InterfaceIPConfig
- type LOM
- type Material
- type MzLinkInfo
- type Resource
- func DecodeResource(props xir.Props) *Resource
- func GenericFabric(kind, role Role, name, ip string, radix int, gbps uint64) *Resource
- func GenericLeaf(kind Role, name string, radix int, gbps uint64) *Resource
- func GetResourceSpec(x *xir.Node) *Resource
- func LargeServer(name, imac, xmac string) *Resource
- func MediumServer(name, imac, xmac string) *Resource
- func SmallServer(name, imac, xmac string) *Resource
- func (r *Resource) Eth(i int) *hw.Port
- func (r *Resource) GetLinksByRole(role Role) []*sys.Link
- func (r *Resource) HasAllocMode(modes ...AllocMode) bool
- func (r *Resource) HasRole(roles ...Role) bool
- func (r *Resource) Nic(i int) hw.Nic
- func (r *Resource) NicKind(kind string) []hw.Nic
- func (r *Resource) Node() *xir.Node
- func (r *Resource) Port(kind string, i int) *hw.Port
- func (r *Resource) Swp(i int) *hw.Port
- type Role
- type TBLOM
- type Tally
- type TallyItem
- type Testbed
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeCable ¶
func GetCableSpec ¶
func HasAllocMode ¶
HasAllocMode checks if the specified node has any of the specified alloc modes.
func PrintMaterials ¶
Types ¶
type AllocMode ¶
type AllocMode uint16
AllocMode indicates the allocation mode of a resource
const ( // AllocUnspec indicates the resource has no specified allocation mode AllocUnspec AllocMode = iota // NoAlloc indicates the resource cannot be allocated NoAlloc // NetAlloc indicates the resource can be allocated as a network appliance NetAlloc // NetEmuAlloc indicates the resource can be allocated as a network emulator NetEmuAlloc // FilesystemAlloc indicates the resource can be allocated as mass storage FilesystemAlloc // BlockDeviceAlloc indicates the resource can be allocated as a block device // server BlockDeviceAlloc // PhysicalAlloc indicates the resource can be allocated as a physical device PhysicalAlloc // VirtualAlloc indicates the resource can be virtually allocated VirtualAlloc // Infrapod alloc indicates the resource can hold infrapods InfrapodAlloc )
type BasicInterfaceConfig ¶
type BasicInterfaceConfig struct {
Ip InterfaceIPConfig
}
type InterfaceIPConfig ¶
type Material ¶
func (*Material) ConfigItems ¶
type MzLinkInfo ¶
type MzLinkInfo struct {
LinkId int
}
type Resource ¶
type Resource struct { Alloc []AllocMode `json:"alloc"` Roles []Role `json:"roles"` DefaultImage string `json:"default_image,omitempty" mapstructure:"default_image"` Props xir.Props `json:"xir,omitempty"` //system.link.name -> role LinkRoles map[string]Role `json:"link_roles,omitempty"` System *sys.System `json:"-"` }
A Resource captures testbed operation relevant information about a resource. It contains a System object that captures OS level details about the unerlying device.
func DecodeResource ¶
func DecodeResource(props xir.Props) *Resource
DecodeResource attempts to extract and decode a resource spec from a property set. Returns null if a decoding cannot be done.
func GenericFabric ¶
func GetResourceSpec ¶
func GetResourceSpec(x *xir.Node) *Resource
GetResourceSpec attempts to get a testbed resource specification associated with the provided node. If none can be found, nil is returned.
func LargeServer ¶
func MediumServer ¶
func SmallServer ¶
func (*Resource) GetLinksByRole ¶
GetLinksByRole returns all OS level links that have the specified testbed role.
func (*Resource) HasAllocMode ¶
HasAllocMode checks if the resource has any of the specified alloc modes.
type Role ¶
type Role uint16
Role indicates the usage model of a resource in a testbed. A resource may have multiple roles. Roles have an unsigned 16 bit integer identifier. Roles 0-1024 are reserved. The values in the reserved range are defined here.
const ( // RoleUnspec indicates no role is specified RoleUnspec Role = iota // Node indicates the resource is a testbed node Node // InfraServer indicates the resource is an infrastructure server InfraServer // ConsoleServer indicates the resource is a console server ConsoleServer // PowerController indidcates the resource is a power controller PowerController // NetworkEmulator indicates the resource is a network emulator NetworkEmulator // XpSwitch indicates the resource is an experiment plane switch XpSwitch // InfraSwitch indicates the resource is an infrastructure plane switch InfraSwitch // MgmtSwitch indicates the resource is a management plane switch MgmtSwitch // Gateway indicates the resource is a testbed gateway Gateway // Leaf indicates the resource is a leaf switch Leaf // Fabric indicates the resource is a fabric switch Fabric // Spine indicates the resource is a spine switch Spine // InfraLink indicates the resource is an infrastructure link InfraLink // XpLink indicates the resource is an experiment link XpLink // Tor indicates the resource is a top of rack switch Tor // EmuLink indicates that the link carries emulation traffic EmuLink // StorageServer indicates that the server can be used for providing storage StorageServer // InfrapodServer indicates the resource is an infrapod server InfrapodServer // MgmtLink indicates the resource is an experiment link MgmtLink EtcdHost MinIOHost RexHost DriverHost ManagerHost CommanderHost )
type TBLOM ¶
func CalculateLOM ¶
func CalculateLOM(net *xir.Net) TBLOM
type Tally ¶
func CalculateCost ¶
func CalculateCost(net *xir.Net) Tally