platform

package
v2.0.8+incompatible Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2021 License: Apache-2.0 Imports: 37 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HostInfo

type HostInfo struct {
	hosts.Host
	Labels                []labels.Label
	CPU                   []cpus.CPU
	Memory                []memory.Memory
	Monitors              []cephmonitors.CephMonitor
	Networks              []networks.Network
	DataNetworks          []datanetworks.DataNetwork
	InterfaceNetworks     []interfaceNetworks.InterfaceNetwork
	InterfaceDataNetworks []interfaceDataNetworks.InterfaceDataNetwork
	Pools                 []addresspools.AddressPool
	Ports                 []ports.Port
	Interfaces            []interfaces.Interface
	Addresses             []addresses.Address
	Routes                []routes.Route
	Disks                 []disks.Disk
	Partitions            []partitions.DiskPartition
	VolumeGroups          []volumegroups.VolumeGroup
	PhysicalVolumes       []physicalvolumes.PhysicalVolume
	OSDs                  []osds.OSD
	Clusters              []clusters.Cluster
	StorageTiers          map[string]*storagetiers.StorageTier
	FileSystems           []hostFilesystems.FileSystem
}

HostInfo defines the system resources that are collected thru the system API. Since various methods that deal with specific resources often needs related information from other resource those pieces of information are being aggregated into a single type to facilitate passing the data around and minimizing the number of API calls required.

func (*HostInfo) BuildInterfaceDataNetworkList added in v1.0.0

func (in *HostInfo) BuildInterfaceDataNetworkList(iface interfaces.Interface) []string

BuildInterfaceDataNetworkList is a utility function takes a builds a list // of network names based on the specific interface ID and the host's list of // interface-to-datanetwork associations.

func (*HostInfo) BuildInterfaceNetworkList added in v1.0.0

func (in *HostInfo) BuildInterfaceNetworkList(iface interfaces.Interface) []string

BuildInterfaceNetworkList is a utility function that takes a builds a list of network names based on the specific interface ID and the host's list of interface-to-network associations.

func (*HostInfo) BuildNetworkIDList

func (in *HostInfo) BuildNetworkIDList(nets []string) []string

BuildNetworkIDList is a utility function which takes a set of network names and produces a list of network id values. Some networks as specified in the configuration yaml are only represented as address pools in the system so they are ignored here.

func (*HostInfo) CountCPUByFunction

func (in *HostInfo) CountCPUByFunction(node int, function string) int

CountCPUByFunction examines the list of CPU instance returned by the system API and counts the number of cores that match the node and function specified by the caller

func (*HostInfo) FindAddressPool

func (in *HostInfo) FindAddressPool(id string) *addresspools.AddressPool

FindAddressPoolByName is a utility function which examines the list of system address pools and returns a reference to a pool which matches the network name provided.

func (*HostInfo) FindAddressPoolByName

func (in *HostInfo) FindAddressPoolByName(name string) *addresspools.AddressPool

FindAddressPoolByName is a utility function which examines the list of system address pools and returns a reference to a pool which matches the network name provided.

func (*HostInfo) FindAddressUUID

func (in *HostInfo) FindAddressUUID(ifname string, address string, prefix int) (*addresses.Address, bool)

findAddressUUID is a utility function which finds a system address object by its unique attributes.

func (*HostInfo) FindBondInterfaceUUID

func (in *HostInfo) FindBondInterfaceUUID(members []string) (string, bool)

findBondInterfaceUUID is a utility function to find a bond interface in the list of interfaces returned by the systemAPI. Because a user may rename a bond we try to identify it by its members rather than its name. This may not handle all cases so may need to be revisited later.

func (*HostInfo) FindClusterByName

func (in *HostInfo) FindClusterByName(name string) *clusters.Cluster

func (*HostInfo) FindClusterNameByTier

func (in *HostInfo) FindClusterNameByTier(id string) (string, bool)

FindClusterNameByTier does a reverse lookup in the cluster tier map and returns the name of the cluster to which the tier id is associated.

func (*HostInfo) FindDataNetworkID added in v1.0.0

func (in *HostInfo) FindDataNetworkID(name string) (string, bool)

FindDataNetworkID is a utility method to find the data network ID value for a given data network name.

func (*HostInfo) FindDisk

func (in *HostInfo) FindDisk(id string) (*disks.Disk, bool)

FindDisk is a utility function that attempts to find a system disk by its unique uuid value.

func (*HostInfo) FindDiskByNode

func (in *HostInfo) FindDiskByNode(path string) (*disks.Disk, bool)

FindDiskByNode is a utility function that attempts to find a system disk by its device node.

func (*HostInfo) FindDiskByPath

func (in *HostInfo) FindDiskByPath(path string) (*disks.Disk, bool)

FindDiskByPath is a utility function that attempts to find a system disk by its absolute device path.

func (*HostInfo) FindInterface

func (in *HostInfo) FindInterface(ifuuid string) (*interfaces.Interface, bool)

findInterface is a utility function which accepts a host interface UUID value and returns a reference to a host interface from the system API.

func (*HostInfo) FindInterfaceByName

func (in *HostInfo) FindInterfaceByName(name string) (*interfaces.Interface, bool)

findInterfaceByName is a utility function which finds a system interface object by its unique name.

func (*HostInfo) FindInterfaceDataNetworkID added in v1.0.0

func (in *HostInfo) FindInterfaceDataNetworkID(iface interfaces.Interface, datanetwork string) (string, bool)

