sls_common

package
v1.29.0 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2022 License: MIT Imports: 5 Imported by: 14

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HMSStringTypeToHMSType

func HMSStringTypeToHMSType(str HMSStringType) xnametypes.HMSType

HMSStringTypeToHMSType converts an HMSStringType (from this module) into an HMSType (from hmstypes.go)

func IsCabinetTypeValid

func IsCabinetTypeValid(class CabinetType) bool

Verify that a cabinet type/class is valid.

Types

type CabinetNetworks

type CabinetNetworks struct {
	CIDR       string `json:"CIDR"`
	Gateway    string `json:",omitempty"`
	VLan       int    `json:",omitempty"`
	IPv6Prefix string `json:",omitempty"`
	MACPrefix  string `json:",omitempty"`
}

type CabinetType

type CabinetType string

CabinetType tells us what physical hardware profile is in use. One of River, Mountain or Hill.

const (
	ClassRiver    CabinetType = "River"    // River rack
	ClassMountain CabinetType = "Mountain" // Mountain rack
	ClassHill     CabinetType = "Hill"     // Hill (combined) rack
)

Valid CabinetType values

type ComptypeBmcNic

type ComptypeBmcNic struct {
	IP6Addr  string   `json:"IP6addr,omitempty"`
	IP4Addr  string   `json:"IP4addr,omitempty"`
	Username string   `json:"Username,omitempty"`
	Password string   `json:"Password,omitempty"`
	Networks []string `json:"Networks"`
	Peers    []string `json:"Peers"`
}

ComptypeBmcNic represents a comptype_bmc_nic, the NIC associated with a BMC.

type ComptypeCDUMgmtSwitch

type ComptypeCDUMgmtSwitch struct {
	Brand   string   `json:"Brand,omitempty"`
	Model   string   `json:"Model,omitempty"`
	Aliases []string `json:"Aliases,omitempty"`
}

ComptypeCDUMgmtSwitch represents a comptype_cdu_mgmt_switch, (aka: a management switch in a mountain CDU)

type ComptypeCabPduNic

type ComptypeCabPduNic struct {
	Networks []string `json:"Networks"`
	Peers    []string `json:"Peers"`
}

ComptypeCabPduNic represents a comptype_cab_pdu_nic, the NIC associated with a cabinet-level power distribution unit (PDU)

type ComptypeCabinet

type ComptypeCabinet struct {
	Model string `json:"Model,omitempty"`

	// Networks has at the top the hardware type, then inside of that the network ID, then inside of that the object.
	Networks          map[string]map[string]CabinetNetworks
	DHCPRelaySwitches []string `json:",omitempty"`
}

ComptypeCabinet represents an object of type comptype_cabinet.

"x3000": {
  "Class":  "River",
  "ExtraProperties": {
    "Networks": {
      "cn": {
        "HMN": {"CIDR": "10.254.0.0/22"},
        "NMN": {"CIDR": "10.252.0.0/22"}
      },
      "ncn": {
        "HMN": {"CIDR": "10.254.0.0/22"},
        "NMN": {"CIDR": "10.252.0.0/22"}
      }
    }
  },
  "Parent": "s0",
  "Type":   "comptype_cabinet",
  "Xname":  "x3000"
},

type ComptypeChassisBmc

type ComptypeChassisBmc struct {
	Aliases []string `json:"Aliases,omitempty"`
}

ComptypeChassisBmc represents a comptype_chassis_bmc, the BMC of a chassis

type ComptypeCompmod

type ComptypeCompmod struct {
	PowerConnector string `json:"PowerConenctor,omitempty"`
}

ComptypeCompmod represents a comptype_compmod, a Mountain cabinet compute blade slot or River rack compute blade slot.

type ComptypeCompmodPowerConnector

type ComptypeCompmodPowerConnector struct {
	PoweredBy []string `json:"PoweredBy"`
}

ComptypeCompmodPowerConnector represetns an object of type comptype_compmod_power_connector (aka: a power connection for a River blade)

