cubecos

package
v0.0.1-dev-550d77a Latest Latest
Warning

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

Go to latest
Published: May 8, 2025 License: Apache-2.0 Imports: 58 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LicenseValid              = 1
	LicenseExpired            = 251
	LicenseNotInstalled       = 252
	LicenseInvalidHardware    = 253
	LicenseInvalidSignature   = 254
	LicenseSysytemCompromised = 255
)
View Source
const (
	TuningPolicyFile = "/etc/policies/tuning/tuning1_0.yml"

	// private tunings
	CubeSysHa                = "cubesys.ha"
	CubeSysController        = "cubesys.controller"
	CubeSysControllerVip     = "cubesys.control.vip"
	CubeSysControllerIp      = "cubesys.controller.ip"
	CubeSysManagementNetwork = "cubesys.management"
	CubeSysStorageNetwork    = "cubesys.storage"
	CubeNetIfAddrPrefix      = "net.if.addr."
	NetIfAddrEth0            = "net.if.addr.eth0"

	// public tunings
	BarbicanDebugEnabled        = "barbican.debug.enabled"
	CephDebugEnabled            = "ceph.debug.enabled"
	CephMirrorMetaSync          = "ceph.mirror.meta.sync"
	CinderBackupAccount         = "cinder.backup.account"
	CinderBackupEndpoint        = "cinder.backup.endpoint"
	CinderBackupOverride        = "cinder.backup.override"
	CinderBackupPool            = "cinder.backup.pool"
	CinderBackupSecret          = "cinder.backup.secret"
	CinderBackupType            = "cinder.backup.type"
	CinderDebugEnabled          = "cinder.debug.enabled"
	CinderExternalAccount       = "cinder.external.%d.account"
	CinderExternalDriver        = "cinder.external.%d.driver"
	CinderExternalEndpoint      = "cinder.external.%d.endpoint"
	CinderExternalName          = "cinder.external.%d.name"
	CinderExternalPool          = "cinder.external.%d.pool"
	CinderExternalSecret        = "cinder.external.%d.secret"
	CubesysAlertLevel           = "cubesys.alert.level"
	CubesysAlertLevelS          = "cubesys.alert.level.%s"
	CubesysConntableMax         = "cubesys.conntable.max"
	CubesysLogDefaultRetention  = "cubesys.log.default.retention"
	CubesysProviderExtra        = "cubesys.provider.extra"
	CyborgDebugEnabled          = "cyborg.debug.enabled"
	DebugEnableCoreDumpS        = "debug.enable_core_dump.%s"
	DebugEnableKdump            = "debug.enable_kdump"
	DebugLevelS                 = "debug.level.%s"
	DebugMaxCoreDump            = "debug.max_core_dump"
	DesignateDebugEnabled       = "designate.debug.enabled"
	GlanceDebugEnabled          = "glance.debug.enabled"
	GlanceExportRp              = "glance.export.rp"
	HeatDebugEnabled            = "heat.debug.enabled"
	InfluxdbCuratorRp           = "influxdb.curator.rp"
	IronicDebugEnabled          = "ironic.debug.enabled"
	IronicDeployServer          = "ironic.deploy.server"
	KapacitorAlertCheckEnabled  = "kapacitor.alert.check.enabled"
	KapacitorAlertCheckEventId  = "kapacitor.alert.check.eventid"
	KapacitorAlertCheckInterval = "kapacitor.alert.check.interval"
	KapacitorAlertExtraPrefix   = "kapacitor.alert.extra.prefix"
	KapacitorAlertFlowBase      = "kapacitor.alert.flow.base"
	KapacitorAlertFlowThreshold = "kapacitor.alert.flow.threshold"
	KapacitorAlertFlowUnit      = "kapacitor.alert.flow.unit"
	KeystoneDebugEnabled        = "keystone.debug.enabled"
	ManilaDebugEnabled          = "manila.debug.enabled"
	ManilaVolumeType            = "manila.volume.type"
	MasakariHostEvacuateAll     = "masakari.host.evacuate_all"
	MasakariWaitPeriod          = "masakari.wait.period"
	MonascaDebugEnabled         = "monasca.debug.enabled"
	MysqlBackupCuratorRp        = "mysql.backup.curator.rp"
	NetIfMtuName                = "net.if.mtu.<name>"
	NetIpv4TcpSyncookies        = "net.ipv4.tcp_syncookies"
	NetLacpDefaultRate          = "net.lacp.default.rate"
	NetLacpDefaultXmit          = "net.lacp.default.xmit"
	NeutronDebugEnabled         = "neutron.debug.enabled"
	NovaControlHostMemory       = "nova.control.host.memory"
	NovaControlHostVcpu         = "nova.control.host.vcpu"
	NovaDebugEnabled            = "nova.debug.enabled"
	NovaGpuType                 = "nova.gpu.type"
	NovaOvercommitCpuRatio      = "nova.overcommit.cpu.ratio"
	NovaOvercommitDiskRatio     = "nova.overcommit.disk.ratio"
	NovaOvercommitRamRatio      = "nova.overcommit.ram.ratio"
	NtpDebugEnabled             = "ntp.debug.enabled"
	OctaviaDebugEnabled         = "octavia.debug.enabled"
	OctaviaHa                   = "octavia.ha"
	OpensearchCuratorRp         = "opensearch.curator.rp"
	OpensearchHeapSize          = "opensearch.heap.size"
	SenlinDebugEnabled          = "senlin.debug.enabled"
	SkylineDebugEnabled         = "skyline.debug.enabled"
	SnapshotApplyAction         = "snapshot.apply.action"
	SnapshotApplyPolicyIgnore   = "snapshot.apply.policy.ignore"
	SshdBindToAllInterfaces     = "sshd.bind_to_all_interfaces"
	SshdSessionInactivity       = "sshd.session.inactivity"
	TimeTimezone                = "time.timezone"
	UpdateSecurityAutoUpdate    = "update.security.autoupdate"
	WatcherDebugEnabled         = "watcher.debug.enabled"

	// setting sys
	SysProductDescription = "sys.product.description"
	SysProductVersion     = "sys.product.version"
)
View Source
const (
	EtcNodeInventory = "/etc/settings.cluster.json"
)

