 Documentation
      ¶
      Documentation
      ¶
    
    
  
    
  
    Index ¶
- Constants
- Variables
- func CapturePanic()
- func EmailRecipientCollection() string
- func EmailSenderCollection() string
- func GenNodeToken(hostname, advertiseAddr string) string
- func GenerateNodeHashByMacAddr() (string, error)
- func GetCurrentTunings() *sync.Map
- func GetMacAddr(interfaceName string) (string, error)
- func GetTuningSearcher() bleve.Index
- func GetTuningSpecs() *sync.Map
- func HealthDB() string
- func InitTuningSearchIndex() error
- func IsCurrentHost(hostname string) bool
- func IsPageRequired(pageNum, pageSize string) bool
- func RepairCollection() string
- func SetCurrentTuning(tuning Tuning)
- func SetSpecToTuning(tuningName string, tuningSpec *TuningSpec)
- func SettingsDB() string
- func SeverityFullName(severity string) string
- func SeverityShortName(severity string) string
- func ShouldCurrentRoleHandleTheTuning(tuningName string, roleName string) bool
- func SlackWebhookCollection() string
- func SyncNodesOfRole()
- func TimeLocalISO8601(t time.Time) string
- func TimeNowRFC3339() string
- func TimeRFC3339(duration time.Duration) string
- func TimeUTC(t time.Time) string
- func TuningCollection(name string) string
- func TuningDB() string
- type Additional
- type ComputeStatistic
- type DataCenter
- type DataCenterUsage
- type EmailRecipient
- type EmailSender
- type Event
- type EventFilter
- type EventStat
- type Expiry
- type Feature
- type Health
- type HostFilter
- type HostNetworkPacket
- type HostPercentageUsage
- type HostUsage
- type InstanceFilter
- type Integration
- type Issue
- type Label
- type License
- type Limit
- type ListTuningOptions
- type Module
- type Node
- type Page
- type Period
- type Product
- type Quantity
- type RawLicense
- type Role
- func GetComputeRole() *Role
- func GetControlConvergeRole() *Role
- func GetControlRole() *Role
- func GetControlRoles() []*Role
- func GetEdgeCoreRole() *Role
- func GetModeratorRole() *Role
- func GetNetworkRole() *Role
- func GetRolesToHandleTuning(tuningName string) ([]*Role, bool)
- func GetStorageRole() *Role
 
- type Selector
- type Service
- type ServiceLevelAgreement
- type Setting
- type SlackWebhook
- type SpaceStatistic
- type StorageBandwidthSeries
- type StorageIopsSeries
- type StorageLatencySeries
- type SystemFilter
- type TimeBytesPoint
- type TimeMillisecondPoint
- type TimeOpsPoint
- type TimePacketsPoint
- type TimeUsedPercent
- type TrafficStatistic
- type Tuning
- type TuningLimitation
- type TuningPolicy
- type TuningSpec
- type User
- type VmDiskIopsUsage
- type VmMetricsUsage
- type VmNetworkTrafficUsage
- type VmPercentageUsage
- type VmUsage
Constants ¶
      View Source
      
  
    const ( Tokens = "tokens" Logout = "logout" )
      View Source
      
  
    const ( Summary = "summary" Metrics = "metrics" )
      View Source
      
  
    const ( Nodes = "nodes" DataCenterHelpUrl = "https://www.bigstack.co/contact-us" )
      View Source
      
  
    const ( RoleControl = "control" RoleCompute = "compute" RoleStorage = "storage" RoleNetwork = "network" RoleControlConverged = "control-converged" RoleModerator = "moderator" RoleEdgeCore = "edge-core" )
      View Source
      
  
    const ( Settings = "settings" EmailSenders = "emailSenders" EmailRecipients = "emailRecipients" SlackWebhooks = "slackWebhooks" )
      View Source
      
  
    const ( ISO8601 = "2006-01-02T15:04:05" RFC3339 = time.RFC3339 )
      View Source
      
  
    const (
	ApiDoc = "api-doc"
)
    
      View Source
      
  
    const (
	DataCenters = "datacenters"
)
    
      View Source
      
  
    const (
	Events = "events"
)
    
      View Source
      
  
    const (
	Healths = "healths"
)
    
      View Source
      
  
    const (
	Integrations = "integrations"
)
    
      View Source
      
  
    const (
	Licenses = "licenses"
)
    
      View Source
      
  
    const (
	Me = "me"
)
    
      View Source
      
  
    const (
	NetMajorInterface = "eth0"
)
    
      View Source
      
  
    const (
	Services = "services"
)
    
      View Source
      
  
