cubecos

package
v0.0.1-dev-f1460d1 Latest Latest
Warning

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

Go to latest
Published: May 12, 2025 License: Apache-2.0 Imports: 68 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 (
	// note:
	// the orderSensitiveServices is a list of services that are ordered by their dependencies.
	// please do not change the order of the services in this list unless you know what you are doing.
	OrderSensitiveServices = []services.Service{
		{
			Name:     "clusterLink",
			Category: "core",
			Modules: []services.Module{
				{Name: "link", IsRepairable: false},
				{Name: "clock", IsRepairable: true},
				{Name: "dns", IsRepairable: false},
			},
		},
		{
			Name:     "clusterSys",
			Category: "core",
			Modules: []services.Module{
				{Name: "bootstrap", IsRepairable: false},
				{Name: "license", IsRepairable: false},
			},
		},
		{
			Name:     "clusterSettings",
			Category: "core",
			Modules: []services.Module{
				{Name: "etcd", IsRepairable: true},
				{Name: "nodelist", IsRepairable: false},
				{Name: "mongodb", IsRepairable: true},
			},
		},
		{
			Name:     "haCluster",
			Category: "core",
			Modules: []services.Module{
				{Name: "hacluster", IsRepairable: true},
			},
		},
		{
			Name:     "msgQueue",
			Category: "core",
			Modules: []services.Module{
				{Name: "rabbitmq", IsRepairable: true},
			},
		},
		{
			Name:     "iaasDb",
			Category: "core",
			Modules: []services.Module{
				{Name: "mysql", IsRepairable: true},
			},
		},
		{
			Name:     "virtualIp",
			Category: "core",
			Modules: []services.Module{
				{Name: "vip", IsRepairable: true},
				{Name: "haproxy_ha", IsRepairable: true},
			},
		},
		{
			Name:     "storage",
			Category: "storage",
			Modules: []services.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: []services.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: []services.Module{
				{Name: "k3s", IsRepairable: true},
				{Name: "keycloak", IsRepairable: true},
			},
		},
		{
			Name:     "network",
			Category: "cloud computing",
			Modules: []services.Module{
				{Name: "neutron", IsRepairable: true},
			},
		},
		{
			Name:     "compute",
			Category: "cloud computing",
			Modules: []services.Module{
				{Name: "nova", IsRepairable: true},
				{Name: "cyborg", IsRepairable: true},
			},
		},
		{
			Name:     "bareMetal",
			Category: "cloud computing",
			Modules: []services.Module{
				{Name: "ironic", IsRepairable: true},
			},
		},
		{
			Name:     "image",
			Category: "cloud computing",
			Modules: []services.Module{
				{Name: "glance", IsRepairable: true},
			},
		},
		{
			Name:     "blockStor",
			Category: "cloud computing",
			Modules: []services.Module{
				{Name: "cinder", IsRepairable: true},
			},
		},
		{
			Name:     "fileStor",
			Category: "cloud computing",
			Modules: []services.Module{
				{Name: "manila", IsRepairable: true},
			},
		},
		{
			Name:     "objectStor",
			Category: "cloud computing",
			Modules: []services.Module{
				{Name: "swift", IsRepairable: false},
			},
		},
		{
			Name:     "orchestration",
			Category: "cloud computing",
			Modules: []services.Module{
				{Name: "heat", IsRepairable: true},
			},
		},
		{
			Name:     "lbaas",
			Category: "cloud computing",
			Modules: []services.Module{
				{Name: "octavia", IsRepairable: true},
			},
		},
		{
			Name:     "dnsaas",
			Category: "cloud computing",
			Modules: []services.Module{
				{Name: "designate", IsRepairable: true},
			},
		},
		{
			Name:     "k8saas",
			Category: "cloud computing",
			Modules: []services.Module{
				{Name: "rancher", IsRepairable: false},
			},
		},
		{
			Name:     "instanceHa",
			Category: "cloud computing",
			Modules: []services.Module{
				{Name: "masakari", IsRepairable: true},
			},
		},
		{
			Name:     "businessLogic",
			Category: "cloud computing",
			Modules: []services.Module{
				{Name: "senlin", IsRepairable: true},
				{Name: "watcher", IsRepairable: true},
			},
		},
		{
			Name:     "dataPipe",
			Category: "infrascope",
			Modules: []services.Module{
				{Name: "zookeeper", IsRepairable: true},
				{Name: "kafka", IsRepairable: true},
			},
		},
		{
			Name:     "metrics",
			Category: "infrascope",
			Modules: []services.Module{
				{Name: "monasca", IsRepairable: true},
				{Name: "telegraf", IsRepairable: true},
				{Name: "grafana", IsRepairable: true},
			},
		},
		{
			Name:     "logAnalytics",
			Category: "infrascope",
			Modules: []services.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: []services.Module{
				{Name: "influxdb", IsRepairable: true},
				{Name: "kapacitor", IsRepairable: true},
			},
		},
		{
			Name:               "node",
			IsInternalViewOnly: true,
			Modules: []services.Module{
				{Name: "node", IsRepairable: false},
			},
		},
	}

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

Functions

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 triggers.CosSchema) error

