api

package
v0.0.0-...-e1e7c94 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StatusDeleting = "Deleting"
	StatusCreating = "Creating"
	StatusStopping = "Stopping"
	StatusStopped  = "Stopped"
	StatusRunning  = "Running"
	//StatusUpdating = "Updating"
	StatusUnknown  = ""
	MonitorTypeALL = "all"
	DiskChinese    = "磁盘"
	MemoryChinese  = "内存"
	CPUChinese     = "CPU"
)

Variables

View Source
var (
	ClientSet                         *kubernetes.Clientset
	DynamicClient                     *dynamic.DynamicClient
	DebtNamespaceMap                  = make(map[string]bool)
	DiskFullNamespaceMap              = make(map[string]bool)
	CPUNotificationInfoMap            = make(map[string]*Info)
	MemNotificationInfoMap            = make(map[string]*Info)
	DiskNotificationInfoMap           = make(map[string]*Info)
	LastBackupStatusMap               = make(map[string]string)
	IsSendBackupStatusMap             = make(map[string]string)
	DatabaseNotificationInfoMap       = make(map[string]*Info)
	ExceededQuotaException            = "exceeded quota"
	DiskException                     = "Writing to log file failed"
	OwnerLabel                        = "user.sealos.io/owner"
	DatabaseTypeLabel                 = "clusterdefinition.kubeblocks.io/name"
	ClusterName                       string
	MonitorType                       string
	ClusterNS                         []string
	FeishuWebhookURLMap               = make(map[string]string)
	ClusterRegionMap                  = make(map[string]string)
	BaseURL                           string
	LOCALREGION                       string
	DatabaseMonitor                   bool
	DiskMonitor                       bool
	CPUMemMonitor                     bool
	BackupMonitor                     bool
	QuotaMonitor                      bool
	CockroachMonitor                  bool
	DatabaseDiskMonitorThreshold      float64
	DatabaseExceptionMonitorThreshold float64
	DatabaseCPUMonitorThreshold       float64
	DatabaseMemMonitorThreshold       float64
	QuotaThreshold                    float64
	APPID                             string
	APPSECRET                         string
	GlobalCockroachURI                string
	LocalCockroachURI                 string
	DatabaseStatusMessageIDMap        = make(map[string]string)
	DatabaseDiskMessageIDMap          = make(map[string]string)
	DatabaseCPUMessageIDMap           = make(map[string]string)
	DatabaseMemMessageIDMap           = make(map[string]string)
	DatabaseBackupMessageIDMap        = make(map[string]string)
	QuotaMessageIDMap                 = make(map[string]string)
)

Functions

func GetENV

func GetENV() error

Types

type Info

type Info struct {
	DatabaseClusterName string
	Namespace           string
	DebtLevel           string
	DatabaseType        string
	Events              string
	Reason              string
	NotificationType    string
	DiskUsage           string
	CPUUsage            string
	MemUsage            string
	PerformanceType     string
	ExceptionType       string
	ExceptionStatus     string
	RecoveryStatus      string
	ExceptionStatusTime string
	RecoveryTime        string
	DatabaseClusterUID  string
	FeishuWebHook       string
	//struct
	FeishuInfo []map[string]interface{}
}

type NameSpaceQuota

type NameSpaceQuota struct {
	NameSpace             string
	CPULimit              string
	MemLimit              string
	GPULimit              string
	EphemeralStorageLimit string
	ObjectStorageLimit    string
	NodePortLimit         string
	StorageLimit          string
	CPUUsage              string
	MemUsage              string
	GPUUsage              string
	EphemeralStorageUsage string
	ObjectStorageUsage    string
	NodePortUsage         string
	StorageUsage          string
}

type QueryResult

type QueryResult struct {
	Status string `json:"status"`
	Data   struct {
		ResultType string `json:"resultType"`
		Result     []struct {
			Metric map[string]string `json:"metric"`
			Values [][]interface{}   `json:"values"`
			Value  []interface{}     `json:"value"`
		} `json:"result"`
	} `json:"data"`
}

Jump to

Keyboard shortcuts

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