Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HasAllocMode ¶
HasAllocMode checks if the specified node has any of the specified alloc modes.
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 )
type BasicInterfaceConfig ¶
type BasicInterfaceConfig struct {
Ip InterfaceIPConfig
}
type InterfaceIPConfig ¶
type MzLinkInfo ¶
type MzLinkInfo struct {
LinkId int
}
type Resource ¶
type Resource struct { Alloc []AllocMode Roles []Role Props xir.Props LinkRoles map[string]Role //system.link.name -> role System *sys.System }
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 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 (*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 )