func ApplyTuning

func ApplyTuning(isolatedDir string) error

func ApplyTunings

func ApplyTunings(tunings []tunings.Tuning) error

func CheckServiceHealth

func CheckServiceHealth(service services.Service) error

func ConvertToBlockDevice

func ConvertToBlockDevice(rawBlockDev nodes.RawBlockDevice) nodes.BlockDevice

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 *auths.User) (*gocloak.JWT, error)

func DeleteAndCreateEmailRecipient

func DeleteAndCreateEmailRecipient(setting settings.Setting) error

func DeleteAndCreateSlackChannel

func DeleteAndCreateSlackChannel(setting settings.Setting) error

func DeleteEmailRecipient

func DeleteEmailRecipient(address string) error

func DeleteEmailSender

func DeleteEmailSender() error

func DeleteSlackChannel

func DeleteSlackChannel(url string) error

func GeHostsDiskLatencyHistory

func GeHostsDiskLatencyHistory(readStmt, writeStmt string) (*metric.StorageTimeSeries, error)

func GenModuleHealthHistoryQuery

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

func GetAlertSetting

func GetAlertSetting() (*settings.Cos, error)

func GetClusterVirtualIp

func GetClusterVirtualIp() (string, error)

func GetControllerVirtualIp

func GetControllerVirtualIp(net string) (string, error)

func GetDataCenterName

func GetDataCenterName() (string, error)

func GetDataCenterNumericVersion

func GetDataCenterNumericVersion() (string, error)

func GetDataCenterVersion

func GetDataCenterVersion() (string, error)

func GetDiskWriteIopsHistoryOfVm

func GetDiskWriteIopsHistoryOfVm(entityId, device string) ([]metric.TimeValue, 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) ([]events.Stat, error)

func GetHostCpuHistory

func GetHostCpuHistory(stmt string) (*metric.History, error)

func GetHostCpuSummary

func GetHostCpuSummary(hostname string) (*metric.Compute, error)

func GetHostDiskStorageSummary

func GetHostDiskStorageSummary() (*metric.Space, error)

func GetHostDiskUsageHistory

func GetHostDiskUsageHistory(entityId string, period time.Period) ([]metric.TimeValue, error)

func GetHostMemoryHistory

func GetHostMemoryHistory(stmt string) ([]metric.TimeValue, error)

func GetHostMemorySizeHistory

func GetHostMemorySizeHistory(stmt string) (*metric.History, error)

func GetHostMemoryUsageSummary

func GetHostMemoryUsageSummary(hostname string) (*metric.Space, error)

func GetHostNetworkEgressHistory

func GetHostNetworkEgressHistory(entityId string, period time.Period) ([]metric.TimeValue, error)

func GetHostNetworkIngressHistory

func GetHostNetworkIngressHistory(entityId string, period time.Period) ([]metric.TimeValue, error)

func GetHostUsage

func GetHostUsage(node nodes.Node) (*metric.HostUsage, error)

func GetHostsCpuAverage

func GetHostsCpuAverage(cpuStats []metric.Compute) metric.Compute

func GetHostsCpuSummary

func GetHostsCpuSummary(stmt string) (*metric.Compute, error)

func GetHostsCpuUsageRank

func GetHostsCpuUsageRank(stmt string) (*metric.Rank, error)

func GetHostsDiskBandwidthHistory

func GetHostsDiskBandwidthHistory(readStmt, writeStmt string) (*metric.StorageTimeSeries, error)

func GetHostsDiskIopsHistory

func GetHostsDiskIopsHistory(readStmt, writeStmt string) (*metric.StorageTimeSeries, error)

func GetHostsDiskUsageRank

func GetHostsDiskUsageRank(stmt string) (*metric.Rank, error)

func GetHostsMemoryAverage

func GetHostsMemoryAverage(spaceStats []metric.Space) metric.Space

func GetHostsMemoryUsageRank

func GetHostsMemoryUsageRank(stmt string) (*metric.Rank, error)

func GetHostsMemoryUsageSummary

func GetHostsMemoryUsageSummary() (*metric.Space, error)

func GetHostsNetworkEgressRank

func GetHostsNetworkEgressRank() (*metric.Rank, error)

func GetHostsNetworkIngressRank

func GetHostsNetworkIngressRank() (*metric.Rank, error)

func GetManagementIp

func GetManagementIp(mgmtNet string) (string, error)

func GetManagementNet

func GetManagementNet() (string, error)

func GetMemoryHistoryOfVm

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

func GetModuleHealthHistory

func GetModuleHealthHistory(module, duration, order string, onlyLast bool) ([]health.Check, error)

func GetNodeRole

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

func GetRawBlockDevices

func GetRawBlockDevices() ([]nodes.RawBlockDevice, error)

func GetRepairingInfo

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

func GetServicesToCheckHealth

func GetServicesToCheckHealth() []services.Service

