entitycounters

package
v0.0.0-...-9b5cd94 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2024 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ComponentCountersCalcData

type ComponentCountersCalcData struct {
	Info        StateSettingsInfo
	Counters    EntityCounters
	PrevState   int
	CurState    int
	PrevActive  bool
	CurActive   bool
	AlarmExists bool
}

type EntityCounters

type EntityCounters struct {
	ID                   string         `bson:"_id"`
	All                  int            `bson:"all"`
	Active               int            `bson:"active"`
	State                StateCounters  `bson:"state"`
	InheritedState       StateCounters  `bson:"inherited_state"`
	Acknowledged         int            `bson:"acked"`
	AcknowledgedUnderPbh int            `bson:"acked_under_pbh"`
	NotAcknowledged      int            `bson:"unacked"`
	PbehaviorCounters    map[string]int `bson:"pbehavior,omitempty"`
	UnderPbehavior       int            `bson:"under_pbh"`
	Depends              int            `bson:"depends"`
	OutputTemplate       string         `bson:"output_template,omitempty"`
	Output               string         `bson:"output,omitempty"`

	Rule *statesetting.StateSetting `bson:"rule"`
}

func (*EntityCounters) Copy

func (s *EntityCounters) Copy() EntityCounters

func (*EntityCounters) DecrementAlarmCounters

func (s *EntityCounters) DecrementAlarmCounters(acked, isActive bool)

func (*EntityCounters) DecrementPbhCounters

func (s *EntityCounters) DecrementPbhCounters(typeID string)

func (*EntityCounters) DecrementState

func (s *EntityCounters) DecrementState(state int, withInherited bool)

func (*EntityCounters) GetWorstState

func (s *EntityCounters) GetWorstState() int

func (*EntityCounters) IncrementAlarmCounters

func (s *EntityCounters) IncrementAlarmCounters(acked, isActive bool)

func (*EntityCounters) IncrementPbhCounters

func (s *EntityCounters) IncrementPbhCounters(typeID string)

func (*EntityCounters) IncrementState

func (s *EntityCounters) IncrementState(state int, withInherited bool)

func (*EntityCounters) Reset

func (s *EntityCounters) Reset()

func (*EntityCounters) Sub

func (s *EntityCounters) Sub(o EntityCounters) map[string]int

type EntityServiceCountersCalcData

type EntityServiceCountersCalcData struct {
	ServicesToAdd    map[string]bool
	ServicesToRemove map[string]bool
	Info             ServicesInfo
	Counters         EntityCounters
	PrevPbhTypeID    string
	CurPbhTypeID     string
	PrevState        int
	CurState         int
	PrevActive       bool
	CurActive        bool
	IsAcked          bool
	Inherited        bool
	AlarmExists      bool
	EntityEnabled    bool
}

type EventsSender

type EventsSender interface {
	UpdateComponentState(ctx context.Context, id, connectorID string, state int) error
	UpdateServiceState(ctx context.Context, serviceID string, serviceInfo UpdatedServicesInfo) error
	RecomputeService(ctx context.Context, serviceID string) error
	RecomputeComponent(ctx context.Context, componentID, connectorID string) error
}

func NewEventSender

func NewEventSender(
	encoder encoding.Encoder,
	pubChannel amqp.Publisher,
	pubExchangeName string,
	pubQueueName string,
) EventsSender

type ServicesInfo

type ServicesInfo struct {
	Services         []string `bson:"services"`
	ServicesToAdd    []string `bson:"services_to_add"`
	ServicesToRemove []string `bson:"services_to_remove"`
}

type StateCounters

type StateCounters struct {
	Critical int `bson:"critical"`
	Major    int `bson:"major"`
	Minor    int `bson:"minor"`
	Ok       int `bson:"ok"`
}

type StateSettingsInfo

type StateSettingsInfo struct {
	ComponentStateSettings         bool `bson:"component_state_settings"`
	ComponentStateSettingsToAdd    bool `bson:"component_state_settings_to_add"`
	ComponentStateSettingsToRemove bool `bson:"component_state_settings_to_remove"`
}

type UpdatedServicesInfo

type UpdatedServicesInfo struct {
	State  int
	Output string
}

Directories

Path Synopsis
strategy

Jump to

Keyboard shortcuts

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