Variables

View Source
var (
	OrderSensitiveServices = []v1.Service{
		{
			Name:     "clusterLink",
			Category: "core",
			Modules: []v1.Module{
				{Name: "link", IsRepairable: false},
				{Name: "clock", IsRepairable: true},
				{Name: "dns", IsRepairable: false},
			},
		},
		{
			Name:     "clusterSys",
			Category: "core",
			Modules: []v1.Module{
				{Name: "bootstrap", IsRepairable: false},
				{Name: "license", IsRepairable: false},
			},
		},
		{
			Name:     "clusterSettings",
			Category: "core",
			Modules: []v1.Module{
				{Name: "etcd", IsRepairable: true},
				{Name: "nodelist", IsRepairable: false},
				{Name: "mongodb", IsRepairable: true},
			},
		},
		{
			Name:     "haCluster",
			Category: "core",
			Modules: []v1.Module{
				{Name: "hacluster", IsRepairable: true},
			},
		},
		{
			Name:     "msgQueue",
			Category: "core",
			Modules: []v1.Module{
				{Name: "rabbitmq", IsRepairable: true},
			},
		},
		{
			Name:     "iaasDb",
			Category: "core",
			Modules: []v1.Module{
				{Name: "mysql", IsRepairable: true},
			},
		},
		{
			Name:     "virtualIp",
			Category: "core",
			Modules: []v1.Module{
				{Name: "vip", IsRepairable: true},
				{Name: "haproxy_ha", IsRepairable: true},
			},
		},
		{
			Name:     "storage",
			Category: "storage",
			Modules: []v1.Module{
				{Name: "ceph", IsRepairable: false},
				{Name: "ceph_mon", IsRepairable: true},
				{Name: "ceph_mgr", IsRepairable: true},
				{Name: "ceph_mds", IsRepairable: true},
				{Name: "ceph_osd", IsRepairable: true},
				{Name: "ceph_rgw", IsRepairable: true},
				{Name: "rbd_target", IsRepairable: false},
			},
		},
		{
			Name:     "apiService",
			Category: "core",
			Modules: []v1.Module{
				{Name: "haproxy", IsRepairable: true},
				{Name: "httpd", IsRepairable: true},
				{Name: "skyline", IsRepairable: true},
				{Name: "lmi", IsRepairable: true},
				{Name: "memcache", IsRepairable: true},
				{Name: "api", IsRepairable: true},
			},
		},
		{
			Name:     "singleSignOn",
			Category: "core",
			Modules: []v1.Module{
				{Name: "k3s", IsRepairable: true},
				{Name: "keycloak", IsRepairable: true},
			},
		},
		{
			Name:     "network",
			Category: "cloud computing",
			Modules: []v1.Module{
				{Name: "neutron", IsRepairable: true},
			},
		},
		{
			Name:     "compute",
			Category: "cloud computing",
			Modules: []v1.Module{
				{Name: "nova", IsRepairable: true},
				{Name: "cyborg", IsRepairable: true},
			},
		},
		{
			Name:     "bareMetal",
			Category: "cloud computing",
			Modules: []v1.Module{
				{Name: "ironic", IsRepairable: true},
			},
		},
		{
			Name:     "image",
			Category: "cloud computing",
			Modules: []v1.Module{
				{Name: "glance", IsRepairable: true},
			},
		},
		{
			Name:     "blockStor",
			Category: "cloud computing",
			Modules: []v1.Module{
				{Name: "cinder", IsRepairable: true},
			},
		},
		{
			Name:     "fileStor",
			Category: "cloud computing",
			Modules: []v1.Module{
				{Name: "manila", IsRepairable: true},
			},
		},
		{
			Name:     "objectStor",
			Category: "cloud computing",
			Modules: []v1.Module{
				{Name: "swift", IsRepairable: false},
			},
		},
		{
			Name:     "orchestration",
			Category: "cloud computing",
			Modules: []v1.Module{
				{Name: "heat", IsRepairable: true},
			},
		},
		{
			Name:     "lbaas",
			Category: "cloud computing",
			Modules: []v1.Module{
				{Name: "octavia", IsRepairable: true},
			},
		},
		{
			Name:     "dnsaas",
			Category: "cloud computing",
			Modules: []v1.Module{
				{Name: "designate", IsRepairable: true},
			},
		},
		{
			Name:     "k8saas",
			Category: "cloud computing",
			Modules: []v1.Module{
				{Name: "rancher", IsRepairable: false},
			},
		},
		{
			Name:     "instanceHa",
			Category: "cloud computing",
			Modules: []v1.Module{
				{Name: "masakari", IsRepairable: true},
			},
		},
		{
			Name:     "businessLogic",
			Category: "cloud computing",
			Modules: []v1.Module{
				{Name: "senlin", IsRepairable: true},
				{Name: "watcher", IsRepairable: true},
			},
		},
		{
			Name:     "dataPipe",
			Category: "infrascope",
			Modules: []v1.Module{
				{Name: "zookeeper", IsRepairable: true},
				{Name: "kafka", IsRepairable: true},
			},
		},
		{
			Name:     "metrics",
			Category: "infrascope",
			Modules: []v1.Module{
				{Name: "monasca", IsRepairable: true},
				{Name: "telegraf", IsRepairable: true},
				{Name: "grafana", IsRepairable: true},
			},
		},
		{
			Name:     "logAnalytics",
			Category: "infrascope",
			Modules: []v1.Module{
				{Name: "filebeat", IsRepairable: true},
				{Name: "auditbeat", IsRepairable: true},
				{Name: "logstash", IsRepairable: true},
				{Name: "opensearch", IsRepairable: true},
				{Name: "opensearch-dashboards", IsRepairable: true},
			},
		},
		{
			Name:     "notifications",
			Category: "infrascope",
			Modules: []v1.Module{
				{Name: "influxdb", IsRepairable: true},
				{Name: "kapacitor", IsRepairable: true},
			},
		},
		{
			Name:               "node",
			IsInternalViewOnly: true,
			Modules: []v1.Module{
				{Name: "node", IsRepairable: false},
			},
		},
	}

	Modules           = map[string]v1.Module{}
	ModuleToService   = map[string]string{}
	ServiceToCategory = map[string]string{}
	ServiceToModules  = map[string][]v1.Module{}
)

