Documentation
¶
Index ¶
- Constants
- Variables
- func GenToken(hostname string) string
- func GetCloudRoles() []string
- func GetDiscoveredServices() ([]*registry.Service, error)
- func GetEdgeRoles() []string
- func GetMap() map[string]Node
- func GetSecretHeaders() map[string]string
- func HostnameMap() (map[string]Node, error)
- func IsCloudRole(role string) bool
- func IsEdgeRole(role string) bool
- func IsLocal(hostname string) bool
- func IsLocalAddress(address string) bool
- func Lock()
- func SetAllGeneralRoles()
- func SetAllRoles()
- func SetComputeRoles()
- func SetControlRoles()
- func SetList(nodes []Node)
- func Sync()
- func SyncEachRole()
- func SyncRoleCombination()
- func Unlock()
- type BlockDevice
- type Board
- type Host
- type ImpiValidation
- type Ipmi
- type IpmiEnablement
- type NetworkInterface
- type Node
- func Get(hostname string) (*Node, error)
- func GetControlNodes() ([]Node, error)
- func GetController() (*Node, error)
- func GetNodesByRole(role string) ([]Node, error)
- func GetNodesByRoles() []Node
- func GetPeerControls() ([]Node, error)
- func List() []Node
- func ListPrevious() []Node
- func New(node *registry.Node) Node
- func (n *Node) CreateSupportFileUrl(file support.File) string
- func (n *Node) DeleteModuleRepairingTaskUrl(module string) string
- func (n *Node) DeleteRepairingTaskUrl() string
- func (n *Node) DeleteSupportFileUrl(group, file string) string
- func (n *Node) DownloadSupportFileUrl(setname, filename string) string
- func (n *Node) EnableOrDisableTuningUrl(tuning string) string
- func (n *Node) GenSearchableObject() Node
- func (n *Node) GenUrl() string
- func (n *Node) GetMetricUrl(metric, view string) string
- func (n *Node) GetNodeUrl() string
- func (n *Node) GetSettingUrl(path string) string
- func (n *Node) GetSupportFileUrl() string
- func (n *Node) GetTuningUrl() string
- func (n *Node) IsDown() bool
- func (n *Node) IsLicenseExpired() bool
- func (n *Node) IsLocal() bool
- func (n *Node) IsUnlicensed() bool
- func (n *Node) IsUp() bool
- func (n *Node) MatchHardwareSerial(hardwareSerials []string) bool
- func (n *Node) PatchSettingTaskUrl(setting settings.Setting) string
- func (n *Node) PatchSupportFileTaskUrl(file support.File) string
- func (n *Node) PatchTriggerTaskUrl(trigger triggers.ApiSchema) string
- func (n *Node) PatchTuningTaskUrl() string
- func (n *Node) PatchTuningUrl(tuning string) string
- func (n *Node) PostLicenseUrl() string
- func (n *Node) ResetTuningUrl(tuning string) string
- type Product
- type RawBlockDevice
- type RawNetworkInterface
- type Role
- type Selector
Constants ¶
View Source
const ( DefaultIpmiDeviceId = uint8(0) IpmiMarkerfile = "/etc/appliance/state/ipmi_detected" )
View Source
const ( Module = "nodes" Db = "nodes" RequestsCollection = "requests" CollectionIpmi = "ipmi" )
View Source
const ( RoleControl = "control" RoleCompute = "compute" RoleStorage = "storage" RoleControlConverged = "control-converged" RoleModerator = "moderator" RoleEdgeCore = "edge-core" )
Variables ¶
View Source
var ( Control atomic.Pointer[Role] Compute atomic.Pointer[Role] Storage atomic.Pointer[Role] ControlConverged atomic.Pointer[Role] Moderator atomic.Pointer[Role] EdgeCore atomic.Pointer[Role] AllRoles = []*Role{} AllGeneralRoles = []*Role{} ControlRoles = []*Role{} ComputeRoles = []*Role{} )
Functions ¶
func GetCloudRoles ¶
func GetCloudRoles() []string
func GetDiscoveredServices ¶
func GetEdgeRoles ¶
func GetEdgeRoles() []string
func GetSecretHeaders ¶
func HostnameMap ¶
func IsCloudRole ¶
func IsEdgeRole ¶
func IsLocalAddress ¶
func SetAllGeneralRoles ¶
func SetAllGeneralRoles()
func SetAllRoles ¶
func SetAllRoles()
func SetComputeRoles ¶
func SetComputeRoles()
func SetControlRoles ¶
func SetControlRoles()
func SyncEachRole ¶
func SyncEachRole()
func SyncRoleCombination ¶
func SyncRoleCombination()
Types ¶
type BlockDevice ¶
type BlockDevice struct { Serial string `json:"serial"` Name string `json:"device" yaml:"device" bson:"device"` Type string `json:"type" yaml:"type" bson:"type"` SizeMiB float64 `json:"sizeMiB" yaml:"sizeMiB" bson:"sizeMiB"` Availability string `json:"availability" yaml:"availability" bson:"availability"` Status status.BlockDevice `json:"status" yaml:"status" bson:"status"` }
type Host ¶
type ImpiValidation ¶
type Ipmi ¶
type Ipmi struct { Host string `json:"host" bson:"host"` Ip string `json:"ip" bson:"ip"` Port int `json:"port" bson:"port"` Username string `json:"username" bson:"username"` Password string `json:"password" bson:"password"` }
func (*Ipmi) CheckInvalidValues ¶
type IpmiEnablement ¶
type NetworkInterface ¶
type NetworkInterface struct { Interface string `json:"interface" yaml:"interface" bson:"interface"` Label string `json:"label" yaml:"label" bson:"label"` BusIdSlaves string `json:"busIdSlaves" yaml:"busIdSlaves" bson:"busIdSlaves"` Driver string `json:"driver" yaml:"driver" bson:"driver"` State string `json:"state" yaml:"state" bson:"state"` Speed string `json:"speed" yaml:"speed" bson:"speed"` }
type Node ¶
type Node struct { Id string `json:"id" yaml:"id"` SerialNumber string `json:"serialNumber" yaml:"serialNumber"` DataCenter string `json:"dataCenter" yaml:"dataCenter"` Hostname string `json:"hostname" yaml:"hostname" bson:"hostname"` Role string `json:"role" yaml:"role"` Protocol string `json:"protocol,omitempty" yaml:"protocol,omitempty"` Address string `json:"address" yaml:"address"` Ip string `json:"ip" yaml:"ip"` ManagementIP string `json:"managementIP" yaml:"managementIP"` StorageIP string `json:"storageIP" yaml:"storageIP"` CpuSpec string `json:"cpuSpec" yaml:"cpuSpec"` NetworkInterfaces []NetworkInterface `json:"networkInterfaces" yaml:"networkInterfaces"` BlockDevices []BlockDevice `json:"blockDevices" yaml:"blockDevices"` Vcpu metric.Compute `json:"vcpu" yaml:"vcpu"` Memory metric.Space `json:"memory" yaml:"memory"` Storage metric.Space `json:"storage" yaml:"storage"` IsVirtualIpOwner bool `json:"isVirtualIpOwner" yaml:"isVirtualIpOwner"` IpmiEnablement `json:"ipmi" yaml:"ipmi"` License licenses.License `json:"license" yaml:"license,omitempty"` Status string `json:"status" yaml:"status" bson:"status"` UptimeSeconds float64 `json:"uptimeSeconds" yaml:"uptimeSeconds"` Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` }
func GetControlNodes ¶
func GetController ¶
func GetNodesByRole ¶
func GetNodesByRoles ¶
func GetNodesByRoles() []Node
func GetPeerControls ¶
func ListPrevious ¶
func ListPrevious() []Node
func (*Node) DeleteModuleRepairingTaskUrl ¶
func (*Node) DeleteRepairingTaskUrl ¶
func (*Node) DeleteSupportFileUrl ¶
func (*Node) DownloadSupportFileUrl ¶
func (*Node) EnableOrDisableTuningUrl ¶
func (*Node) GenSearchableObject ¶
note: in the current search lib(bleve), we realize that it seems like not able to serach the status keyword from the single status field, but it's pretty tricky that it will work if we add the status behind any of fields below like hostname, address, managementIP... so that's why we do this for the time being in the M2, we will try to deep dive into the bleve and see if we can find a better way to do this
func (*Node) GetMetricUrl ¶
func (*Node) GetNodeUrl ¶
func (*Node) GetSettingUrl ¶
func (*Node) GetSupportFileUrl ¶
func (*Node) GetTuningUrl ¶
func (*Node) IsLicenseExpired ¶
func (*Node) IsUnlicensed ¶
func (*Node) MatchHardwareSerial ¶
func (*Node) PatchSettingTaskUrl ¶
func (*Node) PatchSupportFileTaskUrl ¶
func (*Node) PatchTriggerTaskUrl ¶
func (*Node) PatchTuningTaskUrl ¶
func (*Node) PatchTuningUrl ¶
func (*Node) PostLicenseUrl ¶
func (*Node) ResetTuningUrl ¶
type RawBlockDevice ¶
type RawBlockDevice struct { Type string `json:"type"` Serial string `json:"serial"` Name string `json:"name"` Size string `json:"size"` Rota bool `json:"rota"` MountPoints []string `json:"mountpoints"` }
note: rota is named by lsblk tool, it means rotational device like HDD
func (*RawBlockDevice) IsBlock ¶
func (r *RawBlockDevice) IsBlock() bool
func (*RawBlockDevice) IsPartition ¶
func (r *RawBlockDevice) IsPartition() bool
func (*RawBlockDevice) NoMountPoints ¶
func (r *RawBlockDevice) NoMountPoints() bool
type RawNetworkInterface ¶
type RawNetworkInterface struct { Label string `json:"label" yaml:"label" bson:"label"` BusIdSlaves string `json:"busid" yaml:"busid" bson:"busid"` Driver string `json:"driver" yaml:"driver" bson:"driver"` State string `json:"state" yaml:"state" bson:"state"` Speed string `json:"speed" yaml:"speed" bson:"speed"` }
type Role ¶
type Role struct { Name string `json:"name" bson:"name"` Hosts []Host `json:"hosts" bson:"hosts"` Nodes []Node `json:"-"` }
func GetComputeRole ¶
func GetComputeRole() *Role
func GetControlConvergeRole ¶
func GetControlConvergeRole() *Role
func GetControlRole ¶
func GetControlRole() *Role
func GetEdgeCoreRole ¶
func GetEdgeCoreRole() *Role
func GetModeratorRole ¶
func GetModeratorRole() *Role
func GetStorageRole ¶
func GetStorageRole() *Role
func (*Role) IsNodeEmpty ¶
Click to show internal directories.
Click to hide internal directories.