type ComptypeHSNConnector

type ComptypeHSNConnector struct {
	NodeNics []string `json:"NodeNics"`
}

ComptypeHSNConnector represents a comptype_hsn_connector, aka: a HSN cable.

type ComptypeMgmtHLSwitch

type ComptypeMgmtHLSwitch struct {
	IP6Addr          string `json:"IP6addr,omitempty"`
	IP4Addr          string `json:"IP4addr,omitempty"`
	Brand            string `json:"Brand,omitempty"`
	Model            string `json:"Model,omitempty"`
	SNMPAuthPassword string `json:"SNMPAuthPassword,omitempty"`
	SNMPAuthProtocol string `json:"SNMPAuthProtocol,omitempty"`
	SNMPPrivPassword string `json:"SNMPPrivPassword,omitempty"`
	SNMPPrivProtocol string `json:"SNMPPrivProtocol,omitempty"`
	SNMPUsername     string `json:"SNMPUsername,omitempty"`

	Aliases []string `json:"Aliases,omitempty"`
}

ComptypeMgmtHLSwitch represents a comptype_hl_switch (aka: a higher level management switch, such as Spine or Aggergation switch on the management (NMN or HMN) network(s))

type ComptypeMgmtSwitch

type ComptypeMgmtSwitch struct {
	IP6Addr          string `json:"IP6addr,omitempty"`
	IP4Addr          string `json:"IP4addr,omitempty"`
	Brand            string `json:"Brand,omitempty"`
	Model            string `json:"Model,omitempty"`
	SNMPAuthPassword string `json:"SNMPAuthPassword,omitempty"`
	SNMPAuthProtocol string `json:"SNMPAuthProtocol,omitempty"`
	SNMPPrivPassword string `json:"SNMPPrivPassword,omitempty"`
	SNMPPrivProtocol string `json:"SNMPPrivProtocol,omitempty"`
	SNMPUsername     string `json:"SNMPUsername,omitempty"`

	Aliases []string `json:"Aliases,omitempty"`
}

ComptypeMgmtSwitch represents a comptype_mgmt_switch (aka: a switch on the management (NMN or HMN) network(s))

"IP4addr":          "127.0.0.1",
"Model":            "S3048T-ON",
"SNMPAuthPassword": "vault://hms-creds/x3000c0w22",
"SNMPAuthProtocol": "MD5",
"SNMPPrivPassword": "vault://hms-creds/x3000c0w22",
"SNMPPrivProtocol": "DES",
"SNMPUsername":     "testuser"

type ComptypeMgmtSwitchConnector

type ComptypeMgmtSwitchConnector struct {
	NodeNics   []string `json:"NodeNics"`
	VendorName string
}

ComptypeMgmtSwitchConnector represents a comptye_mgmt_switch_connector, or a port on a management switch

type ComptypeNode

type ComptypeNode struct {
	NID     int      `json:"NID,omitempty"`
	Role    string   `json:"Role,omitempty"`
	SubRole string   `json:"SubRole,omitempty"`
	Aliases []string `json:"Aliases,omitempty"`
}

ComptypeNode is a comptype_node, representing a node on a Mountain compute Blade, or node on a River node blade.

type ComptypeNodeBmc

type ComptypeNodeBmc struct {
	IP6Addr  string `json:"IP6addr,omitempty"`
	IP4Addr  string `json:"IP4addr,omitempty"`
	Username string `json:"Username,omitempty"`
	Password string `json:"Password,omitempty"`

	Aliases []string `json:"Aliases,omitempty"`
}

ComptypeNodeBmc represents a comptype_nodecard, the BMC of a compute node

type ComptypeNodeHsnNic

type ComptypeNodeHsnNic struct {
	Networks []string `json:"Networks"`
	Peers    []string `json:"Peers"`
}

ComptypeNodeHsnNic represents a comptype_node_hsn_nic, the network interface to the HSN on a compute node.

type ComptypeNodeNic

type ComptypeNodeNic struct {
	Networks []string `json:"Networks"`
	Peers    []string `json:"Peers"`
}

