Documentation
¶
Index ¶
- Constants
- Variables
- func GenToken(hostname string) string
- func GenerateNodeHashByMacAddr() (string, error)
- 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 SetAllGeneralRoles()
- func SetAllRoles()
- func SetComputeRoles()
- func SetControlRoles()
- func SetList(nodes []Node)
- func Sync()
- func SyncEachRole()
- func SyncRoleCombination()
- type BlockDevice
- type Host
- type NetworkInterface
- type Node
- func (n *Node) CreateSupportFileUrl(file support.File) string
- func (n *Node) DeleteModuleRepairingTaskUrl(module string) string
- func (n *Node) DeleteRepairingTaskUrl() string
- func (n *Node) DownloadSupportFileUrl(setname, filename string) string
- 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) 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(id string) string
- func (n *Node) PatchTuningUrl(tuning string) string
- func (n *Node) PostLicenseUrl() string
- type RawBlockDevice
- type RawNetworkInterface
- type Role
- type Selector
Constants ¶
View Source
const ( RoleControl = "control" RoleCompute = "compute" RoleStorage = "storage" RoleControlConverged = "control-converged" RoleModerator = "moderator" RoleEdgeCore = "edge-core" )
View Source
const (
Module = "nodes"
)
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 NetworkInterface ¶
type NetworkInterface struct { 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"` Role string `json:"role" yaml:"role"` Protocol string `json:"protocol,omitempty" yaml:"protocol,omitempty" bson:"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"` License licenses.License `json:"license" yaml:"license,omitempty" bson:"license,omitempty"` Status string `json:"status" yaml:"status"` CpuSpec string `json:"cpuSpec" yaml:"cpuSpec" bson:"cpuSpec"` NetworkInterfaces []NetworkInterface `json:"networkInterfaces" yaml:"networkInterfaces" bson:"networkInterfaces"` BlockDevices []BlockDevice `json:"blockDevices" yaml:"blockDevices" bson:"blockDevices"` Vcpu metric.Compute `json:"vcpu" yaml:"vcpu" bson:"vcpu"` Memory metric.Space `json:"memory" yaml:"memory" bson:"memory"` Storage metric.Space `json:"storage" yaml:"storage" bson:"storage"` UptimeSeconds float64 `json:"uptimeSeconds" yaml:"uptimeSeconds" bson:"uptimeSeconds"` Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty" bson:"labels,omitempty"` }
func GetControlNodes ¶
func GetController ¶
func GetNodesByRole ¶
func GetNodesByRoles ¶
func GetNodesByRoles() []Node
func GetPeerControls ¶
func (*Node) DeleteModuleRepairingTaskUrl ¶
func (*Node) DeleteRepairingTaskUrl ¶
func (*Node) DownloadSupportFileUrl ¶
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 ¶
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.