const (
	Tunings = "tunings"
)
    Variables ¶
      View Source
      
  
    var ( DefaultKeycloakRealm = "master" DefaultIdpSamlMetadataPath = fmt.Sprintf("/auth/realms/%s/protocol/saml/descriptor", DefaultKeycloakRealm) DefaultSpSamlMetadataPath = "/saml/metadata" DefaultApiServerKey = "/var/www/certs/server.key" DefaultApiServerCert = "/var/www/certs/server.cert" DefaultIdentifierFormat = "urn:oasis:names:tc:SAML:2.0:nameid-format:persistent" DefaultOidcClientId = "token-connect" DefaultOidcClientSecret = "" DefaultOidcClientOpts = gocloak.Client{ ClientID: gocloak.StringP(DefaultOidcClientId), Protocol: gocloak.StringP("openid-connect"), PublicClient: gocloak.BoolP(false), ClientAuthenticatorType: gocloak.StringP("client-secret"), StandardFlowEnabled: gocloak.BoolP(true), DirectAccessGrantsEnabled: gocloak.BoolP(true), Attributes: &map[string]string{ "access.token.lifespan": "7200", }, } DefaultNodeToken = "" LogoutRedirectUrl = "" )
      View Source
      
  
    var ( HostID string Hostname string DataCenterName string DataCenterVersion string DataCenterVip string ListenAddr string ListenPort int AdvertiseAddr string AdvertisePort int MgmtNet string MgmtIP string IsHaEnabled bool IsGpuEnabled bool )
      View Source
      
  
    var ( CurrentRole string Roles = []string{RoleControl, RoleCompute, RoleStorage, RoleNetwork, RoleControlConverged, RoleModerator, RoleEdgeCore} ControlRole = newControlRole() ComputeRole = newComputeRole() StorageRole = newStorageRole() NetworkRole = newNetworkRole() ControlConvergedRole = newControlConvergeRole() ModeratorRole = newModeratorRole() EdgeCoreRole = newEdgeCoreRole() AllRoles = []*Role{ ControlRole, ComputeRole, StorageRole, NetworkRole, ControlConvergedRole, ModeratorRole, EdgeCoreRole, } AllGeneralRoles = []*Role{ ControlRole, ComputeRole, StorageRole, NetworkRole, ControlConvergedRole, } ControlRoles = []*Role{ ControlRole, ControlConvergedRole, } ComputeRoles = []*Role{ ComputeRole, ControlConvergedRole, EdgeCoreRole, } )
      View Source
      
  
    var (
	CreateRecordIfNotExist = options.Update().SetUpsert(true)
)
    
      View Source
      
  
var (
	V1ApiDocUrl = ""
)
    Functions ¶
func CapturePanic ¶
func CapturePanic()
func EmailRecipientCollection ¶
func EmailRecipientCollection() string
func EmailSenderCollection ¶
func EmailSenderCollection() string
func GenNodeToken ¶
func GetCurrentTunings ¶
func GetMacAddr ¶
func GetTuningSearcher ¶
func GetTuningSearcher() bleve.Index
func GetTuningSpecs ¶
func InitTuningSearchIndex ¶
func InitTuningSearchIndex() error
func IsCurrentHost ¶
func IsPageRequired ¶
func RepairCollection ¶
func RepairCollection() string
func SetCurrentTuning ¶
func SetCurrentTuning(tuning Tuning)
func SetSpecToTuning ¶
func SetSpecToTuning(tuningName string, tuningSpec *TuningSpec)
func SettingsDB ¶
func SettingsDB() string
func SeverityFullName ¶
func SeverityShortName ¶
func SlackWebhookCollection ¶
func SlackWebhookCollection() string
func SyncNodesOfRole ¶
func SyncNodesOfRole()
func TimeLocalISO8601 ¶
func TimeNowRFC3339 ¶
func TimeNowRFC3339() string
func TimeRFC3339 ¶
func TuningCollection ¶
Types ¶
type Additional ¶
type ComputeStatistic ¶
type DataCenter ¶
type DataCenter struct {
	Id          string `json:"id,omitempty" bson:"id"`
	Name        string `json:"name" bson:"name"`
	Version     string `json:"version" bson:"version"`
	VirtualIp   string `json:"virtualIp" bson:"virtualIp"`
	IsLocal     bool   `json:"isLocal" bson:"isLocal"`
	IsHaEnabled bool   `json:"isHaEnabled" bson:"isHaEnabled"`
	Additional  `json:"additional,omitempty" bson:"additional"`
}
    func (*DataCenter) SetDetailsByInitedInfo ¶