ComptypeNodeNic is a comptyep_node_nic and represents a non-HSN compute node NIC

type ComptypeRtrBmc

type ComptypeRtrBmc struct {
	IP6Addr  string `json:"IP6addr,omitempty"`
	IP4Addr  string `json:"IP4addr,omitempty"`
	Username string `json:"Username,omitempty"`
	Password string `json:"Password,omitempty"`
}

ComptypeRtrBmc represents a comptype_rtr_bmc, or the BMC of a switch controller or TOR switch

type ComptypeRtrBmcNic

type ComptypeRtrBmcNic struct {
	Networks []string `json:"Networks"`
	Peers    []string `json:"Peers"`
}

ComptypeRtrBmcNic represents a comptype_rtr_bc_nic, which is the physical network interface port of a BMC for a switch controller or TOR switch

type ComptypeRtrMod

type ComptypeRtrMod struct {
	PowerConnector string `json:"PowerConenctor,omitempty"`
}

ComptypeRtrMod is a comptype_rtrmod and represents a Mountain router module or River top-of-rack switch

type GenericHardware

type GenericHardware struct {
	Parent             string             `json:"Parent"`
	Children           []string           `json:"Children,omitempty"`
	Xname              string             `json:"Xname"`
	Type               HMSStringType      `json:"Type"`
	Class              CabinetType        `json:"Class"`
	TypeString         xnametypes.HMSType `json:"TypeString"`
	LastUpdated        int64              `json:"LastUpdated,omitempty"`
	LastUpdatedTime    string             `json:"LastUpdatedTime,omitempty"`
	ExtraPropertiesRaw interface{}        `json:"ExtraProperties,omitempty"`
	VaultData          interface{}        `json:"VaultData,omitempty"`
}

GenericHardware is the top level type for hardware in the database. See the Type property to cast it to whatever type it actually represets.

func NewGenericHardware added in v1.23.0

func NewGenericHardware(xname string, class CabinetType, extraProperties interface{}) GenericHardware

func (*GenericHardware) FromJson

func (gh *GenericHardware) FromJson(in string) error

func (*GenericHardware) GetChildren

func (gh *GenericHardware) GetChildren() []string

GetChildren returns a slice of strings, where each entry is an xname of a child.

func (*GenericHardware) GetClass

func (gh *GenericHardware) GetClass() CabinetType

func (*GenericHardware) GetParent

func (gh *GenericHardware) GetParent() string

GetParent returns the string xname of the parent of this object.

func (*GenericHardware) GetType

func (gh *GenericHardware) GetType() HMSStringType

func (*GenericHardware) GetTypeString

func (gh *GenericHardware) GetTypeString() xnametypes.HMSType

func (*GenericHardware) GetXname

func (gh *GenericHardware) GetXname() string

GetXname gets the xname of this object

func (*GenericHardware) SetChildren

func (gh *GenericHardware) SetChildren(children []string)

func (*GenericHardware) SetParent

func (gh *GenericHardware) SetParent(xname string)

func (*GenericHardware) SetXname

func (gh *GenericHardware) SetXname(xn string)

func (*GenericHardware) ToJson

func (gh *GenericHardware) ToJson() (*string, error)

type GenericHardwareArray

type GenericHardwareArray []GenericHardware

type HMSStringType

type HMSStringType string

HMSStringType represents the type of a piece of hardware in the "HSS Component Naming Convention" format

