Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type HMNComponent ¶
type HMNComponent struct { Source string `json:"Source"` SourceRack string `json:"SourceRack"` SourceLocation string `json:"SourceLocation"` SourceParent string `json:"SourceParent,omitempty"` SourceSubLocation string `json:"SourceSubLocation,omitempty"` DestinationRack string `json:"DestinationRack"` DestinationLocation string `json:"DestinationLocation"` DestinationPort string `json:"DestinationPort"` }
HMNComponent is an individual component in the HMNConnections slice
type HMNConnections ¶
type HMNConnections []HMNComponent
HMNConnections type is the go equivalent structure of hmn_connections.json
type ID ¶
type ID struct { Architecture string `json:"architecture"` CommonName string `json:"common_name"` ID int `json:"id"` Location Location `json:"location"` Model string `json:"model"` Ports []Port `json:"ports"` Type string `json:"type"` Vendor string `json:"vendor"` }
The ID type represents all of the information needed for
func FilterByType ¶
FilterByType loop over the topology and return all items found in a give type.
func (ID) GenerateNCNRoleSubrole ¶
GenerateNCNRoleSubrole generates the appropriate role and subrole based on the ncn-* name
func (ID) GenerateSourceName ¶ added in v1.20.0
GenerateSourceName crafts and prints the switch types that hmn_connections.json expects
func (ID) GenerateSwitchType ¶
GenerateSwitchType crafts and prints the switch types that switch_metadata.csv expects
func (ID) GenerateXname ¶
GenerateXname crafts and prints the xname of a give ID type in the SHCD
type NCNMetadata ¶
type NCNMetadata []NcnMacs
NCNMetadata type is the go equivalent structure of ncn_metadata.csv
type NcnMacs ¶
type NcnMacs struct { Xname string Role string Subrole string BmcMac string BootstrapMac string Bond0Mac0 string Bond0Mac1 string }
NcnMacs is a row in ncn_metadata.csv
type Port ¶
type Port struct { DestNodeID int `json:"destination_node_id"` DestPort int `json:"destination_port"` DestSlot string `json:"destination_slot"` Port int `json:"port"` Slot string `json:"slot"` Speed int `json:"speed"` }
The Port type defines where things are plugged in
type Shcd ¶
type Shcd struct { Architecture string `json:"architecture"` CanuVersion string `json:"canu_version"` ShcdFile string `json:"shcd_file"` UpdatedAt string `json:"updated_at"` Topology []ID `json:"topology"` }
The Shcd type represents the entire machine-readable SHCD inside a go struct
type SwitchMetadata ¶
type SwitchMetadata []Switch
SwitchMetadata type is the go equivalent structure of switch_metadata.csv