Functions

func AcquireTuningLock

func AcquireTuningLock() error

func ApplyEmailRecipient

func ApplyEmailRecipient(recipient email.Recipient) error

func ApplyEmailSender

func ApplyEmailSender(sender email.Sender) error

func ApplySlackChannel

func ApplySlackChannel(channel slack.CosChannel) error

func ApplyTitlePrefix

func ApplyTitlePrefix(titlePrefix string) error

func ApplyTrigger

func ApplyTrigger(trigger trigger.CosOptions) error

func ApplyTuning

func ApplyTuning(isolatedDir string) error

func ApplyTunings

func ApplyTunings(tunings []v1.Tuning) error

func CheckServiceHealth

func CheckServiceHealth(service v1.Service) error

func CountEvents

func CountEvents(stmt string) (int64, error)

func CreateSupportCommentFile

func CreateSupportCommentFile(file support.File) (string, error)

func CreateSupportFile

func CreateSupportFile(file support.File) error

func CreateToken

func CreateToken(user *v1.User) (*gocloak.JWT, error)

func DeleteAndCreateEmailRecipient

func DeleteAndCreateEmailRecipient(setting setting.Options) error

func DeleteAndCreateSlackChannel

func DeleteAndCreateSlackChannel(setting setting.Options) error

func DeleteEmailRecipient