const (
	CDU                      HMSStringType = "comptype_cdu"                   // dD
	CDUMgmtSwitch            HMSStringType = "comptype_cdu_mgmt_switch"       // dDwW
	CabinetCDU               HMSStringType = "comptype_cab_cdu"               // xXdD
	Cabinet                  HMSStringType = "comptype_cabinet"               // xX
	CabinetPDUController     HMSStringType = "comptype_cab_pdu_controller"    // xXmM
	CabinetPDU               HMSStringType = "comptype_cab_pdu"               // xXmMpP
	CabinetPDUNic            HMSStringType = "comptype_cab_pdu_nic"           // xXmMiI
	CabinetPDUOutlet         HMSStringType = "comptype_cab_pdu_outlet"        // xXmMpPjJ DEPRECATED
	CabinetPDUPowerConnector HMSStringType = "comptype_cab_pdu_pwr_connector" // xXmMpPvV

	Chassis            HMSStringType = "comptype_chassis"                 // xXcC
	ChassisBMC         HMSStringType = "comptype_chassis_bmc"             // xXcCbB
	CMMRectifier       HMSStringType = "comptype_cmm_rectifier"           // xXcCtT
	CMMFpga            HMSStringType = "comptype_cmm_fpga"                // xXcCfF
	CEC                HMSStringType = "comptype_cec"                     // xXeE
	ComputeModule      HMSStringType = "comptype_compmod"                 // xXcCsS
	RouterModule       HMSStringType = "comptype_rtrmod"                  // xXcCrR
	NodeBMC            HMSStringType = "comptype_ncard"                   // xXcCsSbB
	NodeBMCNic         HMSStringType = "comptype_bmc_nic"                 // xXcCsSbBiI
	NodeEnclosure      HMSStringType = "comptype_node_enclosure"          // xXcCsSeE
	NodePowerConnector HMSStringType = "comptype_compmod_power_connector" // xXcCsSvV
	Node               HMSStringType = "comptype_node"                    // xXcCsSbBnN
	Processor          HMSStringType = "comptype_node_processor"          // xXcCsSbBnNpP
	NodeNIC            HMSStringType = "comptype_node_nic"                // xXcCsSbBnNiI
	NodeHsnNIC         HMSStringType = "comptype_node_hsn_nic"            // xXcCsSbBnNhH
	Memory             HMSStringType = "comptype_dimm"                    // xXcCsSbBnNdD
	NodeAccel          HMSStringType = "comptype_node_accel"              // xXcCsSbBnNaA
	NodeFpga           HMSStringType = "comptype_node_fpga"               // xXcCsSbBfF
	HSNAsic            HMSStringType = "comptype_hsn_asic"                // xXcCrRaA
	RouterFpga         HMSStringType = "comptype_rtr_fpga"                // xXcCrRfF
	RouterTORFpga      HMSStringType = "comptype_rtr_tor_fpga"            // xXcCrRtTfF
	RouterBMC          HMSStringType = "comptype_rtr_bmc"                 // xXcCrRbB
	RouterBMCNic       HMSStringType = "comptype_rtr_bmc_nic"             // xXcCrRbBiI

	HSNBoard            HMSStringType = "comptype_hsn_board"             // xXcCrReE
	HSNLink             HMSStringType = "comptype_hsn_link"              // xXcCrRaAlL
	HSNConnector        HMSStringType = "comptype_hsn_connector"         // xXcCrRjJ
	HSNConnectorPort    HMSStringType = "comptype_hsn_connector_port"    // xXcCrRjJpP
	MgmtSwitch          HMSStringType = "comptype_mgmt_switch"           // xXcCwW
	MgmtSwitchConnector HMSStringType = "comptype_mgmt_switch_connector" // xXcCwWjJ
	MgmtHLSwitch        HMSStringType = "comptype_hl_switch"             // xXcChHsS

	// Special types and wildcards
	SMSBox         HMSStringType = "comptype_ncn_box"   // smsN
	Partition      HMSStringType = "comptype_partition" // pH.S
	System         HMSStringType = "any"                // s0
	HMSTypeAll     HMSStringType = "comptype_all"       // all
	HMSTypeAllComp HMSStringType = "comptype_all_comp"  // all_comp
	HMSTypeAllSvc  HMSStringType = "comptype_all_svc"   // all_svc
	HMSTypeInvalid HMSStringType = "INVALID"            // Not a valid type/xname
)

func HMSTypeToHMSStringType

func HMSTypeToHMSStringType(str xnametypes.HMSType) HMSStringType

