Documentation ¶
Index ¶
- func ClearTopology(conn *grpc.ClientConn) error
- func GenerateNetcfg(topologyPath string, netcfgPath string, driver string, pipeconf string) error
- func GenerateTopology(recipePath string, topologyPath string) error
- func LoadTopology(conn *grpc.ClientConn, topologyPath string) error
- type AccessFabric
- type Builder
- type Device
- type GridPosition
- type Host
- type Link
- type NIC
- type Netcfg
- type NetcfgDevice
- type NetcfgDeviceBasic
- type NetcfgHost
- type NetcfgHostBasic
- type PlainFabric
- type Port
- type Recipe
- type SuperSpineFabric
- type Topology
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClearTopology ¶
func ClearTopology(conn *grpc.ClientConn) error
ClearTopology removes all Devices, links and hosts from the simulator
func GenerateNetcfg ¶
GenerateNetcfg loads the specified topology YAML file and uses it to generate ONOS netcfg.json file
func GenerateTopology ¶
GenerateTopology loads the specified topology recipe YAML file and uses the recipe to generate a fully elaborated topology YAML file that can be loaded via LoadTopology
func LoadTopology ¶
func LoadTopology(conn *grpc.ClientConn, topologyPath string) error
LoadTopology loads the specified YAML file and creates the prescribed simulated topology entities using the fabric simulator API client.
Types ¶
type AccessFabric ¶
type AccessFabric struct { Spines int `mapstructure:"spines" yaml:"spines"` SpinePortCount int `mapstructure:"spine_port_count" yaml:"spine_port_count"` LeafPairs int `mapstructure:"leaf_pairs" yaml:"leaf_pairs"` LeafPortCount int `mapstructure:"leaf_port_count" yaml:"leaf_port_count"` SpineTrunk int `mapstructure:"spine_trunk" yaml:"spine_trunk"` PairTrunk int `mapstructure:"pair_trunk" yaml:"pair_trunk"` HostsPerPair int `mapstructure:"hosts_per_pair" yaml:"hosts_per_pair"` }
AccessFabric is a recipe for creating simulated access fabric with spines and paired leaves
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
Builder hods state to assist generating various fabric topologies
func (*Builder) NextAgentPort ¶
NextAgentPort reserves the next available agent port and returns it
func (*Builder) NextDevicePortID ¶
NextDevicePortID reserves the next available port ID and returns it
type Device ¶
type Device struct { ID string `mapstructure:"id" yaml:"id"` ChassisID uint64 `mapstructure:"chassis_id" yaml:"chassis_id"` Type string `mapstructure:"type" yaml:"type"` AgentPort int32 `mapstructure:"agent_port" yaml:"agent_port"` Stopped bool `mapstructure:"stopped" yaml:"stopped"` Ports []Port `mapstructure:"ports" yaml:"ports"` Pos *GridPosition `mapstructure:"pos" yaml:"pos"` }
Device is a description of a simulated device
type GridPosition ¶ added in v0.1.1
GridPosition carries X/Y coordinates of a node
type Host ¶
type Host struct { ID string `mapstructure:"id" yaml:"id"` NICs []NIC `mapstructure:"nics" yaml:"nics"` Pos *GridPosition `mapstructure:"pos" yaml:"pos"` }
Host is a description of a simulated host
type Link ¶
type Link struct { SrcPortID string `mapstructure:"src" yaml:"src"` TgtPortID string `mapstructure:"tgt" yaml:"tgt"` Unidirectional bool `mapstructure:"unidirectional" yaml:"unidirectional"` }
Link is a description of a simulated link
type NIC ¶
type NIC struct { Mac string `mapstructure:"mac" yaml:"mac"` IPv4 string `mapstructure:"ip" yaml:"ip"` IPV6 string `mapstructure:"ipv6" yaml:"ipv6"` Port string `mapstructure:"port" yaml:"port"` }
NIC is a description of a simulated NIC
type Netcfg ¶
type Netcfg struct { Devices map[string]*NetcfgDevice `json:"devices"` Hosts map[string]*NetcfgHost `json:"hosts"` }
Netcfg structure represents ONOS network configuration
type NetcfgDevice ¶
type NetcfgDevice struct {
Basic *NetcfgDeviceBasic `json:"basic"`
}
NetcfgDevice structure represents ONOS device config
type NetcfgDeviceBasic ¶
type NetcfgDeviceBasic struct { Name string `json:"name"` ManagementAddress string `json:"managementAddress"` Driver string `json:"driver"` Pipeconf string `json:"pipeconf"` LocType string `json:"locType"` GridX int `json:"gridX"` GridY int `json:"gridY"` }
NetcfgDeviceBasic structure represents ONOS basic device config
type NetcfgHost ¶ added in v0.1.1
type NetcfgHost struct {
Basic *NetcfgHostBasic `json:"basic"`
}
NetcfgHost structure represents ONOS host config
type NetcfgHostBasic ¶ added in v0.1.1
type NetcfgHostBasic struct { Name string `json:"name"` LocType string `json:"locType"` GridX int `json:"gridX"` GridY int `json:"gridY"` }
NetcfgHostBasic structure represents ONOS basic host config
type PlainFabric ¶ added in v0.1.1
type PlainFabric struct { Spines int `mapstructure:"spines" yaml:"spines"` SpinePortCount int `mapstructure:"spine_port_count" yaml:"spine_port_count"` Leaves int `mapstructure:"leaves" yaml:"leaves"` LeafPortCount int `mapstructure:"leaf_port_count" yaml:"leaf_port_count"` SpineTrunk int `mapstructure:"spine_trunk" yaml:"spine_trunk"` HostsPerLeaf int `mapstructure:"hosts_per_leaf" yaml:"hosts_per_leaf"` }
PlainFabric is a recipe for creating simulated plain leaf-spine fabric
type Port ¶
type Port struct { Number uint32 `mapstructure:"number" yaml:"number"` SDNNumber uint32 `mapstructure:"sdn_number" yaml:"sdn_number"` Speed string `mapstructure:"speed" yaml:"speed"` }
Port is a description of a simulated port
type Recipe ¶
type Recipe struct { SuperSpineFabric *SuperSpineFabric `mapstructure:"superspine_fabric" yaml:"superspine_fabric"` AccessFabric *AccessFabric `mapstructure:"access_fabric" yaml:"access_fabric"` PlainFabric *PlainFabric `mapstructure:"plain_fabric" yaml:"plain_fabric"` }
Recipe is a container for holding one of the supported simulated topology recipes
type SuperSpineFabric ¶
type SuperSpineFabric struct { }
SuperSpineFabric is a recipe for creating simulated 4 rack fabric with superspines
type Topology ¶
type Topology struct { Devices []Device `mapstructure:"Devices" yaml:"Devices"` Links []Link `mapstructure:"links" yaml:"links"` Hosts []Host `mapstructure:"hosts" yaml:"hosts"` }
Topology is a description of a simulated network topology
func GenerateAccessFabric ¶
func GenerateAccessFabric(fabric *AccessFabric) *Topology
GenerateAccessFabric generates topology YAML from the specified access fabric recipe
func GeneratePlainFabric ¶ added in v0.1.1
func GeneratePlainFabric(fabric *PlainFabric) *Topology
GeneratePlainFabric generates topology YAML from the specified spine-leaf fabric recipe
func GenerateSuperSpineFabric ¶
func GenerateSuperSpineFabric(fabric *SuperSpineFabric) *Topology
GenerateSuperSpineFabric generates topology YAML from the specified super-spine fabric recipe