kapa

package
v0.0.0-...-b03fc3e Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2019 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteKapaTask

func DeleteKapaTask(id string, devcfgarray []*config.KapacitorCfg) (int, int, []string)

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

func DeleteKapaTemplate(id string, devcfgarray []*config.KapacitorCfg) (int, int, []string)

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

func DeployKapaTask(dev config.AlertIDCfg) ([]string, time.Time, error)

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

func GetIfxDBNameByID(id string) string

GetIfxDBNameByID Gets influx db name by id

func GetKapaClient

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

func GetTemplateIDParts(sTemplateID string) (string, string, string, string, string, string)

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

func SetLogger

func SetLogger(l *logrus.Logger)

SetLogger set output log

func SetPort

func SetPort(p string)

SetPort sets resistor port

Types

This section is empty.

Jump to

Keyboard shortcuts

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