func (d *DataCenter) SetDetailsByInitedInfo()
M1 TODO: have to think about if we 1). need to add the Id of datacenter 2). if (1) is true, then what's factor to generate the Id
type DataCenterUsage ¶
type DataCenterUsage struct {
	Cpu    ComputeStatistic `json:"cpu"`
	Memory SpaceStatistic   `json:"memory"`
}
    type EmailRecipient ¶
type EmailSender ¶
type EmailSender struct {
	Deleted bool `json:"-" bson:"deleted"`
	Host     string `json:"host" bson:"host"`
	Port     int    `json:"port" bson:"port"`
	Username string `json:"username" bson:"username"`
	Password string `json:"password" bson:"password"`
	From     string `json:"from" bson:"from"`
	Note string `json:"note,omitempty" bson:"note,omitempty"`
}
    type Event ¶
type Event struct {
	Type        string                 `json:"type"`
	Severity    string                 `json:"severity"`
	Id          string                 `json:"id"`
	Description string                 `json:"description"`
	Host        string                 `json:"host"`
	Category    string                 `json:"category"`
	Service     string                 `json:"service"`
	Metadata    map[string]interface{} `json:"metadata"`
	Time        string                 `json:"time"`
}
    type EventFilter ¶
type EventFilter struct {
	System   SystemFilter   `json:"system"`
	Instance InstanceFilter `json:"instance"`
	Host     HostFilter     `json:"host"`
}
    type HostFilter ¶
type HostNetworkPacket ¶
type HostNetworkPacket struct {
	Id      string             `json:"id"`
	Name    string             `json:"name"`
	Packets float64            `json:"packets"`
	History []TimePacketsPoint `json:"history"`
}
    type HostPercentageUsage ¶
type HostPercentageUsage struct {
	Id          string            `json:"id"`
	Name        string            `json:"name"`
	UsedPercent float64           `json:"usedPercent"`
	History     []TimeUsedPercent `json:"history"`
}
    type HostUsage ¶
type HostUsage struct {
	Cpu    ComputeStatistic `json:"cpu"`
	Memory SpaceStatistic   `json:"memory"`
}
    type InstanceFilter ¶
type Integration ¶
type License ¶
type License struct {
	Type                  string `json:"type" yaml:"type" bson:"type"`
	Hostname              string `json:"hostname" yaml:"hostname" bson:"hostname"`
	Serial                string `json:"serial" yaml:"serial" bson:"serial"`
	Product               `json:"product" yaml:"product" bson:"product"`
	Issue                 `json:"issue" yaml:"issue" bson:"issue"`
	Quantity              `json:"quantity" yaml:"quantity" bson:"quantity"`
	ServiceLevelAgreement `json:"serviceLevelAgreement" yaml:"sla" bson:"serviceLevelAgreement"`
	Expiry                `json:"expiry" yaml:"expiry" bson:"expiry"`
}
    type ListTuningOptions ¶
type ListTuningOptions struct {
	AllNodes bool
}
    type Node ¶