HMSTypeToHMSStringType converts an HMSType (from hmstypes.go) into an HMSStringType (from this module)

func (HMSStringType) String

func (hts HMSStringType) String() string

type IPReservation

type IPReservation struct {
	Name      string   `json:"Name"`
	IPAddress net.IP   `json:"IPAddress"`
	Aliases   []string `json:"Aliases,omitempty"`

	Comment string `json:"Comment,omitempty"`
}

IPReservation is a type for managing IP Reservations

type IPV4Subnet

type IPV4Subnet struct {
	FullName         string          `json:"FullName"`
	CIDR             string          `json:"CIDR"`
	IPReservations   []IPReservation `json:"IPReservations,omitempty"`
	Name             string          `json:"Name"`
	VlanID           int16           `json:"VlanID"`
	Gateway          net.IP          `json:"Gateway"`
	DHCPStart        net.IP          `json:"DHCPStart,omitempty"`
	DHCPEnd          net.IP          `json:"DHCPEnd,omitempty"`
	Comment          string          `json:"Comment,omitempty"`
	ReservationStart net.IP          `json:"ReservationStart,omitempty"`
	ReservationEnd   net.IP          `json:"ReservationEnd,omitempty"`
	MetalLBPoolName  string          `json:"MetalLBPoolName,omitempty"`
}

IPV4Subnet is a type for managing IPv4 Subnets

func (*IPV4Subnet) ReservationsByName added in v1.24.0

func (subnet *IPV4Subnet) ReservationsByName() map[string]IPReservation

ReservationsByName presents the IPReservations in a map by name

type Network

type Network struct {
	Name               string      `json:"Name"`
	FullName           string      `json:"FullName"`
	IPRanges           []string    `json:"IPRanges"`
	Type               NetworkType `json:"Type"`
	LastUpdated        int64       `json:"LastUpdated,omitempty"`
	LastUpdatedTime    string      `json:"LastUpdatedTime,omitempty"`
	ExtraPropertiesRaw interface{} `json:"ExtraProperties,omitempty"`
}

The Network object represents an abstract network. For example, the High Speed Network.

type NetworkArray

type NetworkArray []Network

type NetworkExtraProperties

type NetworkExtraProperties struct {
	CIDR      string  `json:"CIDR"`
	VlanRange []int16 `json:"VlanRange"`
	MTU       int16   `json:"MTU,omitempty"`
	Comment   string  `json:"Comment,omitempty"`
	PeerASN   int     `json:"PeerASN,omitempty"`
	MyASN     int     `json:"MyASN,omitempty"`

	Subnets            []IPV4Subnet `json:"Subnets"`
	SystemDefaultRoute string       `json:"SystemDefaultRoute,omitempty"`
}

NetworkExtraProperties provides additional network information

func (*NetworkExtraProperties) LookupSubnet added in v1.24.0

func (network *NetworkExtraProperties) LookupSubnet(name string) (IPV4Subnet, int, error)

LookupSubnet returns a subnet by name

type NetworkType

type NetworkType string

NetworkType represents valid values for the Type field of the network object

const (
	NetworkTypeSS10       NetworkType = "slingshot10"
	NetworkTypeSS11       NetworkType = "slingshot11"
	NetworkTypeCassini    NetworkType = "cassini"
	NetworkTypeEthernet   NetworkType = "ethernet"
	NetworkTypeOPA        NetworkType = "opa"
	NetworkTypeInfiniband NetworkType = "infiniband"
	NetworkTypeMixed      NetworkType = "mixed"
)

Valid values for NetworkType

func (NetworkType) String

func (nwt NetworkType) String() string

type SLSState

type SLSState struct {
	Hardware map[string]GenericHardware `json:"Hardware"`
	Networks map[string]Network         `json:"Networks"`
}

type SLSVersion

type SLSVersion struct {
	Counter     int    `json:"Counter"`     //Value associated with last update
	LastUpdated string `json:"LastUpdated"` //ISO 8601 timestamp
}

Jump to

Keyboard shortcuts

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