func DeleteEmailRecipient(address string) error

func DeleteEmailSender

func DeleteEmailSender() error

func DeleteSlackChannel

func DeleteSlackChannel(url string) error

func GeDiskLatencyHistoryOfHosts

func GeDiskLatencyHistoryOfHosts(readStmt, writeStmt string) (*v1.StorageTimeSeries, error)

func GenModuleHealthHistoryQuery

func GenModuleHealthHistoryQuery(moduleName, past, order string, onlyLast bool) string

func GetAlertSetting

func GetAlertSetting() (*setting.CosAlert, error)

func GetClusterVirtualIp

func GetClusterVirtualIp() (string, error)

func GetControllerVirtualIp

func GetControllerVirtualIp(mgmtNet string) (string, error)

func GetCpuAverageOfHosts

func GetCpuAverageOfHosts(cpuStats []v1.ComputeStatistic) v1.ComputeStatistic

func GetCpuHistoryOfHost

func GetCpuHistoryOfHost(stmt string) (*v1.MetricHistory, error)

func GetCpuHistoryOfVm

func GetCpuHistoryOfVm(entityId string, period v1.Period) ([]v1.TimeValue, error)

func GetCpuSummaryOfHost

func GetCpuSummaryOfHost(hostname string) (*v1.ComputeStatistic, error)

func GetCpuSummaryOfHosts

func GetCpuSummaryOfHosts(stmt string) (*v1.ComputeStatistic, error)

func GetCpuUsageRankOfHosts

func GetCpuUsageRankOfHosts(stmt string) (*v1.MetricRank, error)

