ccj

package
v0.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 18, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildApplicationNodeMetadata

func BuildApplicationNodeMetadata(paddle Paddle, existingMetadata configs.ApplicationNodeMetadataMap) (configs.ApplicationNodeMetadataMap, error)

func BuildExpectedHardwareState

func BuildExpectedHardwareState(paddle Paddle, cabinetLookup configs.CabinetLookup, applicationNodeMetadata configs.ApplicationNodeMetadataMap, switchAliasesOverrides map[string][]string, ignoreUnknownCANUHardwareArchitectures bool) (sls_common.SLSState, error)

func BuildNodeExtraProperties

func BuildNodeExtraProperties(topologyNode TopologyNode) (extraProperties sls_common.ComptypeNode, err error)

BuildNodeExtraProperties will attempt to build up all of the known extra properties form a Node present in a CCJ. Limiitations the following information is not populated: - Management NCN NID - Application Node Subrole and Alias

func BuildNodeXname

func BuildNodeXname(topologyNode TopologyNode, paddle Paddle, extraProperties sls_common.ComptypeNode) (xnames.Node, error)

func BuildSLSHardware

func BuildSLSHardware(topologyNode TopologyNode, paddle Paddle, cabinetLookup configs.CabinetLookup, applicationNodeMetadata configs.ApplicationNodeMetadataMap, switchAliasesOverrides map[string][]string) (sls_common.GenericHardware, error)

func BuildSLSMgmtSwitchConnector

func BuildSLSMgmtSwitchConnector(hardware sls_common.GenericHardware, topologyNode TopologyNode, paddle Paddle) (sls_common.GenericHardware, error)

func DetermineCabinetLookup

func DetermineCabinetLookup(paddle Paddle) (configs.CabinetLookup, error)

Types

type Location

type Location struct {
	Elevation   string `json:"elevation"`
	Rack        string `json:"rack"`
	Parent      string `json:"parent"`       // TODO optional field make ptr or add ignore empty
	SubLocation string `json:"sub_location"` // TODO optional make ptr or add ignore empty
}

The Location type defines where the server physically exists in the datacenter.

type Paddle

type Paddle struct {
	Architecture string         `json:"architecture"`
	CanuVersion  string         `json:"canu_version"`
	ShcdFile     string         `json:"shcd_file"`
	UpdatedAt    string         `json:"updated_at"`
	Topology     []TopologyNode `json:"topology"`
}

func (*Paddle) FindCommonName

func (p *Paddle) FindCommonName(commonName string) (TopologyNode, bool)

func (*Paddle) FindNodeByID

func (p *Paddle) FindNodeByID(id int) (TopologyNode, bool)

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 TopologyNode

type TopologyNode 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"`
}

func (*TopologyNode) FindPorts

func (tp *TopologyNode) FindPorts(slot string) []Port

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL