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,omitempty"` DestinationLocation string `json:"DestinationLocation,omitempty"` DestinationPort string `json:"DestinationPort,omitempty"` }
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 each entry in the array
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 Location ¶
type Location struct { Elevation string `json:"elevation"` Rack string `json:"rack"` Parent string `json:parent,omitempty` SubLocation string `json:sub_location,omitempty` }
The Location type defines where the server physically exists in the datacenter.
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
func NewShcd ¶
NewShcd functions reads the shcd file, parses and and returns a new Shcd object with the json file data filled into the struct.
func ParseSHCD ¶
ParseSHCD accepts a machine-readable SHCD and produces an Shcd object, which can be used throughout csi It is the golang and csi equivalent of the shcd.json file generated by canu
func (*Shcd) DestCommonName ¶ added in v1.27.5
DestCommonName returns the name object that is the destination of a specific port
func (*Shcd) DestElevation ¶ added in v1.27.5
DestElevation returns the elevation object that is the destination of a specific port
func (*Shcd) DestID ¶ added in v1.27.5
DestID returns the id object that is the destination of a specific port
type SwitchMetadata ¶
type SwitchMetadata []Switch
SwitchMetadata type is the go equivalent structure of switch_metadata.csv