centreonhandler

package
v0.0.0-...-114c4a8 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CentreonHandler

type CentreonHandler interface {
	CreateService(service *CentreonService) (err error)
	UpdateService(service *CentreonServiceDiff) (err error)
	DeleteService(host, service string) (err error)
	GetService(host, name string) (service *CentreonService, err error)
	DiffService(actual, expected *CentreonService, ignoreFields []string) (diff *CentreonServiceDiff, err error)
	CreateServiceGroup(sg *CentreonServiceGroup) (err error)
	UpdateServiceGroup(sg *CentreonServiceGroupDiff) (err error)
	DeleteServiceGroup(name string) (err error)
	GetServiceGroup(name string) (sg *CentreonServiceGroup, err error)
	DiffServiceGroup(actual, expected *CentreonServiceGroup, ignoreFields []string) (diff *CentreonServiceGroupDiff, err error)

	SetLogger(log *logrus.Entry)
}

func NewCentreonHandler

func NewCentreonHandler(client *centreon.Client, log *logrus.Entry) CentreonHandler

type CentreonHandlerImpl

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

func (*CentreonHandlerImpl) CreateService

func (h *CentreonHandlerImpl) CreateService(service *CentreonService) (err error)

CreateService permit to create new service on Centreon from spec

func (*CentreonHandlerImpl) CreateServiceGroup

func (h *CentreonHandlerImpl) CreateServiceGroup(sg *CentreonServiceGroup) (err error)

CreateServiceGroup permit to create new serviceGroup on Centreon from spec

func (*CentreonHandlerImpl) DeleteService

func (h *CentreonHandlerImpl) DeleteService(host, name string) (err error)

DeleteService permit to delete an existing service on Centreon

func (*CentreonHandlerImpl) DeleteServiceGroup

func (h *CentreonHandlerImpl) DeleteServiceGroup(name string) (err error)

DeleteServiceGroup permit to delete an existing serviceGroup on Centreon

func (*CentreonHandlerImpl) DiffService

func (h *CentreonHandlerImpl) DiffService(actual, expected *CentreonService, ignoreFields []string) (diff *CentreonServiceDiff, err error)

DiffService permit to compare actual and expected service to compute what is modified

func (*CentreonHandlerImpl) DiffServiceGroup

func (h *CentreonHandlerImpl) DiffServiceGroup(actual, expected *CentreonServiceGroup, ignoreFields []string) (diff *CentreonServiceGroupDiff, err error)

DiffServiceGroup permit to diff actual and expected serviceGroup to know what it need to modify

func (*CentreonHandlerImpl) GetService

func (h *CentreonHandlerImpl) GetService(host, name string) (service *CentreonService, err error)

GetService permit to get service by it name

func (*CentreonHandlerImpl) GetServiceGroup

func (h *CentreonHandlerImpl) GetServiceGroup(name string) (sg *CentreonServiceGroup, err error)

GetServiceGroup permit to get serviceGroup by it name

func (*CentreonHandlerImpl) SetLogger

func (h *CentreonHandlerImpl) SetLogger(log *logrus.Entry)

func (*CentreonHandlerImpl) UpdateService

func (h *CentreonHandlerImpl) UpdateService(serviceDiff *CentreonServiceDiff) (err error)

UpdateService permit to update existing service on Centreon from spec

func (*CentreonHandlerImpl) UpdateServiceGroup

func (h *CentreonHandlerImpl) UpdateServiceGroup(serviceGroupDiff *CentreonServiceGroupDiff) (err error)

UpdateServiceGroup permit to update existing serviceGroup on Centreon from spec

type CentreonService

type CentreonService struct {
	Host                string
	Name                string
	CheckCommand        string
	CheckCommandArgs    string
	NormalCheckInterval string
	RetryCheckInterval  string
	MaxCheckAttempts    string
	ActiveCheckEnabled  string
	PassiveCheckEnabled string
	Activated           string
	Template            string
	Comment             string
	Groups              []string
	Categories          []string
	Macros              []*models.Macro
}

func (*CentreonService) String

func (cs *CentreonService) String() string

type CentreonServiceDiff

type CentreonServiceDiff struct {
	Host               string
	Name               string
	IsDiff             bool
	GroupsToSet        []string
	GroupsToDelete     []string
	CategoriesToSet    []string
	CategoriesToDelete []string
	MacrosToSet        []*models.Macro
	MacrosToDelete     []*models.Macro
	ParamsToSet        map[string]string
	HostToSet          string
}

func (*CentreonServiceDiff) String

func (csd *CentreonServiceDiff) String() string

type CentreonServiceGroup

type CentreonServiceGroup struct {
	Name        string
	Activated   string
	Comment     string
	Description string
}

func (*CentreonServiceGroup) String

func (cs *CentreonServiceGroup) String() string

type CentreonServiceGroupDiff

type CentreonServiceGroupDiff struct {
	Name        string
	IsDiff      bool
	ParamsToSet map[string]string
}

func (*CentreonServiceGroupDiff) String

func (csd *CentreonServiceGroupDiff) String() string

Jump to

Keyboard shortcuts

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