Documentation ¶
Index ¶
- func DeleteKapaTask(id string, devcfgarray []*config.KapacitorCfg) (int, int, []string)
- func DeleteKapaTemplate(id string, devcfgarray []*config.KapacitorCfg) (int, int, []string)
- func DeployKapaTask(dev config.AlertIDCfg) ([]string, time.Time, error)
- func DeployKapaTemplate(dev config.TemplateCfg) ([]string, error)
- func GetIfxDBNameByID(id string) string
- func GetKapaClient(dev config.KapacitorCfg) (*kapacitorClient.Client, time.Duration, string, error)
- func GetKapaServers(kapacitorid string) ([]*config.KapacitorCfg, error)
- func GetKapaServersFromArray(kapacitoridarray []string) ([]*config.KapacitorCfg, error)
- func GetKapaTask(dev *config.AlertIDCfg) (int, int, []string)
- func GetKapaTasks(tplcfgarray []*config.AlertIDCfg) bool
- func GetKapaTemplate(dev *config.TemplateCfg, devcfgarray []*config.KapacitorCfg) (int, int, []string)
- func GetKapaTemplates(tplcfgarray []*config.TemplateCfg, devcfgarray []*config.KapacitorCfg) bool
- func GetResTemplateCfgByID(id string) (config.TemplateCfg, error)
- func GetTemplateIDParts(sTemplateID string) (string, string, string, string, string, string)
- func ListKapaTask(cli *kapacitorClient.Client, id string) (kapacitorClient.Task, error)
- func ListKapaTasks(cli *kapacitorClient.Client) ([]kapacitorClient.Task, error)
- func ListKapaTemplate(cli *kapacitorClient.Client, id string) (kapacitorClient.Template, error)
- func ListKapaTemplates(cli *kapacitorClient.Client) ([]kapacitorClient.Template, error)
- func SetKapaTask(dev config.AlertIDCfg, devcfgarray []*config.KapacitorCfg) (int, int, []string, time.Time, error)
- func SetKapaTemplate(dev config.TemplateCfg, devcfgarray []*config.KapacitorCfg) (int, int, []string, error)
- func SetLogger(l *logrus.Logger)
- func SetPort(p string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteKapaTask ¶
DeleteKapaTask Deletes task from the Kapacitor Servers Returns:
- the number of kapacitor servers
- the number of kapacitor servers where the task is deleted
- the list of kapacitor servers where the task is NOT deleted
func DeleteKapaTemplate ¶
DeleteKapaTemplate Deletes template from the Kapacitor Servers. Returns:
- the number of kapacitor servers
- the number of kapacitor servers where the template is deleted
- the list of kapacitor servers where the template is NOT deleted
func DeployKapaTask ¶
DeployKapaTask Deploys the task related to this alert into the kapacitor server
func DeployKapaTemplate ¶
func DeployKapaTemplate(dev config.TemplateCfg) ([]string, error)
DeployKapaTemplate Deploys template into the kapacitor servers
func GetIfxDBNameByID ¶
GetIfxDBNameByID Gets influx db name by id
func GetKapaClient ¶
func GetKapaClient(dev config.KapacitorCfg) (*kapacitorClient.Client, time.Duration, string, error)
GetKapaClient Gets Kapacitor Go Cient
func GetKapaServers ¶
func GetKapaServers(kapacitorid string) ([]*config.KapacitorCfg, error)
GetKapaServers Gets Kapacitor servers array
func GetKapaServersFromArray ¶
func GetKapaServersFromArray(kapacitoridarray []string) ([]*config.KapacitorCfg, error)
GetKapaServersFromArray Gets Kapacitor servers array
func GetKapaTask ¶
func GetKapaTask(dev *config.AlertIDCfg) (int, int, []string)
GetKapaTask Gets task from the Kapacitor Server related to this alert. Returns:
- the number of kapacitor servers
- the number of kapacitor servers where the task is deployed with the last version
- the list of kapacitor servers where the task is NOT deployed with the last version
func GetKapaTasks ¶
func GetKapaTasks(tplcfgarray []*config.AlertIDCfg) bool
GetKapaTasks Gets tasks from the Kapacitor Server related. Returns true if all actions have been done without error, false elsewhere.
func GetKapaTemplate ¶
func GetKapaTemplate(dev *config.TemplateCfg, devcfgarray []*config.KapacitorCfg) (int, int, []string)
GetKapaTemplate Gets template from the Kapacitor Servers. Returns:
- the number of kapacitor servers
- the number of kapacitor servers where the template is deployed with the last version
- the list of kapacitor servers where the template is NOT deployed with the last version
func GetKapaTemplates ¶
func GetKapaTemplates(tplcfgarray []*config.TemplateCfg, devcfgarray []*config.KapacitorCfg) bool
GetKapaTemplates Gets templates from the Kapacitor Servers. Returns true if all actions have been done without error, false elsewhere.
func GetResTemplateCfgByID ¶
func GetResTemplateCfgByID(id string) (config.TemplateCfg, error)
GetResTemplateCfgByID Gets the TemplateCfg information stored on resistor database including the kapacitor servers without last deployment
func GetTemplateIDParts ¶
GetTemplateIDParts Gets TemplateID parts from TemplateID NOT USED since version 0.6.5 example: from: "TREND_2EX_AC_ATP_GAUGE_FMOVAVG" --> result: "TREND", "AC", "absolute", "positive", "GAUGE", "MOVAVG" TriggerType + CritDirection + TrendTypeTranslated + FieldType + StatFunc
func ListKapaTask ¶
func ListKapaTask(cli *kapacitorClient.Client, id string) (kapacitorClient.Task, error)
ListKapaTask lists a kapacitor task
func ListKapaTasks ¶
func ListKapaTasks(cli *kapacitorClient.Client) ([]kapacitorClient.Task, error)
ListKapaTasks lists all kapacitor tasks
func ListKapaTemplate ¶
func ListKapaTemplate(cli *kapacitorClient.Client, id string) (kapacitorClient.Template, error)
ListKapaTemplate lists a kapacitor template
func ListKapaTemplates ¶
func ListKapaTemplates(cli *kapacitorClient.Client) ([]kapacitorClient.Template, error)
ListKapaTemplates lists all kapacitor templates
func SetKapaTask ¶
func SetKapaTask(dev config.AlertIDCfg, devcfgarray []*config.KapacitorCfg) (int, int, []string, time.Time, error)
SetKapaTask Creates or updates task into the Kapacitor Servers For this version, the array of Kapacitor Servers only contains 1 server First of all, a checking is done to ensure the template used for the task has the last deployment into all kapacitor servers Returns:
- the number of kapacitor servers where the task will be deployed
- the number of kapacitor servers where the task is deployed with the last version
- the list of kapacitor servers where the task is NOT deployed with the last version
- the last Deployment Time of the task
- the error in case of error
func SetKapaTemplate ¶
func SetKapaTemplate(dev config.TemplateCfg, devcfgarray []*config.KapacitorCfg) (int, int, []string, error)
SetKapaTemplate Creates or updates template into the Kapacitor Servers. Returns:
- the number of kapacitor servers where the template will be deployed with the last version
- the number of kapacitor servers where the template is deployed with the last version
- the list of kapacitor servers where the template is NOT deployed with the last version
- the error in case of error
Types ¶
This section is empty.