type Node struct {
	Id            string `json:"id" yaml:"id"`
	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"`
	ManagementIP  string `json:"managementIP" yaml:"managementIP"`
	License       `json:"license,omitempty" yaml:"license,omitempty" bson:"license,omitempty"`
	Status        string            `json:"status" yaml:"status"`
	Vcpu          ComputeStatistic  `json:"vcpu" yaml:"vcpu" bson:"vcpu"`
	Memory        SpaceStatistic    `json:"memory" yaml:"memory" bson:"memory"`
	Storage       SpaceStatistic    `json:"storage" yaml:"storage" bson:"storage"`
	UptimeSeconds float64           `json:"uptimeSeconds" yaml:"uptimeSeconds" bson:"uptimeSeconds"`
	Token         string            `json:"-" yaml:"-" bson:"-"`
	Labels        map[string]string `json:"labels,omitempty" yaml:"labels,omitempty" bson:"labels,omitempty"`
}
    func GetControllerNodes ¶
func GetNodeByHostname ¶
func GetNodesByRole ¶
func (*Node) GetBearerToken ¶
func (*Node) GetMetricUrl ¶
func (*Node) GetTuningUrl ¶
type Page ¶
func (Page) IsRequired ¶
type RawLicense ¶
type RawLicense struct {
	Type     string `json:"type" yaml:"type" bson:"type"`
	Hostname string `json:"hostname" yaml:"hostname" bson:"hostname"`
	Serial   string `json:"serial" yaml:"serial" bson:"serial"`
	Check    int    `json:"check" yaml:"check" bson:"check"`
	IssueBy  string `json:"issueby" yaml:"issueby" bson:"issueby"`
	IssueTo  string `json:"issueto" yaml:"issueto" bson:"issueto"`
	Hardware string `json:"hardware" yaml:"hardware" bson:"hardware"`
	Expiry   string `json:"expiry" yaml:"expiry" bson:"expiry"`
	Date     string `json:"date" yaml:"date" bson:"date"`
	Days     int    `json:"days" yaml:"days" bson:"days"`
}
    type Role ¶
type Role struct {
	Name  string  `json:"name" bson:"name"`
	Nodes []*Node `json:"nodes" bson:"nodes"`
}
    func GetComputeRole ¶
func GetComputeRole() *Role
func GetControlConvergeRole ¶
func GetControlConvergeRole() *Role
func GetControlRole ¶
func GetControlRole() *Role
func GetControlRoles ¶
func GetControlRoles() []*Role
func GetEdgeCoreRole ¶
func GetEdgeCoreRole() *Role
func GetModeratorRole ¶
func GetModeratorRole() *Role
func GetNetworkRole ¶
func GetNetworkRole() *Role
func GetRolesToHandleTuning ¶
func GetStorageRole ¶
func GetStorageRole() *Role
func (*Role) IsNodeEmpty ¶
type Service ¶
type Service struct {
	Name               string          `json:"name" bson:"name"`
	Category           string          `json:"category" bson:"category"`
	Status             *status.Details `json:"status,omitempty" bson:"status,omitempty"`
	Modules            []Module        `json:"modules" bson:"modules"`
	IsInternalViewOnly bool            `json:"-" bson:"isInternalViewOnly"`
}
    func (Service) CopyModuleEmptyStruct ¶
type ServiceLevelAgreement ¶
type ServiceLevelAgreement struct {
	Uptime                 float32 `json:"uptime" yaml:"uptime" bson:"uptime"`
	Period                 string  `json:"period" yaml:"period" bson:"period"`
	MeanTimeBetweenFailure string  `json:"meanTimeBetweenFailure" yaml:"meanTimeBetweenFailure" bson:"meanTimeBetweenFailure"`
	MeanTimeToRecovery     string  `json:"meanTimeToRecovery" yaml:"meanTimeToRecovery" bson:"meanTimeToRecovery"`
}
    type Setting ¶
type Setting struct {
	EmailSenders    []EmailSender    `json:"emailSenders" bson:"emailSenders"`
	EmailRecipients []EmailRecipient `json:"emailRecipients" bson:"emailRecipients"`
	SlackWebhooks   []SlackWebhook   `json:"slackWebhooks" bson:"slackWebhooks"`
}
    type SlackWebhook ¶
type SpaceStatistic ¶
type StorageBandwidthSeries ¶
type StorageBandwidthSeries struct {
	Read  []TimeBytesPoint `json:"read"`
	Write []TimeBytesPoint `json:"write"`
}
    type StorageIopsSeries ¶
