service

package
v0.0.0-...-77199df Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 42 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IMAGE_MAX_COUNT = 20
)
View Source
const VTAP_GROUP_SHORT_UUID_PREFIX = "g-"
View Source
const (
	VTAP_LICENSE_CHECK_EXCEPTION = "采集器(%s)不支持修改为指定授权类型"
)

Variables

View Source
var DEFAULT_DATA_SOURCE_DISPLAY_NAMES = []string{
	"网络-指标(秒级)", "网络-指标(分钟级)",
	"网络-流日志",
	"应用-指标(秒级)", "应用-指标(分钟级)",
	"应用-调用日志",
	"网络-TCP 时序数据",
	"网络-PCAP 数据",
	"系统监控数据",
	"外部指标数据",
	"Prometheus 数据",
	"事件-资源变更事件",
	"事件-IO 事件",
	"事件-告警事件",
	"应用-性能剖析",
	"网络-网络策略",
}
View Source
var DecapTypeData = map[int]string{
	0: "无",
	1: "VXLAN",
	2: "IPIP",
	3: "GRE",
}
View Source
var DeprecatedTapSideID = []int{48, 49, 50}

Functions

func CallIngesterAPIAddRP

func CallIngesterAPIAddRP(orgID int, ip string, dataSource, baseDataSource mysql.DataSource, ingesterApiPort int) error

func CallIngesterAPIDelRP

func CallIngesterAPIDelRP(orgID int, ip string, dataSource mysql.DataSource, ingesterApiPort int) error

func CallIngesterAPIModRP

func CallIngesterAPIModRP(orgID int, ip string, dataSource mysql.DataSource, ingesterApiPort int) error

func ConfigAnalyzerDataSource

func ConfigAnalyzerDataSource(ip string) error

func ConvertStrToIntList

func ConvertStrToIntList(convertStr string) ([]int, error)

func ConvertStrToIntListWithIgnore

func ConvertStrToIntListWithIgnore(convertStr string, ignoreFields []int) ([]int, error)

func CreateDataSource

func CreateDataSource(orgID int, dataSourceCreate *model.DataSourceCreate, cfg *config.ControllerConfig) (model.DataSource, error)

func CreateMailServer

func CreateMailServer(mailCreate model.MailServerCreate) (model.MailServer, error)

func CreateORGData

func CreateORGData(dataCreate model.ORGDataCreate, mysqlCfg mysqlcfg.MySqlConfig) (string, error)

CreateORGData create database and backs up the controller and analyzer tables. Returns the database name and error.

func CreatePlugin

func CreatePlugin(pluginCreate *mysql.Plugin) (*model.Plugin, error)

func CreateVTapGroupAdvancedConfig

func CreateVTapGroupAdvancedConfig(orgID int, createData *agent_config.AgentGroupConfig) (string, error)

func CreateVTapGroupConfig

func CreateVTapGroupConfig(orgID int, createData *agent_config.AgentGroupConfig) (*agent_config.AgentGroupConfigModel, error)

func CreateVtapRepo

func CreateVtapRepo(vtapRepoCreate *mysql.VTapRepo) (*model.VtapRepo, error)

func DeleteAnalyzer

func DeleteAnalyzer(orgID int, lcuuid string, m *monitor.AnalyzerCheck) (resp map[string]string, err error)

func DeleteController

func DeleteController(orgID int, lcuuid string, m *monitor.ControllerCheck) (resp map[string]string, err error)

func DeleteDataSource

func DeleteDataSource(orgID int, lcuuid string, cfg *config.ControllerConfig) (map[string]string, error)

func DeleteMailServer

func DeleteMailServer(lcuuid string) (map[string]string, error)

func DeleteORGData

func DeleteORGData(orgID int, mysqlCfg mysqlcfg.MySqlConfig) (err error)

func DeletePlugin

func DeletePlugin(name string) error

func DeleteVTapGroupConfig

func DeleteVTapGroupConfig(orgID int, lcuuid string) (*agent_config.AgentGroupConfigModel, error)

func DeleteVTapGroupConfigByFilter

func DeleteVTapGroupConfigByFilter(orgID int, args map[string]string) (string, error)

func DeleteVtapRepo

func DeleteVtapRepo(name string) error

func GetAgentStats

func GetAgentStats(g *genesis.Genesis, param string) ([]genesis.TridentStats, error)

func GetAnalyzers

func GetAnalyzers(orgID int, filter map[string]interface{}) (resp []model.Analyzer, err error)

func GetCloudBasicInfos