func GetCpuUsageRankOfVms

func GetCpuUsageRankOfVms(stmt string) (*v1.MetricRank, error)

func GetDataCenterName

func GetDataCenterName() (string, error)

func GetDataCenterNumericVersion

func GetDataCenterNumericVersion() (string, error)

func GetDataCenterVersion

func GetDataCenterVersion() (string, error)

func GetDiskIopsHistoryOfHosts

func GetDiskIopsHistoryOfHosts(readStmt, writeStmt string) (*v1.StorageTimeSeries, error)

func GetDiskReadIopsHistoryOfVm

func GetDiskReadIopsHistoryOfVm(entityId, device string) ([]v1.TimeValue, error)

func GetDiskReadIopsRankOfVms

func GetDiskReadIopsRankOfVms(stmt string) (*v1.MetricRank, error)

func GetDiskStorageBandwidthHistory

func GetDiskStorageBandwidthHistory(readStmt, writeStmt string) (*v1.StorageTimeSeries, error)

func GetDiskStorageSummaryOfHost

func GetDiskStorageSummaryOfHost() (*v1.SpaceStatistic, error)

func GetDiskUsageHistoryOfHost

func GetDiskUsageHistoryOfHost(entityId string, period v1.Period) ([]v1.TimeValue, error)

func GetDiskUsageRankOfHosts

func GetDiskUsageRankOfHosts(stmt string) (*v1.MetricRank, error)

func GetDiskWriteIopsHistoryOfVm

func GetDiskWriteIopsHistoryOfVm(entityId, device string) ([]v1.TimeValue, error)

func GetDiskWriteIopsRankOfVms

func GetDiskWriteIopsRankOfVms(stmt string) (*v1.MetricRank, error)

func GetEmailRecipients

func GetEmailRecipients() ([]email.Recipient, error)

func GetEmailSenders

func GetEmailSenders() ([]email.Sender, error)

func GetEventFilterConditions

func GetEventFilterConditions(stmt string) ([]string, error)

func GetEventRank

func GetEventRank(stmt string) ([]event.Stat, error)

func GetHostUsage

func GetHostUsage(node v1.Node) (*v1.HostUsage, error)

func GetManagementIp

func GetManagementIp(mgmtNet string) (string, error)

func GetManagementNet

func GetManagementNet() (string, error)

func GetMemoryAverageOfHosts

func GetMemoryAverageOfHosts(spaceStats []v1.SpaceStatistic) v1.SpaceStatistic

func GetMemoryHistoryOfHost

func GetMemoryHistoryOfHost(stmt string) ([]v1.TimeValue, error)

func GetMemoryHistoryOfVm

func GetMemoryHistoryOfVm(entityId string, period v1.Period) ([]v1.TimeValue, error)

func GetMemorySizeHistoryOfHost

func GetMemorySizeHistoryOfHost(stmt string) (*v1.MetricHistory, error)

func GetMemoryUsageRankOfHosts

func GetMemoryUsageRankOfHosts(stmt string) (*v1.MetricRank, error)

func GetMemoryUsageRankOfVms

func GetMemoryUsageRankOfVms(stmt string) (*v1.MetricRank, error)

func GetMemoryUsageSummaryOfHost

func GetMemoryUsageSummaryOfHost(hostname string) (*v1.SpaceStatistic, error)

func GetMemoryUsageSummaryOfHosts

func GetMemoryUsageSummaryOfHosts() (*v1.SpaceStatistic, error)

func GetModuleHealthHistory

func GetModuleHealthHistory(moduleName, duration, order string, onlyLast bool) ([]v1.HealthCheck, error)

func GetNetworkTrafficInHistoryOfHost

func GetNetworkTrafficInHistoryOfHost(entityId string, period v1.Period) ([]v1.TimeValue, error)

func GetNetworkTrafficInHistoryOfVm