type StorageIopsSeries struct {
	Read  []TimeOpsPoint `json:"read"`
	Write []TimeOpsPoint `json:"write"`
}
    type StorageLatencySeries ¶
type StorageLatencySeries struct {
	Read  []TimeMillisecondPoint `json:"read"`
	Write []TimeMillisecondPoint `json:"write"`
}
    type SystemFilter ¶
type TimeBytesPoint ¶
type TimeMillisecondPoint ¶
type TimeOpsPoint ¶
type TimePacketsPoint ¶
type TimeUsedPercent ¶
type TrafficStatistic ¶
type Tuning ¶
type Tuning struct {
	Name        string           `json:"name" yaml:"name"`
	Value       interface{}      `json:"value" yaml:"value"`
	Hosts       []string         `json:"hosts" yaml:"hosts"`
	Description string           `json:"description" yaml:"description"`
	Enabled     bool             `json:"enabled" yaml:"enabled"`
	IsModified  bool             `json:"isModified" yaml:"isModified"`
	Limitation  TuningLimitation `json:"limitation" yaml:"limitation"`
	*Node  `json:"node,omitempty" yaml:"node,omitempty" bson:"node,omitempty"`
	Status *status.Details `json:"status,omitempty" yaml:"status,omitempty" bson:"status,omitempty"`
}
    func GetCurrentTuning ¶
func ListCurrentTunings ¶
func ListCurrentTunings() []Tuning
func (*Tuning) SetNodeInfo ¶
type TuningLimitation ¶
type TuningLimitation struct {
	Type    string      `json:"type"`
	Default interface{} `json:"default"`
	Min     interface{} `json:"min,omitempty"`
	Max     interface{} `json:"max,omitempty"`
}
    type TuningPolicy ¶
type TuningPolicy struct {
	Name    string   `json:"name" yaml:"name"`
	Version string   `json:"version" yaml:"version"`
	Enabled bool     `json:"enabled" yaml:"enabled"`
	Tunings []Tuning `json:"tunings" yaml:"tunings"`
}
    func (*TuningPolicy) AppendTunings ¶
func (t *TuningPolicy) AppendTunings(tunings []Tuning)
func (*TuningPolicy) DeleteTuning ¶
func (t *TuningPolicy) DeleteTuning(tuningName string)
type TuningSpec ¶
type TuningSpec struct {
	Name        string           `json:"name"`
	Limitation  TuningLimitation `json:"limitation"`
	Description string           `json:"description"`
	Roles       []*Role          `json:"roles"`
	Selector    `json:"selector"`
}
    func ListTuningSpecs ¶
func ListTuningSpecs() []TuningSpec
type VmDiskIopsUsage ¶
type VmDiskIopsUsage struct {
	Id      string         `json:"id"`
	Name    string         `json:"name"`
	Device  string         `json:"device,omitempty"`
	Ops     float64        `json:"ops"`
	History []TimeOpsPoint `json:"history"`
}
    type VmMetricsUsage ¶
type VmMetricsUsage struct {
	Id          string            `json:"id"`
	Name        string            `json:"name"`
	Device      string            `json:"device,omitempty"`
	UsedPercent float64           `json:"usedPercent"`
	History     []TimeUsedPercent `json:"history"`
}
    type VmNetworkTrafficUsage ¶
type VmNetworkTrafficUsage struct {
	Id      string             `json:"id"`
	Name    string             `json:"name"`
	Device  string             `json:"device,omitempty"`
	Packets float64            `json:"packets"`
	History []TimePacketsPoint `json:"history"`
}
    type VmPercentageUsage ¶
type VmPercentageUsage struct {
	Id          string            `json:"id"`
	Name        string            `json:"name"`
	UsedPercent float64           `json:"usedPercent"`
	History     []TimeUsedPercent `json:"history"`
}
    type VmUsage ¶
type VmUsage struct {
	Vcpu    ComputeStatistic `json:"vcpu"`
	Memory  SpaceStatistic   `json:"memory"`
	Storage SpaceStatistic   `json:"storage"`
}
     Click to show internal directories. 
   Click to hide internal directories.