func GetCloudBasicInfos(filter map[string]string, m *manager.Manager) (resp []cloudmodel.BasicInfo, err error)

func GetCloudResource

func GetCloudResource(lcuuid string, m *manager.Manager) (resp cloudmodel.Resource, err error)

func GetControllers

func GetControllers(orgID int, filter map[string]string) (resp []model.Controller, err error)

func GetDataSources

func GetDataSources(orgID int, filter map[string]interface{}, specCfg *config.Specification) (resp []model.DataSource, err error)

func GetGenesisAgentStorage

func GetGenesisAgentStorage(vtapIDString string) (model.GenesisStorage, error)

func GetGenesisData

func GetGenesisData(g *genesis.Genesis) (genesis.GenesisSyncData, error)

func GetGenesisKubernetesData

func GetGenesisKubernetesData(g *genesis.Genesis, clusterID string) (map[string][]string, error)

func GetGenesisPrometheusData

func GetGenesisPrometheusData(g *genesis.Genesis, clusterID string) ([]cloudmodel.PrometheusTarget, error)

func GetGenesisSyncData

func GetGenesisSyncData(g *genesis.Genesis) (genesis.GenesisSyncData, error)

func GetIcon

func GetIcon(cfg *config.ControllerConfig) (*simplejson.Json, error)

func GetKubernetesGatherBasicInfos

func GetKubernetesGatherBasicInfos(lcuuid string, m *manager.Manager) (resp []kubernetes_gather_model.KubernetesGatherBasicInfo, err error)

func GetKubernetesGatherResources

func GetKubernetesGatherResources(lcuuid string, m *manager.Manager) (resp []kubernetes_gather_model.KubernetesGatherResource, err error)

func GetLeaderInfo

func GetLeaderInfo() (resp map[string]string, err error)

func GetMailServer

func GetMailServer(filter map[string]interface{}) (resp []model.MailServer, err error)

func GetPlugin

func GetPlugin(filter map[string]interface{}) ([]model.Plugin, error)

func GetRecorderCacheDiffBaseDataSet

func GetRecorderCacheDiffBaseDataSet(domainLcuuid, subDomainLcuuid string, m *manager.Manager) (resp diffbase.DataSet, err error)

func GetRecorderCacheToolDataSet

func GetRecorderCacheToolDataSet(domainLcuuid, subDomainLcuuid string, m *manager.Manager) (resp tool.DataSet, err error)

func GetRecorderDiffBaseByResourceLcuuid

func GetRecorderDiffBaseByResourceLcuuid(domainLcuuid, subDomainLcuuid, resourceType string, resourceLcuuid string, m *manager.Manager) (resp interface{}, err error)

func GetRecorderDiffBaseDataSetByResourceType

func GetRecorderDiffBaseDataSetByResourceType(domainLcuuid, subDomainLcuuid, resourceType string, m *manager.Manager) (resp map[string]interface{}, err error)

func GetRecorderDomainCache

func GetRecorderDomainCache(domainLcuuid, subDomainLcuuid string, m *manager.Manager) (resp cache.Cache, err error)

func GetRecorderToolMapByField

func GetRecorderToolMapByField(domainLcuuid, subDomainLcuuid, field string, m *manager.Manager) (resp map[interface{}]interface{}, err error)

func GetUnauthorizedTeamIDs

func GetUnauthorizedTeamIDs(userInfo *UserInfo, fpermitCfg *config.FPermit) (map[int]struct{}, error)

func GetVTapGroupAdvancedConfig

func GetVTapGroupAdvancedConfig(orgID int, lcuuid string) (string, error)

func GetVTapGroupAdvancedConfigs

func GetVTapGroupAdvancedConfigs(orgID int) ([]string, error)

func GetVTapGroupConfigByFilter

func GetVTapGroupConfigByFilter(orgID int, args map[string]string) (string, error)

func GetVTapGroupConfigs

func GetVTapGroupConfigs(userInfo *UserInfo, fpermitCfg *config.FPermit, filter map[string]interface{}) ([]*agent_config.AgentGroupConfigResponse, error)

func GetVTapGroupDetailedConfig

func GetVTapGroupDetailedConfig(orgID int, lcuuid string) (*model.DetailedConfig, error)

func GetVTapGroupExampleConfig

func GetVTapGroupExampleConfig() (string, error)

func GetVTapInterfaces

func GetVTapInterfaces(filter map[string]interface{}) (resp []model.VTapInterface, err error)

func GetVTapPortsCount

func GetVTapPortsCount() (int, error)