func GetNetworkTrafficInHistoryOfVm(entityId, device string) ([]v1.TimeValue, error)

func GetNetworkTrafficInRankOfHosts

func GetNetworkTrafficInRankOfHosts() (*v1.MetricRank, error)

func GetNetworkTrafficInRankOfVms

func GetNetworkTrafficInRankOfVms(stmt string) (*v1.MetricRank, error)

func GetNetworkTrafficOutHistoryOfHost

func GetNetworkTrafficOutHistoryOfHost(entityId string, period v1.Period) ([]v1.TimeValue, error)

func GetNetworkTrafficOutHistoryOfVm

func GetNetworkTrafficOutHistoryOfVm(entityId, device string) ([]v1.TimeValue, error)

func GetNetworkTrafficOutRankOfHosts

func GetNetworkTrafficOutRankOfHosts() (*v1.MetricRank, error)

func GetNetworkTrafficOutRankOfVms

func GetNetworkTrafficOutRankOfVms(stmt string) (*v1.MetricRank, error)

func GetNodeRole

func GetNodeRole() (string, error)
func GetOpenSearchRequestLink(requestId string) (string, error)

func GetRepairingInfo

func GetRepairingInfo() (*v1.ReairingInfo, error)

func GetServicesToCheckHealth

func GetServicesToCheckHealth() []v1.Service

func GetSlackChannel

func GetSlackChannel(channel string) (slack.CosChannel, error)

func GetSlackChannels

func GetSlackChannels() ([]slack.CosChannel, error)

func GetSourceAlertSetting

func GetSourceAlertSetting() (*setting.CosAlert, error)

func GetSourceNodeMap

func GetSourceNodeMap() (map[string]v1.Node, error)

func GetSourceTuning

func GetSourceTuning(name string) (*v1.Tuning, error)

func GetStandaloneVirtualIp

func GetStandaloneVirtualIp(mgmtNet string) (string, error)

func GetStorageIp

func GetStorageIp(storageNet string) (string, error)

func GetStorageNet

func GetStorageNet() (string, error)

func GetSupportFile

func GetSupportFile(file support.File) (string, error)

func GetSupportFileComment

func GetSupportFileComment(file string) (*support.File, error)

func GetSupportFileUrl

func GetSupportFileUrl(file support.File) string

func GetTriggers

func GetTriggers() ([]trigger.CosOptions, error)

func GetTuningPolicy

func GetTuningPolicy(filePath string) (*v1.TuningPolicy, error)

func GetTuningValue

func GetTuningValue(name string) (string, error)

func GetUnhealthyServices

func GetUnhealthyServices() ([]v1.Service, error)

func GetVmUsage

func GetVmUsage() (*v1.VmUsage, error)

func ImportClusterLicense

func ImportClusterLicense(licensePath string) error

note: currently, the COS license import result is not clear by identifying the return code because it will still return 0 even if the result is not ok. see ticket to know more https://github.com/bigstack-oss/cubecos/issues/29

func ImportNodeLicense

func ImportNodeLicense(licensePath string) error

func IsAlertSetting

func IsAlertSetting(file string) bool

func IsClusterSetReady

func IsClusterSetReady() bool

func IsEntityTypeValid

func IsEntityTypeValid(t string) bool

func IsExpectedEmptyStdOut

func IsExpectedEmptyStdOut(err error) bool

func IsGpuEnabled

func IsGpuEnabled() (bool, error)

func IsHaEnabled

func IsHaEnabled() (bool, error)

func IsHexSdkSuccess

func IsHexSdkSuccess(err error) bool

func IsLicenseFile

func IsLicenseFile(file string) bool

func IsLocalDataCenter

func IsLocalDataCenter(dataCenter string) bool

M2 TODO: Check if the data center is local

func IsMetricReportTypeValid

func IsMetricReportTypeValid(t string) bool

func IsMetricTypeValid

func IsMetricTypeValid(t string) bool

