hardwaretypes

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

* * MIT License * * (C) Copyright 2023 Hewlett Packard Enterprise Development LP * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. *

* * MIT License * * (C) Copyright 2023 Hewlett Packard Enterprise Development LP * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. *

Index

Constants

This section is empty.

Variables

View Source
var ErrDeviceTypeAlreadyExists = fmt.Errorf("device type already exists")

Functions

This section is empty.

Types

type Airflow

type Airflow string
const (
	AirflowFrontToRear Airflow = "front-to-rear"
	AirflowRearToFront Airflow = "rear-to-front"
	AirflowLeftToRight Airflow = "left-to-right"
	AirflowRightToLeft Airflow = "right-to-left"
	AirflowSideToRear  Airflow = "side-to-rear"
	AirflowPassive     Airflow = "passive"
)

type AllowedHardware

type AllowedHardware struct {
	HardwareTypes []HardwareType `yaml:"hardware-type"`
	Slug          []string       `yaml:"slug"`
	Types         []HardwareType `yaml:"types"`
}

type DefaultHardware

type DefaultHardware struct {
	Slug string `yaml:"slug"`
}

type DeviceBay

type DeviceBay struct {
	Name    string           `yaml:"name"`
	Allowed *AllowedHardware `yaml:"allowed"`
	Default *DefaultHardware `yaml:"default"`
	Ordinal int              `yaml:"ordinal"`
}

type DeviceType

type DeviceType struct {
	Manufacturer string       `yaml:"manufacturer"`
	Model        string       `yaml:"model"`
	HardwareType HardwareType `yaml:"hardware-type"`
	Slug         string       `yaml:"slug"`

	PartNumber  *string     `yaml:"part_number"`
	UHeight     *float64    `yaml:"u_height"`
	IsFullDepth *bool       `yaml:"is_full_depth"`
	Weight      *float64    `yaml:"weight"`
	WeightUnit  *WeightUnit `yaml:"weight_unit"`

	FrontImage bool `yaml:"front_image"`
	RearImage  bool `yaml:"rear_image"`

	SubDeviceRole SubDeviceRole `yaml:"subdevice_role"`

	DeviceBays       []DeviceBay       `yaml:"device-bays"`
	Identifications  []Identification  `yaml:"identifications"`
	ProviderDefaults *ProviderDefaults `yaml:"provider_defaults"`
}

type HardwareType

type HardwareType string
const (
	System                         HardwareType = "System" // Serves as a top-level object, not a child of anything, though there can be multiple systems in a domain that hardware can move between
	Cabinet                        HardwareType = "Cabinet"
	Chassis                        HardwareType = "Chassis"
	ChassisManagementModule        HardwareType = "ChassisManagementModule"
	CabinetEnvironmentalController HardwareType = "CabinetEnvironmentalController"
	NodeBlade                      HardwareType = "NodeBlade"
	NodeCard                       HardwareType = "NodeCard"       // TODO Change to enclosure?
	NodeController                 HardwareType = "NodeController" // A Node BMC is a child of a node card
	Node                           HardwareType = "Node"
	ManagementSwitchEnclosure      HardwareType = "ManagementSwitchEnclosure"
	ManagementSwitch               HardwareType = "ManagementSwitch"
	ManagementSwitchController     HardwareType = "ManagementSwitchController"
	HighSpeedSwitchEnclosure       HardwareType = "HighSpeedSwitchEnclosure"
	HighSpeedSwitch                HardwareType = "HighSpeedSwitch"
	HighSpeedSwitchController      HardwareType = "HighSpeedSwitchController"
	CabinetPDUController           HardwareType = "CabinetPDUController"
	CabinetPDU                     HardwareType = "CabinetPDU"
	CoolingDistributionUnit        HardwareType = "CoolingDistributionUnit"
)

TODO should give a description of each of these

type HardwareTypePath

type HardwareTypePath []HardwareType

func (HardwareTypePath) Key

func (htp HardwareTypePath) Key() string

type Identification

type Identification struct {
	Manufacturer string  `yaml:"manufacturer"`
	Model        string  `yaml:"model"`
	PartNumber   *string `yaml:"part-number"`
}

type Library

type Library struct {
	DeviceTypes map[string]DeviceType // TODO make private?
}

func NewEmbeddedLibrary

func NewEmbeddedLibrary(customDir string) (*Library, error)

func NewLibraryFromPath

func NewLibraryFromPath(path string) (*Library, error)

func (*Library) GetDeviceType

func (l *Library) GetDeviceType(slug string) (DeviceType, error)

func (*Library) GetDeviceTypesByHardwareType

func (l *Library) GetDeviceTypesByHardwareType(hardwareType HardwareType) []DeviceType

func (*Library) RegisterDeviceType

func (l *Library) RegisterDeviceType(deviceType DeviceType) error

type ProviderDefaults

type ProviderDefaults struct {
	CSM *ProviderDefaultsCSM `yaml:"csm"`
}

type ProviderDefaultsCSM

type ProviderDefaultsCSM struct {
	Class           *string `yaml:"Class"`
	Ordinal         int     `yaml:"Ordinal"`
	StartingHmnVlan int     `yaml:"StartingHmnVlan"`
	EndingHmnVlan   int     `yaml:"EndingHmnVlan"`
}

type SubDeviceRole

type SubDeviceRole string
const (
	SubDeviceRoleParent SubDeviceRole = "parent"
	SubDeviceRoleChild  SubDeviceRole = "child"
)

type WeightUnit

type WeightUnit string
const (
	WeightUnitKiloGram WeightUnit = "kg"
	WeightUnitGram     WeightUnit = "g"
	WeightUnitPound    WeightUnit = "lb"
	WeightUnitOunce    WeightUnit = "oz"
)

Directories

Path Synopsis
* * MIT License * * (C) Copyright 2023 Hewlett Packard Enterprise Development LP * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software.
* * MIT License * * (C) Copyright 2023 Hewlett Packard Enterprise Development LP * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software.

Jump to

Keyboard shortcuts

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