GetVTapPortsCount gets the number of virtual network cards covered by the deployed vtap, and virtual network type is VIF_DEVICE_TYPE_VM or VIF_DEVICE_TYPE_POD.

func GetVtapRepo

func GetVtapRepo(filter map[string]interface{}) ([]model.VtapRepo, error)

func IsVtapGroupShortUUID

func IsVtapGroupShortUUID(uuid string) bool

IsVtapGroupShortUUID checks uuid consists of numbers and English letters with g- prefix.

func TriggerKubernetesRefresh

func TriggerKubernetesRefresh(domainLcuuid, subDomainLcuuid string, version int, m *manager.Manager) error

func UpdateAnalyzer

func UpdateAnalyzer(
	orgID int, lcuuid string, analyzerUpdate map[string]interface{},
	m *monitor.AnalyzerCheck, cfg *config.ControllerConfig,
) (resp *model.Analyzer, err error)

func UpdateController

func UpdateController(
	orgID int, lcuuid string, controllerUpdate map[string]interface{},
	m *monitor.ControllerCheck, cfg *config.ControllerConfig,
) (resp *model.Controller, err error)

func UpdateDataSource

func UpdateDataSource(orgID int, lcuuid string, dataSourceUpdate model.DataSourceUpdate, cfg *config.ControllerConfig) (model.DataSource, error)

func UpdateMailServer

func UpdateMailServer(lcuuid string, mailServerUpdate map[string]interface{}) (model.MailServer, error)

func UpdateVTapGroupAdvancedConfig

func UpdateVTapGroupAdvancedConfig(orgID int, lcuuid string, updateData *agent_config.AgentGroupConfig) (string, error)

func UpdateVTapGroupConfig

func UpdateVTapGroupConfig(orgID int, lcuuid string, updateData *agent_config.AgentGroupConfig) (*agent_config.AgentGroupConfigModel, error)

func VTapRebalance

func VTapRebalance(args map[string]interface{}, cfg monitorconf.IngesterLoadBalancingStrategy) (*model.VTapRebalanceResult, error)

Types

type Agent

type Agent struct {
	// contains filtered or unexported fields
}

func NewAgent

func NewAgent(userInfo *UserInfo, cfg *config.ControllerConfig) *Agent

func (*Agent) BatchDelete

func (a *Agent) BatchDelete(deleteMap []map[string]string) (resp map[string][]string, err error)

func (*Agent) BatchUpdate

func (a *Agent) BatchUpdate(updateMap []map[string]interface{}) (resp map[string][]string, err error)

func (*Agent) BatchUpdateVtapLicenseType

func (a *Agent) BatchUpdateVtapLicenseType(updateMap []map[string]interface{}) (resp map[string][]string, err error)

func (*Agent) Create

func (a *Agent) Create(vtapCreate model.VtapCreate) (model.Vtap, error)

func (*Agent) Delete

func (a *Agent) Delete(lcuuid string) (resp map[string]string, err error)

func (*Agent) Get

func (a *Agent) Get(filter map[string]interface{}) (resp []model.Vtap, err error)

func (*Agent) Update

func (a *Agent) Update(lcuuid, name string, vtapUpdate map[string]interface{}) (resp model.Vtap, err error)

func (*Agent) UpdateVtapLicenseType

func (a *Agent) UpdateVtapLicenseType(lcuuid string, vtapUpdate map[string]interface{}) (resp model.Vtap, err error)

type AgentGroup

type AgentGroup struct {
	// contains filtered or unexported fields
}

func NewAgentGroup

func NewAgentGroup(userInfo *UserInfo, cfg *config.ControllerConfig) *AgentGroup

func (*AgentGroup) Create

func (a *AgentGroup) Create(vtapGroupCreate model.VtapGroupCreate) (resp model.VtapGroup, err error)

func (*AgentGroup) Delete

func (a *AgentGroup) Delete(lcuuid string) (resp map[string]string, err error)

func (*AgentGroup) Get

func (a *AgentGroup) Get(filter map[string]interface{}) (resp []model.VtapGroup, err error)

func (*AgentGroup) Update

func (a *AgentGroup) Update(lcuuid string, vtapGroupUpdate map[string]interface{}, cfg *config.ControllerConfig) (resp model.VtapGroup, err error)

type UserInfo

type UserInfo struct {
	Type         int
	ID           int
	ORGID        int
	DatabaseName string
}

func GetUserInfo

func GetUserInfo(c *gin.Context) *UserInfo

Directories

Path Synopsis
mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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