func IsModuleHealthy

func IsModuleHealthy(moduleName string) bool

func IsOvnSFlowEnabled

func IsOvnSFlowEnabled() bool

func IsRepairable

func IsRepairable() bool

func IsRepairableModule

func IsRepairableModule(module string) bool

func IsRepairing

func IsRepairing() bool

func IsSettingDeleted

func IsSettingDeleted(setting setting.Options) bool

func IsSupportFile

func IsSupportFile(file string) bool

func IsTriggerExist

func IsTriggerExist(name string) bool

func IsTuningApplied

func IsTuningApplied(tuning v1.Tuning) error

func IsTuningDeleted

func IsTuningDeleted(tuning v1.Tuning) bool

func IsValidService

func IsValidService(service string) bool

func IsValidServiceAndModule

func IsValidServiceAndModule(service, module string) bool

func ListBuiltInIntegrations

func ListBuiltInIntegrations() []v1.Integration

note: the description of each integration is from https://www.bigstack.co/products/cubecos/feature currently, cos has no the source text for it, but UI needs it, so we can only place it below for the time being.

also, cos is a bit hard to have a solid convention to fetch the port or path for the services, so we just hardcode the info here, but in the M2, can consider to discuss with team to support such features from cos.

func ListEvents

func ListEvents(stmt string) ([]event.Options, error)

func ListHostSupportFiles

func ListHostSupportFiles(opts support.ListFileOptions) ([]support.File, error)

func ListLicenses

func ListLicenses() ([]license.Options, error)

func ListSupportFiles

func ListSupportFiles(opts support.ListFileOptions) ([]support.File, error)

func ListSupportFilesFromOtherNodes

func ListSupportFilesFromOtherNodes() ([]support.File, error)

func ListTunings

func ListTunings(opts v1.ListTuningOptions) ([]v1.Tuning, error)

func ListTuningsFromOtherNodes

func ListTuningsFromOtherNodes() (map[string][]v1.Tuning, error)

func ParseLicenseExpiryAndStatus

func ParseLicenseExpiryAndStatus(value string) (license.Expiry, status.License)

func PutSupportFileToBucket

func PutSupportFileToBucket(key string, file io.Reader) error

func ReadSettingSys

func ReadSettingSys(settingName string) (string, error)

func ReleaseTuningLock

func ReleaseTuningLock() error

func RemovePendingReq

func RemovePendingReq(db, collection string)

func RepairModule

func RepairModule(moduleName string) error

func RepairServiceHealth

func RepairServiceHealth(service v1.Service) error

func SetSupportFileComment

func SetSupportFileComment(file support.File) error

func SetUnhealthLogUrl

func SetUnhealthLogUrl(history *[]v1.HealthCheck)

func SyncAlertSettings

func SyncAlertSettings()

func SyncBucketStore

func SyncBucketStore() error

func SyncHealthHistory

func SyncHealthHistory()

func SyncMetricsSummary

func SyncMetricsSummary()

func SyncSourceLicense

func SyncSourceLicense()

func SyncSupportFiles

func SyncSupportFiles()

func SyncTunings

func SyncTunings()

func UploadSupportFileToObjectStore

func UploadSupportFileToObjectStore(supportFile support.File) error

func VerifyLicense

func VerifyLicense(file string) (*license.Verification, error)

func WriteFakePolicyFile

func WriteFakePolicyFile(policy *setting.CosAlert)

Types

type DataCenterSummary

type DataCenterSummary struct {
	Usage v1.DataCenterUsage `json:"usage"`
}

func GetDataCenterUsage

func GetDataCenterUsage(hostSummary *HostSummary) (*DataCenterSummary, error)

type Health

type Health struct {
	*v1.DataCenter `json:"dataCenter,omitempty" bson:"dataCenter,omitempty"`
	*Overall       `json:"overall,omitempty" bson:"overall"`
	Services       []v1.Service `json:"services" bson:"services"`
}