FindInterfaceDataNetworkID is a utility method to find the interface-datanetwork ID value for a given interface and data network name.

func (*HostInfo) FindInterfaceNetworkID added in v1.0.0

func (in *HostInfo) FindInterfaceNetworkID(iface interfaces.Interface, network string) (string, bool)

FindInterfaceNetworkID is a utility method to find the interface-network ID value for a given interface and network name.

func (*HostInfo) FindInterfacePortName

func (in *HostInfo) FindInterfacePortName(id string) (string, bool)

findInterfacePortName is a utility function which searches the list of ports and returns the name of the port that is associated to the interface ID value specified.

func (*HostInfo) FindLabel

func (in *HostInfo) FindLabel(key string) (string, bool)

FindLabel is a utility function which searchs the current list of host labels and finds the first entry that matches the specified key.

func (*HostInfo) FindMemory

func (in *HostInfo) FindMemory(node int) (*memory.Memory, bool)

FindMemory is a utility function which finds a memory resource for a given processor node.

func (*HostInfo) FindNetworkID added in v1.0.0

func (in *HostInfo) FindNetworkID(name string) (string, bool)

FindNetworkID is a utility method to find the network ID value for a given network name.

func (*HostInfo) FindOSDByPath

func (in *HostInfo) FindOSDByPath(path string) (*osds.OSD, bool)

FindOSDByPath is a utility function that attempts to find an OSD by its absolute path.

func (*HostInfo) FindPartition

func (in *HostInfo) FindPartition(uuid string) (*partitions.DiskPartition, bool)

findPartition is a utility function that attempts to find a system partition by its unique uuid value.

func (*HostInfo) FindPartitionByPath

func (in *HostInfo) FindPartitionByPath(path string, size int, physicalVolumeName string) (*partitions.DiskPartition, bool)

FindPartitionByPath is a utility function that attempts to find a disk partition by its absolute device path. Size is expected in Gibibytes.

func (*HostInfo) FindPhysicalVolume

func (in *HostInfo) FindPhysicalVolume(groupName string, typ string, path string, size int) (*physicalvolumes.PhysicalVolume, bool)

FindPhysicalVolume is a utility function that attempts to find a system partition matching the criteria specified. Size is expected in Gibibytes

func (*HostInfo) FindPortInterfaceUUID

func (in *HostInfo) FindPortInterfaceUUID(portname string) (string, bool)

findPortInterfaceUUID is a utility function which accepts a port name and attempts to find the interface UUID which represents the interface associated to the port.

func (*HostInfo) FindRouteUUID

func (in *HostInfo) FindRouteUUID(ifname string, network string, prefix int) (*routes.Route, bool)

findRouteUUID is a utility function which finds a system route object by its unique attributes.

func (*HostInfo) FindVFInterfaceUUID

func (in *HostInfo) FindVFInterfaceUUID(name string) (string, bool)

findVFInterfaceUUID is a utility function to find a VF interface in the list of interfaces returned by the systemAPI.

func (*HostInfo) FindVLANInterfaceUUID

func (in *HostInfo) FindVLANInterfaceUUID(vid int) (string, bool)

findVLANInterfaceUUID is a utility function to find a VLAN interface in the list of interfaces returned by the systemAPI.

func (*HostInfo) FindVolumeGroup

func (in *HostInfo) FindVolumeGroup(name string) (*volumegroups.VolumeGroup, bool)

findVolumeGroup is a utility function that attempts to find a system volume group by name.

func (*HostInfo) IsStorageDeploymentModel

func (in *HostInfo) IsStorageDeploymentModel() bool

IsStorageDeploymentModel determines where storage nodes are expected to be deployed.

func (*HostInfo) IsSystemAddress

func (in *HostInfo) IsSystemAddress(address *addresses.Address) bool

IsSystemAddress determines if an address was added to the system automatically or whether it was added manually. The determination is based on whether the address is associated to an address pool.

func (*HostInfo) PopulateHostInfo

func (in *HostInfo) PopulateHostInfo(client *gophercloud.ServiceClient, hostid string) error

getHostInfo is a utility function which build all host attributes and stores them into a single structure that acts as a cache of data that can be passed around and re-used rather than having to re-read data that is required in multiple functions.

func (*HostInfo) PopulateStorageTiers

func (in *HostInfo) PopulateStorageTiers(client *gophercloud.ServiceClient) error

getSystemPartitions augments the list of partitions that were retrieved using the List API with additional partitions that were created by the system and are not visible from the List API.

func (*HostInfo) PopulateSystemPartitions

func (in *HostInfo) PopulateSystemPartitions(client *gophercloud.ServiceClient) error

getSystemPartitions augments the list of partitions that were retrieved using the List API with additional partitions that were created by the system and are not visible from the List API.

type SystemInfo

type SystemInfo struct {
	system.System
	DRBD              *drbd.DRBD
	DNS               *dns.DNS
	NTP               *ntp.NTP
	PTP               *ptp.PTP
	Certificates      []certificates.Certificate
	ServiceParameters []serviceparameters.ServiceParameter
	StorageBackends   []storagebackends.StorageBackend
	FileSystems       []controllerFilesystems.FileSystem
	License           *licenses.License
}

func (*SystemInfo) PopulateSystemInfo

func (in *SystemInfo) PopulateSystemInfo(client *gophercloud.ServiceClient) error

Jump to

Keyboard shortcuts

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