Documentation ¶
Index ¶
- Constants
- func AssignSwpRole(resource *Resource, role Role)
- 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 HasRoles(x *xir.Node, roles ...Role) bool
- func IsXp(x *xir.Endpoint) 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, ptags ...string) *Resource
- func MediumServer(name, imac, xmac string, ptags ...string) *Resource
- func SmallServer(name, imac, xmac string, ptags ...string) *Resource
- func (r *Resource) Eth(i int) *hw.Port
- func (r *Resource) GetEndpointsByRole(n *xir.Node, role Role) []*xir.Endpoint
- 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) HasRoles(roles ...Role) bool
- func (r *Resource) Ipmi(i int) *hw.Port
- func (r *Resource) NextSwp() *hw.Port
- 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 ¶
const ( RoleUnspec Role = 0 Node = 1 InfraServer = 2 ConsoleServer = 3 PowerController = 4 NetworkEmulator = 5 XpSwitch = 6 InfraSwitch = 7 MgmtSwitch = 8 Gateway = 9 Leaf = 10 Fabric = 11 Spine = 12 InfraLink = 13 XpLink = 14 Tor = 15 EmuLink = 16 StorageServer = 17 InfrapodServer = 18 MgmtLink = 19 EtcdHost = 20 MinIOHost = 21 RexHost = 22 DriverHost = 23 ManagerHost = 24 CommanderHost = 25 SledHost = 26 RallyHost = 27 GatewayLink = 28 HarborEndpoint = 29 PDU = 30 EmuSwitch = 31 Hypervisor = 32 PhysicsSimulator = 33 SimLink = 34 )
todo this would be better as a 64-bit flag
Variables ¶
This section is empty.
Functions ¶
func DecodeCable ¶
func GetCableSpec ¶
func HasAllocMode ¶
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 // Physical simulation allocation PhysimAlloc )
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"` ImageVariant string `json:"image_variant,omitempty" mapstructure:"image_variant"` Props xir.Props `json:"xir,omitempty"` //TODO change name to PortRoles/port_roles //system.link.name -> role LinkRoles map[string]Role `json:"link_roles,omitempty" mapstructure:"link_roles"` //system.link.name -> addr PortAddrs map[string]uint32 `json:"port_addrs" mapstructure:"port_addrs"` 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) GetEndpointsByRole ¶
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.
type TBLOM ¶
func CalculateLOM ¶
func CalculateLOM(net *xir.Net) TBLOM
type Tally ¶
func CalculateCost ¶
func CalculateCost(net *xir.Net) Tally