func GetHealthSummary

func GetHealthSummary() Health

func (*Health) CopyEmptyServiceStruct

func (h *Health) CopyEmptyServiceStruct() Health

func (*Health) HasUnhealthyService

func (h *Health) HasUnhealthyService() bool

func (*Health) SetRepairingStatus

func (h *Health) SetRepairingStatus(service v1.Service)

type HostSummary

type HostSummary struct {
	Role   `json:"role"`
	Usages []HostUsage `json:"usages"`
}

func GetHostSummary

func GetHostSummary() (*HostSummary, error)

func (*HostSummary) ListCpuUsages

func (h *HostSummary) ListCpuUsages() []v1.ComputeStatistic

func (*HostSummary) ListMemoryUsages

func (h *HostSummary) ListMemoryUsages() []v1.SpaceStatistic

func (*HostSummary) SetHostUsageByNodes

func (h *HostSummary) SetHostUsageByNodes(nodes []v1.Node)

func (*HostSummary) SetRoleUsageByHosts

func (h *HostSummary) SetRoleUsageByHosts()

type HostUsage

type HostUsage struct {
	Role    string              `json:"role"`
	Name    string              `json:"name"`
	Address string              `json:"address"`
	Cpu     v1.ComputeStatistic `json:"cpu"`
	Memory  v1.SpaceStatistic   `json:"memory"`
}

type Ip

type Ip struct {
	Management string `json:"management"`
	Provider   string `json:"provider"`
	Overlay    string `json:"overlay"`
	Storage    string `json:"storage"`
}

type ModuleHealth

type ModuleHealth struct {
	Category     string           `json:"category"`
	Name         string           `json:"name"`
	Module       string           `json:"module"`
	IsRepairable bool             `json:"isRepairable"`
	History      []v1.HealthCheck `json:"history"`
	Status       status.Health    `json:"status"`
}

func GetServiceHealthHistory

func GetServiceHealthHistory(serviceName, duration string) []ModuleHealth

type Node

type Node struct {
	Hostname string `json:"hostname"`
	Role     string `json:"role"`
	Ip       `json:"ip"`
}

type Overall

type Overall struct {
	Status status.Health `json:"status" bson:"status"`
}

type Role

type Role struct {
	ControlConverged RoleUsage `json:"controlConverged"`
	Control          RoleUsage `json:"control"`
	Compute          RoleUsage `json:"compute"`
	Storage          RoleUsage `json:"storage"`
	EdgeCore         RoleUsage `json:"edgeCore"`
	Moderator        RoleUsage `json:"moderator"`
}

func GetRoleStatus

func GetRoleStatus() (*Role, error)

type RoleUsage

type RoleUsage struct {
	Count  int                 `json:"count"`
	Cpu    v1.ComputeStatistic `json:"cpu"`
	Memory v1.SpaceStatistic   `json:"memory"`
}

type Summary

type Summary struct {
	DataCenter DataCenterSummary `json:"dataCenter"`
	Host       HostSummary       `json:"host"`
	Vm         VmSummary         `json:"vm"`
}

func GetMetricsSummary

func GetMetricsSummary() *Summary

func (*Summary) Bytes

func (s *Summary) Bytes() []byte

func (*Summary) String

func (s *Summary) String() string

type VmStatus

type VmStatus struct {
	Total   int `json:"total"`
	Running int `json:"running"`
	Stopped int `json:"stopped"`
	Suspend int `json:"suspend"`
	Paused  int `json:"paused"`
	Error   int `json:"error"`
}

func GetVmStatus

func GetVmStatus() (*VmStatus, error)

type VmSummary

type VmSummary struct {
	Status     VmStatus `json:"status"`
	v1.VmUsage `json:"usage"`
}

func GetVmSummary

func GetVmSummary() (*VmSummary, error)

Jump to

Keyboard shortcuts

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