func GetSlackChannel

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

func GetSlackChannels

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

func GetSourceAlertSetting

func GetSourceAlertSetting() (*settings.Cos, error)

func GetSourceNodeMap

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

func GetSourceTuning

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

func GetStandaloneVirtualIp

func GetStandaloneVirtualIp(net 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 GetSupportFileUrl

func GetSupportFileUrl(file support.File) string

func GetTriggers

func GetTriggers() ([]triggers.CosSchema, error)

func GetTuningPolicy

func GetTuningPolicy(filePath string) (*tunings.Policy, error)

func GetTuningValue

func GetTuningValue(name string) (string, error)

func GetUnhealthyServices

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

func GetVmCpuHistory

func GetVmCpuHistory(entityId string, period time.Period) ([]metric.TimeValue, error)

func GetVmDiskReadIopsHistory

func GetVmDiskReadIopsHistory(entityId, device string) ([]metric.TimeValue, error)

func GetVmNetworkTrafficInHistory

func GetVmNetworkTrafficInHistory(entityId, device string) ([]metric.TimeValue, error)

func GetVmNetworkTrafficOutHistory

func GetVmNetworkTrafficOutHistory(entityId, device string) ([]metric.TimeValue, error)

func GetVmUsage

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

func GetVmsCpuUsageRank

func GetVmsCpuUsageRank(stmt string) (*metric.Rank, error)

func GetVmsDiskReadIopsRank

func GetVmsDiskReadIopsRank(stmt string) (*metric.Rank, error)

func GetVmsDiskWriteIopsRank

func GetVmsDiskWriteIopsRank(stmt string) (*metric.Rank, error)

func GetVmsMemoryUsageRank

func GetVmsMemoryUsageRank(stmt string) (*metric.Rank, error)

func GetVmsNetworkEgressRank

func GetVmsNetworkEgressRank(stmt string) (*metric.Rank, error)

func GetVmsNetworkIngressRank

func GetVmsNetworkIngressRank(stmt string) (*metric.Rank, 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 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 IsDataCenterReady

func IsDataCenterReady() 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 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 settings.Setting) bool

func IsSupportFile

func IsSupportFile(file string) bool

func IsTriggerExist

func IsTriggerExist(name string) bool

func IsTuningApplied

func IsTuningApplied(tuning tunings.Tuning) error

func IsTuningDeleted

func IsTuningDeleted(tuning tunings.Tuning) bool

func IsValidMetricType

func IsValidMetricType(t string) bool

func IsValidService

func IsValidService(service string) bool

func IsValidServiceAndModule

func IsValidServiceAndModule(service, module string) bool

func ListBuiltInIntegrations

func ListBuiltInIntegrations() []integration.Service

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) ([]events.Event, error)

func ListHostSupportFiles

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

func ListLicenses

func ListLicenses() ([]licenses.License, error)

func ListSupportFiles

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

func ListSupportFilesFromPeerNodes

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

func ListTunings

func ListTunings(opts tunings.ListOptions) ([]tunings.Tuning, error)

func ListTuningsFromOtherNodes

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

func PutSupportFileToBucket

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

func ReadSettingSys

func ReadSettingSys(settingName string) (string, error)

func RemovePendingReq

func RemovePendingReq(db, collection string)

func RepairModule

func RepairModule(moduleName string) error

func RepairServiceHealth

func RepairServiceHealth(service services.Service) error

func SetSupportFileComment

func SetSupportFileComment(file support.File) error

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) (*licenses.Verification, error)

func WriteFakePolicyFile

func WriteFakePolicyFile(policy *settings.Cos)

Types

type DataCenterSummary

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

func GetDataCenterUsage

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

type Health

type Health struct {
	*base.DataCenter `json:"dataCenter,omitempty" bson:"dataCenter,omitempty"`
	*Overall         `json:"overall,omitempty" bson:"overall"`
	Services         []services.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 services.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() []metric.Compute

func (*HostSummary) ListMemoryUsages

func (h *HostSummary) ListMemoryUsages() []metric.Space

func (*HostSummary) SetHostUsages

func (h *HostSummary) SetHostUsages(nodes []nodes.Node)

func (*HostSummary) SetRoleUsages

func (h *HostSummary) SetRoleUsages()

type HostUsage

type HostUsage struct {
	Role    string         `json:"role"`
	Name    string         `json:"name"`
	Address string         `json:"address"`
	Cpu     metric.Compute `json:"cpu"`
	Memory  metric.Space   `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      []health.Check `json:"history"`
	Status       status.Health  `json:"status"`
}

func GetServiceHealthHistory

func GetServiceHealthHistory(serviceName, duration string) []ModuleHealth

type NetworkInterface

type NetworkInterface 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"`
}

func DumpInterfaces

func DumpInterfaces() ([]NetworkInterface, error)

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"`
}

type RoleUsage

type RoleUsage struct {
	Count  int            `json:"count"`
	Cpu    metric.Compute `json:"cpu"`
	Memory metric.Space   `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"`
	metric.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