models

package
v0.0.0-...-51fd5d7 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AMQPCorrelated

type AMQPCorrelated[T any] struct {
	CorrelationId string
	RoutingKey    string
	Info          T
}

type AMQPPlumber

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

func NewAMQPPlumber

func NewAMQPPlumber() *AMQPPlumber

func (*AMQPPlumber) Listen

func (p *AMQPPlumber) Listen(key string, timeout time.Duration) (amqp091.Delivery, error)

Listen creates and listen to a response.

func (*AMQPPlumber) Send

func (p *AMQPPlumber) Send(delivery amqp091.Delivery)

Send sends data to listener if exists.

type APIKeyInfo

type APIKeyInfo struct {
	// Id is the API Key indentifier.
	Id int16 `json:"id" validate:"-"`
	// UserId is the user identifier.
	UserId int32 `json:"-" validate:"-"`
	// Descr is the API Key description.
	Descr string `json:"descr" validate:"max=255"`
	// TTL is the time-to-live of the API Key in hours.
	TTL int32 `json:"ttl" validate:"min=0"`
	// CreatedAt is the date of creation in UNIX format.
	CreatedAt int64 `json:"created-at" validate:"-"`
}

type APIkey

type APIkey struct {
	// Id is the APIKey unique identifier.
	Id int32 `json:"id"`
	// APIKey is the api key.
	APIKey string `json:"api-key"`
}

type AckNotificationInfo

type AckNotificationInfo struct {
	OccurencyDate int64                 `json:"occurency-date"`
	User          UserWithoutPW         `json:"user"`
	Metric        MetricNotification    `json:"metric"`
	Container     ContainerNotification `json:"container"`
	Category      CategoryNotification  `json:"category"`
	Profile       ProfileNotification   `json:"profile"`
}

type Action

type Action[T any] struct {
	// Base is the base action information.
	Base BaseAction `json:"base" validate:"required"`
	// Protocol is the protocol information.
	Protocol T `json:"protocol" validate:"required"`
}

type ActionValue

type ActionValue struct {
	// Value is the action value.
	Value string `json:"value" validate:"-"`
}

type AlarmAck

type AlarmAck struct {
	// MetricId is the metric id.
	MetricId int64
	// UserId is the user id that made the ack.
	UserId int32
	// Time is the UNIX epoch time for when happened.
	Time int64
	// AlarmCateogoryId is the alarm cateogory id of the last alarm.
	AlarmCategoryId int32
	// AlarmCategoryLevel is the alarm category level of the last alarm.
	AlarmCategoryLevel int32
}

type AlarmCategory

type AlarmCategory struct {
	// Id is the alarm category unique identifier.
	Id int32 `json:"id" validate:"-"`
	// Name is the alarm category name.
	Name string `json:"name" validate:"required,max=50"`
	// Descr is the alarm category description.
	Descr string `json:"descr" validate:"max=255"`
	// Lever is the alarm level.
	Level int32 `json:"level" validate:"required"`
	// IncreaseAlarmStreakAfter is the time neccessary
	// to increase a alarm streak of an alarm state after
	// an alarm occurency. 0 means never.
	IncreaseAlarmStreakAfter int64 `json:"increase-alarm-streak-after" validate:"min=0"`
	// AutoClear if enabled clear alarm acknowledged
	// automatically if not alarmed anymore.
	AutoClear bool `json:"auto-clear" validate:"-"`
	// AutoAck if enabled ack the alarm
	// automatically.
	AutoAck bool `json:"auto-ack" validate:"-"`
}

type AlarmCategorySimplified

type AlarmCategorySimplified struct {
	// Id is the alarm category unique identifier.
	Id int32
	// Lever is the alarm level.
	Level int32
	// IncreaseAlarmStreakAfter is the time neccessary
	// to increase a alarm streak of an alarm state after
	// an alarm occurency. 0 means never.
	IncreaseAlarmStreakAfter int64
	// AutoAck if enabled ack the alarm
	// automatically.
	AutoAck bool
	// AutoClear if enabled clear alarm acknowledged
	// automatically if not alarmed anymore
	AutoClear bool
}

type AlarmCleared

type AlarmCleared struct {
	// MetricId is the metric id.
	MetricId int64
	// Value is the value not in alarm.
	Value any
	// ContainerId is the container id.
	ContainerId int32
	// ContainerType is the container type.
	ContainerType container.ContainerType
}

type AlarmEndpoint

type AlarmEndpoint struct {
	Id int32 `json:"id" validate:"-"`
	// Name is the endpoint name.
	Name string `json:"name" validate:"required,max=50"`
	// URL is the endpoint URL.
	URL string `json:"url" validate:"required,max=255"`
	// Headers is the request headers.
	Headers []string `json:"headers" validate:"max=20"`
}

type AlarmExpression

type AlarmExpression struct {
	// Id is the alarm expression unique identifier.
	Id int32 `json:"id" validate:"-"`
	// Name is the alarm expression name.
	Name string `json:"name" validate:"required,max=50"`
	// Expression is the alarm expression.
	Expression string `json:"expression" validate:"required,max=255"`
	// AlarmCategoryId is the alarm category id.
	AlarmCategoryId int32 `json:"alarm-category-id" validate:"required"`
}

type AlarmExpressionSimplified

type AlarmExpressionSimplified struct {
	// Id is the alarm expression unique identifier.
	Id int32 `json:"id" validate:"-"`
	// Expression is the alarm expression.
	Expression string `json:"expression" validate:"required,max=255"`
	// AlarmCategoryId is the alarm category id.
	AlarmCategoryId int32 `json:"alarm-category-id" validate:"required"`
}

type AlarmNotificationInfo

type AlarmNotificationInfo struct {
	Value         any                   `json:"value"`
	OccurencyDate int64                 `json:"occurency-date"`
	AlarmType     alarm.AlarmType       `json:"alarm-type"`
	Metric        MetricNotification    `json:"metric"`
	Container     ContainerNotification `json:"container"`
	Category      CategoryNotification  `json:"category"`
	Profile       ProfileNotification   `json:"profile"`
}

type AlarmOccurency

type AlarmOccurency struct {
	// Type is the alarm type.
	Type alarm.AlarmType
	// MetricId is the metric identifier.
	MetricId int64
	// Time is when the alarm occurency timestamp.
	Time time.Time
	// ContainerId is the container identifier.
	ContainerId int32
	// ContainerType is the container type.
	ContainerType container.ContainerType
	// Category is the alarm category simplified.
	Category AlarmCategorySimplified
	// Value is the alarmed value.
	Value any
}

type AlarmProfile

type AlarmProfile struct {
	// Id is the alarm profile unique identifier.
	Id int32 `json:"id" validate:"-"`
	// Name is the alarm profile name.
	Name string `json:"name" validate:"required,max=50"`
	// Descr is the alarm profile description.
	Descr                           string `json:"descr" validate:"max=255"`
	AlarmedEmailMessageTemplate     string `json:"alarmed-email-message-template" validate:"max=3000"`
	ClearedEmailMessageTemplate     string `json:"cleared-email-message-template" validate:"max=3000"`
	AlarmedWppMessageTemplate       string `json:"alarmed-wpp-message-template" validate:"max=1000"`
	ClearedWppMessageTemplate       string `json:"cleared-wpp-message-template" validate:"max=1000"`
	AcknowledgeWppMessageTemplate   string `json:"acknowledged-wpp-message-template" validate:"max=1000"`
	AcknowledgeEmailMessageTemplate string `json:"acknowledged-email-message-template" validate:"max=2000"`
	NotifyAcknowledged              bool   `json:"notify-acknowledged"`
}

type AlarmProfileEmail

type AlarmProfileEmail struct {
	// Id is the email id.
	Id int32 `json:"id" validate:"-"`
	// Name is the name of the phone.
	Name string `json:"name" validate:"required,max=50"`
	// Descr is the description of the phone.
	Descr string `json:"descr" validate:"max=255"`
	// Email is the email.
	Email string `json:"email" validate:"required"`
}

type AlarmProfileEmailWithoutProfileId

type AlarmProfileEmailWithoutProfileId struct {
	// Id is the alarm profile email id.
	Id int32 `json:"id" validate:"-"`
	// Email is the email.
	Email string `json:"email" validate:"required,max=255"`
}

type AlarmProfileOnAck

type AlarmProfileOnAck struct {
	// Id is the alarm profile unique identifier.
	Id int32
	// Name is the alarm profile name.
	Name string
	// Descr is the alarm profile description.
	Descr                           string
	AcknowledgeWppMessageTemplate   string
	AcknowledgeEmailMessageTemplate string
	NotifyAcknowledged              bool
}

type AlarmProfileOnAlarm

type AlarmProfileOnAlarm struct {
	// Id is the alarm profile unique identifier.
	Id int32
	// Name is the alarm profile name.
	Name string
	// Descr is the alarm profile description.
	Descr                       string
	AlarmedEmailMessageTemplate string
	AlarmedWppMessageTemplate   string
}

type AlarmProfileOnCleared

type AlarmProfileOnCleared struct {
	// Id is the alarm profile unique identifier.
	Id int32
	// Name is the alarm profile name.
	Name string
	// Descr is the alarm profile description.
	Descr                       string
	ClearedWppMessageTemplate   string
	ClearedEmailMessageTemplate string
}

type AlarmProfileSimplified

type AlarmProfileSimplified struct {
	// Id is the alarm profile unique identifier.
	Id int32 `json:"id"`
	// Name is the alarm profile name.
	Name string `json:"name"`
	// Descr is the alarm profile description.
	Descr string `json:"descr"`
	// NotifyAcknowledged if true, should notify when the acknowledge
	// have transitioned from alarmed to acknowledged or from acknowledged to cleared.
	NotifyAcknowledged bool `json:"notify-acknowledged"`
}

type AlarmProfileWppPhone

type AlarmProfileWppPhone struct {
	// Id is the wpp phone id.
	Id int32 `json:"id" validate:"-"`
	// Name is the name of the phone.
	Name string `json:"name" validate:"required,max=50"`
	// Descr is the description of the phone.
	Descr string `json:"descr" validate:"max=255"`
	// Email is the email.
	Phone int64 `json:"phone" validate:"required"`
}

type AlarmState

type AlarmState struct {
	// MetricId is the metric identifier.
	MetricId int64 `json:"metric-id"`
	// Alarmed is if the metric is alarmed or not.
	Alarmed bool `json:"alarmed"`
	// AlarmCategoryId is the category id that of the alarm.
	AlarmCategoryId int32 `json:"alarm-category-id"`
	// AlarmCategoryLevel is the category level of the alarm.
	AlarmCategoryLevel int32 `json:"alarm-category-level"`
	// Recognition is the state reconition of the alarm.
	Recognition alarm.Recognition `json:"recognition"`
	// RecognitionTransitionedBy is who made the recognition transition.
	RecognitionTransitionedBy int32 `json:"recognition-transitioned-by"`
	// LastUpdate is the last alarmed update in seconds.
	LastUpdate int64 `json:"last-update"`
	// LastTransition is the last alarmed transition in seconds.
	LastTransition int64 `json:"last-transition"`
	// AlarmStreak is the streak updates to 'alarmed'.
	AlarmStreak int32 `json:"alarm-streak"`
}

type AlarmStreak

type AlarmStreak struct {
	// Id is the metric alarm streak id.
	Id int32 `json:"id" validate:"-"`
	// Name is the alarm streak name.
	Name string `json:"name" validate:"required,max=50"`
	// Descr is the alarm streak description.
	Descr string `json:"descr" validate:"max=255"`
	// MetricId is the metric id.
	MetricId int64 `json:"metric-id" validate:"-"`
	// Streak is the number of alarms in sequence.
	Streak int32 `json:"streak" validate:"required"`
	// CategoryId is the alarm category id.
	CategoryId int32 `json:"alarm-category-id" validate:"required"`
}

type BaseAction

type BaseAction struct {
	// Id is the action id.
	Id int32 `json:"id" validate:"-"`
	// Name is the action name.
	Name string `json:"name" validate:"required,max=50"`
	// Descr is the action description.
	Descr string `json:"descr" validate:"max=255"`
	// Type is the action protocol type.
	Type action.Action `json:"type" validate:"-"`
	// Value is the value to be sent.
	Value string `json:"value" validate:"max=255"`
}

type BaseContainer

type BaseContainer struct {
	// Id is the unique identifier.
	Id int32 `json:"id" validate:"-"`
	// Name is the container name.
	Name string `json:"name" validate:"required,max=50"`
	// Descr is the container description.
	Descr string `json:"descr" validate:"max=255"`
	// Type is the container type.
	Type container.ContainerType `json:"type" validate:"-"`
	// Enabled is the enable state.
	Enabled bool `json:"enabled" validate:"-"`
	// CreatedAt is the time in UNIX format of creation of the container.
	CreatedAt int64 `json:"created-at" validate:"-"`
	// Latitudes is the container latitudes.
	Latitudes []string `json:"latitudes" validate:"required"`
	// Longitudes is the container longitudes.
	Longitudes []string `json:"longitudes" validate:"required"`
}

type BaseMetric

type BaseMetric struct {
	// Id is the metric unique identifier.
	Id int64 `json:"id" validate:"-"`
	// ContainerId is the metric container identifier.
	ContainerId int32 `json:"container-id" validate:"-"`
	// ContainerType is the metric container type.
	ContainerType container.ContainerType `json:"container-type" validate:"-"`
	// Type is the metric type.
	Type metric.MetricType `json:"type" validate:"required"`
	// Name is the metric name.
	Name string `json:"name" validate:"required,max=50"`
	// Descr is the metric description.
	Descr string `json:"descr" validate:"max=255"`
	// Enabled is the metric enable state.
	Enabled bool `json:"enabled" validade:"-"`
	// DataPolicyId is the metric data policy identifier.
	DataPolicyId int16 `json:"data-policy-id" validate:"required"`
	// RTSPullingTimes is how many times will pull the data.
	RTSPullingTimes int16 `json:"rts-pulling-times" validate:"min=0,max=1000000"`
	// RTSCacheDuration is the data duration in miliseconds on RTS cache. Max is one hour.
	RTSCacheDuration int32 `json:"rts-cache-duration" validate:"min=1000,max=3600000"`
	// DHSEnabled is the enabled state of for the data history service.
	DHSEnabled bool `json:"dhs-enabled" validate:"-"`
	// DHSInterval is the interval in seconds of the data pulling of the data history service.
	DHSInterval int32 `json:"dhs-interval" validate:"-"`
	// AlarmEnabled if false will skip any alarm process.
	AlarmEnabled bool `json:"alarm-enabled" validate:"-"`
	// AutoAlarmStreak if true will keep the RTS metric pulling alive to get the alarm streak.
	AutoAlarmStreak bool `json:"auto-alarm-streak" validate:"-"`
	// EvaluableExpression is the a evaluable expression for the metric value.
	EvaluableExpression string `json:"evaluable-expression" validate:"max=255"`
}

type BaseMetricSimplified

type BaseMetricSimplified struct {
	// Id is the metric unique identifier.
	Id int64 `json:"id" validate:"-"`
	// ContainerId is the metric container identifier.
	ContainerId int32 `json:"container-id" validate:"required"`
	// ContainerType is the metric container type.
	ContainerType container.ContainerType `json:"container-type" validate:"-"`
	// Name is the metric name.
	Name string `json:"name" validate:"required,max=50"`
	// Descr is the metric description.
	Descr string `json:"descr" validate:"max=255"`
	// Enabled is the metric enable state.
	Enabled bool `json:"enabled" validade:"-"`
}

type BasicMetricAddDataForm

type BasicMetricAddDataForm struct {
	// MetricId is the metric id.
	MetricId int64
	// MetricType is the metric type.
	MetricType metric.MetricType
	// ContainerId is the container id.
	ContainerId int32
	// ContainerType is the container type.
	ContainerType container.ContainerType
	// DataPolicyId is the data policy id.
	DataPolicyId int16
	// Enabled is the metric enabled status.
	Enabled bool
	// DHSEnabled is the DHS enabled status.
	DHSEnabled bool
	// EvExpression is the evaluable expression.
	EvExpression string
	// AlarmEnabled if false will skip alarm checks.
	AlarmEnabled bool
}

type CategoryNotification

type CategoryNotification struct {
	Id    int32  `json:"id"`
	Name  string `json:"name"`
	Level int32  `json:"level"`
}

type ClearedNotificationInfo

type ClearedNotificationInfo struct {
	Value         any                   `json:"value"`
	OccurencyDate int64                 `json:"occurency-date"`
	Metric        MetricNotification    `json:"metric"`
	Container     ContainerNotification `json:"container"`
	Category      CategoryNotification  `json:"category"`
	Profile       ProfileNotification   `json:"profile"`
	AlarmType     alarm.AlarmType       `json:"alarm-type"`
}

type Container

type Container[T any] struct {
	// Base is the base container settings.
	Base BaseContainer `json:"base" validate:"required"`
	// Protocol is the container protocol settings.
	Protocol T `json:"protocol" validate:"required"`
}

type ContainerAlarmMap

type ContainerAlarmMap struct {
	// Id is the unique identifier.
	Id int32 `json:"id"`
	// Latitudes is the container latitudes.
	Latitudes []string `json:"latitudes"`
	// Longitudes is the container longitudes.
	Longitudes []string `json:"longitudes"`
	// Recogntion is the container recognition state.
	Recognition alarm.Recognition `json:"recognition"`
}

type ContainerNotification

type ContainerNotification struct {
	Id   int32                   `json:"id"`
	Name string                  `json:"string"`
	Type container.ContainerType `json:"container-type"`
}

type CustomQuery

type CustomQuery struct {
	// Id is the custom query unique id.
	Id int32 `json:"id" validate:"-"`
	// Name is the custom query name.
	Name string `json:"name" validate:"required,max=50"`
	// Descr is the custom query description.
	Descr string `json:"descr" validate:"max=255"`
	// Flux is the flux code to use during the query.
	Flux string `json:"flux" validate:"required"`
	// Packages is the packages required to execute the flux.
	Packages []string `json:"packages" validate:"required,max=20"`
}

type CustomQuerySimplified

type CustomQuerySimplified struct {
	// Flux is the flux code to use during the query.
	Flux string
	// Packages is the packages required to execute the flux.
	Packages []string
}

type Dashboard

type Dashboard struct {
	// Id is the dashboard unqiue identifier.
	Id int32 `json:"id" validate:"-"`
	// Name is the dashboard name.
	Name string `json:"name" validate:"required,max=50"`
	// Descr is the dashboard description.
	Descr string `json:"descr" validate:"max=255"`
	// Template is if the dashboard is a template.
	Template bool `json:"template" validate:"-"`
	// Content is the dashboard content.
	Content string `json:"content" validate:"required,max=256000"`
	// PreContent is the dashboard pre-content.
	PreContent string `json:"pre-content" validate:"required,max=2000"`
}

type DashboardGroup

type DashboardGroup struct {
	// Id is the unique dashboard group id.
	Id int32 `json:"id" validate:"-"`
	// Name is the dashboard group name.
	Name string `json:"name" validate:"required,max=50"`
	// Descr is the dashboard group description.
	Descr string `json:"descr" validate:"max=255"`
	// PreContent is the dashboard group pre-content.
	PreContent string `json:"pre-content" validate:"required,max=500"`
	// UserId is the user that have the ownership of the dashboard.
	UserId int32 `json:"user-id" validate:"-"`
}

type DashboardSimplifed

type DashboardSimplifed struct {
	// Id is the dashboard unqiue identifier.
	Id int32 `json:"id" validate:"-"`
	// Name is the dashboard name.
	Name string `json:"name" validate:"required,max=50"`
	// Descr is the dashboard description.
	Descr string `json:"descr" validate:"max=255"`
	// Template is if the dashboard is a template.
	Template bool `json:"template" validate:"-"`
	// PreContent is the dashboard pre-content.
	PreContent string `json:"pre-content" validate:"required,max=500"`
}

type DashboardTag

type DashboardTag struct {
	// Id is the unique tag identifier.
	Id int32 `json:"id" validate:"-"`
	// Name is the unique tag name.
	Name string `json:"name" validate:"requred,max=50"`
}

type DataPolicy

type DataPolicy struct {
	// Id is the identifier.
	Id int16 `json:"id" validate:"-"`
	// Name is the data policy name.
	Name string `json:"name" validate:"required,max=50"`
	// Descr is the data policy description.
	Descr string `json:"descr" validate:"max=255"`
	// UseAggr is the aggregation enabled status.
	UseAggr bool `json:"use-aggregation" validate:"-"`
	// Retention is the raw data retention in hours.
	Retention int32 `json:"retention" validate:"min=1"`
	// AggrRetention is the aggregation retention in hours.
	AggrRetention int32 `json:"aggregation-retention" validate:"required,min=1"`
	// AggrInterval is the aggregation interval in seconds.
	AggrInterval int32 `json:"aggregation-interval" validate:"required,min=1"`
	// AggrFn is the aggregation funcion.
	AggrFn string `json:"aggregation-function" validate:"required"`
}

type DetailedPublishing

type DetailedPublishing struct {
	Exchange   string
	RoutingKey string
	Mandatory  bool
	Immediate  bool
	Publishing amqp091.Publishing
}

type DirectAlarm

type DirectAlarm struct {
	// MetricId is the metric identifier.
	MetricId int64
	// ContainerId is the container identifier.
	ContainerId int32
	// ContainerType is the container type.
	ContainerType container.ContainerType
	// AlarmCategoryId is the alarm category id.
	AlarmCategoryId int32
	// Value is the alarmed value.
	Value any
}

type FlexLegacyContainer

type FlexLegacyContainer struct {
	// Id is the unique indentifier.
	Id int32 `json:"-" validate:"-"`
	// Target is an ipv4 address.
	Target string `json:"target" validate:"required,max=15"`
	// Port is a port.
	Port int32 `json:"port" validate:"required,max=65535"`
	// ReadCommunity is the read community.
	ReadCommunity string `json:"read-community" validate:"required,max=50"`
	// WriteCommunity is the write community.
	WriteCommunity string `json:"write-community" validate:"required,max=50"`
	// TrapCommunity is the trap community.
	TrapCommunity string `json:"trap-community" validate:"required,max=50"`
	// SerialNumber is the flex serial-number.
	SerialNumber string `json:"serial-number" validate:"required,max=10"`
	// Model is the flex model.
	Model int16 `json:"model" validate:"required"`
	// City is whitch city the flex is located.
	City string `json:"city" validate:"max=50"`
	// Region is whitch region the flex is located.
	Region string `json:"region" validate:"max=50"`
	// Country is whitch country the flex is located.
	Country string `json:"country" validate:"max=50"`
	// PullingInterval is the interval in miliseconds between each metric data pull. Max is one hour.
	PullingInterval int32 `json:"pulling-interval" validate:"required,min=100,max=3600000"`
}

type FlexLegacyContainerSNMPConfig

type FlexLegacyContainerSNMPConfig struct {
	// CacheDuration is the cache duration in miliseconds of this configuration on the SNMP service.
	CacheDuration int32
	// Target is an ipv4 address.
	Target string
	// Port is a port.
	Port int32
	// Community is an SNMP Community string.
	Community string
}

type FlexLegacyDatalogDownloadRegistry

type FlexLegacyDatalogDownloadRegistry struct {
	// ContainerId is the container identifier.
	ContainerId int32
	// Metering is the log type Metering.
	Metering int64
	// Status is the log type Status.
	Status int64
	// Command is the log type Command.
	Command int64
	// Virtual is the log type Virtual.
	Virtual int64
}

type FlexLegacyDatalogMetricRequest

type FlexLegacyDatalogMetricRequest struct {
	// Id is the metric identifier.
	Id int64
	// Type is the metric type.
	Type metric.MetricType
	// DataPolicyId is the data policy id.
	DataPolicyId int16
	// Port is the flex legacy port.
	Port int16
	// PortType is the flex legacy port type.
	PortType flexlegacy.PortType
}

type FlexLegacyMetric

type FlexLegacyMetric struct {
	// Id is the metric identifier.
	Id int64 `json:"-" validate:"-"`
	// Port is the port flex port.
	Port int16 `json:"port" validate:"required"`
	// PortType is the port type
	PortType int16 `json:"port-type" validate:"required"`
	// Details is the protocol details in JSON format.
	// May vary according to the port type.
	Details string `json:"details" validate:"-"`
}

type FlexLegacyMetricCommandDetails

type FlexLegacyMetricCommandDetails struct {
	DescrON  string `json:"descr-on" validate:"-"`
	DescrOFF string `json:"descr-off" validate:"-"`
}

type FlexLegacyMetricMeteringDetails

type FlexLegacyMetricMeteringDetails struct {
	Min  int    `json:"min" validate:"-"`
	Max  int    `json:"max" validate:"-"`
	Unit string `json:"unit" validate:"-"`
}

type FlexLegacyMetricPortTypeBinder

type FlexLegacyMetricPortTypeBinder struct {
	Protocol struct {
		PortType int16 `json:"port-type" validate:"required"`
	} `json:"protocol" validate:"required"`
}

type FlexLegacyMetricSimplified

type FlexLegacyMetricSimplified struct {
	// Port is the port flex port.
	Port int16
	// PortType is the port type
	PortType int16
}

type FlexLegacyMetricStatusDetails

type FlexLegacyMetricStatusDetails struct {
	DescrON  string `json:"descr-on" validate:"-"`
	DescrOFF string `json:"descr-off" validate:"-"`
}

type FlexLegacyMetricVirtualInputDetails

type FlexLegacyMetricVirtualInputDetails struct {
	Min    int      `json:"min" validate:"-"`
	Max    int      `json:"max" validate:"-"`
	Unit   string   `json:"unit" validate:"-"`
	Descrs []string `json:"descrs" validate:"-"`
}

type FlexLegacyMetricWithoutDetails

type FlexLegacyMetricWithoutDetails struct {
	// Id is the metric identifier.
	Id int64 `json:"-"`
	// Port is the port flex port.
	Port int16 `json:"port"`
	// PortType is the port type
	PortType int16 `json:"port-type"`
}

type FlexLegacyScanRequest

type FlexLegacyScanRequest struct {
	Target string `json:"target" validate:"required"`
	Port   int32  `json:"port" validate:"required"`
}

type FlexLegacyScriptDetails

type FlexLegacyScriptDetails struct {
}

type FlexLegacyTrap

type FlexLegacyTrap struct {
	// Alarmed is the alarmed state.
	Alarmed bool
	// Timestamp is the trap timestamp.
	Timestamp time.Time
	// Value is the alarmed value.
	Value any
	// PortType is the flex port type
	PortType int16
	// Port is the flex port
	Port int16
	// Description is the alarm description.
	Description string
	// ClientIp is the client ip.
	ClientIp string
	// AlarmCategoryId is the alarm category id.
	AlarmCategoryId int32
}

type HttpAction

type HttpAction struct {
	// ActionId is the action id.
	ActionId int32 `json:"-" validate:"-"`
	// URL is the url to make the request.
	URL string `json:"url" validate:"required,url,max=255"`
	// Headers is the request headers.
	Headers []string `json:"headers" validade:"max=20"`
}

type Id32

type Id32 struct {
	Id int32 `json:"id" validate:"required"`
}

type Id64

type Id64 struct {
	Id int64 `json:"id" validate:"required"`
}

type ListenerOptions

type ListenerOptions struct {
	QueueDeclarationOptions QueueDeclarationOptions
	QueueBindOptions        QueueBindOptions
	QueueConsumeOptions     QueueConsumeOptions
}

type Login

type Login struct {
	// Username is the username.
	Username string `json:"username" validate:"required,min=2,max=50"`
	// Password is the password.
	Password string `json:"password" validate:"required,min=5,max=50"`
}

type Metric

type Metric[T any] struct {
	// Base is the base metric configuration.
	Base BaseMetric `json:"base" validate:"required"`
	// Protocol is the protocol configuration.
	Protocol T `json:"protocol" validate:"required"`
}

type MetricBasicDataReponse

type MetricBasicDataReponse struct {
	// Id is the metric identifier.
	Id int64
	// Type is the data type.
	Type metric.MetricType
	// Value is the metric data as MetricType.
	Value any
	// DataPolicyId is the data policy id.
	DataPolicyId int16
	// Failed is the failed status.
	Failed bool
}

type MetricBasicRequestInfo

type MetricBasicRequestInfo struct {
	// Id is the metric identifier.
	Id int64
	// Type is the metric type.
	Type metric.MetricType
	// Protocol is the metric protocol.
	Protocol any
	// DataPolicyId is the data policy id.
	DataPolicyId int16
	// AlarmEnabled if false skip any alarm process.
	AlarmEnabled bool
}

type MetricDataByRefkey

type MetricDataByRefkey struct {
	// Refkye is the metric reference key.
	Refkey string `json:"refkey" validate:"required,max=200"`
	// Value is the value.
	Value any `json:"value" validate:"-"`
	// Timestamp is the timestamp in UNIX Epoch format
	Timestamp int64 `json:"timestamp" validate:"min=0"`
}

type MetricDataResponse

type MetricDataResponse struct {
	MetricBasicDataReponse
	// ContainerId is the metric's container identifier.
	ContainerId int32
	// ContainerType is the metric's container type.
	ContainerType container.ContainerType
}

type MetricEvaluableExpression

type MetricEvaluableExpression struct {
	// Id is the metric identifier.
	Id int64
	// Expression is the metric expression.
	Expression string
}

type MetricNotification

type MetricNotification struct {
	Id   int64  `json:"id"`
	Name string `json:"name"`
}

type MetricPairId

type MetricPairId struct {
	// Id is the metric unique identifier.
	Id int64
	// ContainerId is the container unique identtifier.
	ContainerId int32
}

type MetricRefkey

type MetricRefkey struct {
	// Id is the metric refkey unique identifier.
	Id int64 `json:"id" validate:"-"`
	// Refkey is the reference key.
	Refkey string `json:"refkey" validate:"required,max=200"`
	// MetricId is the metric id.
	MetricId int64 `json:"metric-id" validate:"-"`
}

type MetricRequest

type MetricRequest struct {
	// ContainerId is the metric's container identifier.
	ContainerId int32
	// ContainerType is the metric's container type.
	ContainerType container.ContainerType
	// MetricId is the metric identifier.
	MetricId int64
	// MetricType is the metric type.
	MetricType metric.MetricType
	// MetricProtocol is the metric protocol configuration.
	MetricProtocol any
	// DataPolicyId is the data policy id.
	DataPolicyId int16
	// AlarmEnabled if false will skip any alarm process.
	AlarmEnabled bool
}

type MetricsDataResponse

type MetricsDataResponse struct {
	// ContainerId is the metric's container identifier.
	ContainerId int32
	// ContainerType is the metric's container type.
	ContainerType container.ContainerType
	// Metrics is the metrics responses.
	Metrics []MetricBasicDataReponse
}

type MetricsRequest

type MetricsRequest struct {
	// ContainerId is the metric's container identifier.
	ContainerId int32
	// ContainerType is the metric's container type.
	ContainerType container.ContainerType
	// Metrics is the metrics.
	Metrics []MetricBasicRequestInfo
}

type PersistPulling

type PersistPulling struct {
	// Persistent is if the pulling will persist
	// or not.
	Persistent bool
	// MetricId is the metric id.
	MetricId int64
	// ContainerId is the container id.
	ContainerId int32
}

type PingContainer

type PingContainer struct {
	// Id is the pinger unique identifier.
	ContainerId int32 `json:"-" validate:"-"`
	// Target is the target address.
	Target string `json:"target" validate:"max=255"`
	// Interval is the interval in seconds between each ping.
	Interval int32 `json:"interval" validate:"min=1"`
	// StatsHistoryFlushInterval is the interval in seconds
	// between each statistics data history flush.
	StatsHistoryFlushInterval int32 `json:"stats-history-flush-interval" validate:"min=1"`
	// StatsRealtimeFlushInterval is the interval in seconds
	// between each statistics data history flush.
	StatsRealtimeFlushInterval int32 `json:"stats-realtime-flush-interval" validate:"min=1"`
}

type PingMetric

type PingMetric struct {
	// MetricId is the metric id.
	MetricId int64 `json:"-" validate:"-"`
	// AlarmCheckMode is alarm check mode.
	AlarmCheckMode pingtypes.AlarmCheckMode `json:"alarm-check-mode" validate:"required"`
	// StatsType is the statistic type.
	StatsType pingtypes.Stats `json:"stats" validate:"min=0"`
}

type ProfileNotification

type ProfileNotification struct {
	Id   int32  `json:"id"`
	Name string `json:"string"`
}

type Publish

type Publish struct {
	Exchange   string
	RoutingKey string
	Mandatory  bool
	Immediate  bool
	Publishing amqp091.Publishing
}

type QueryPoint

type QueryPoint struct {
	// Timestamp is point timestamp in UNIX format
	Timestamp int64 `json:"timestamp"`
	// Value is the point value.
	Value any `json:"value"`
}

type QueueBindOptions

type QueueBindOptions struct {
	RoutingKey string
	Exchange   string
	NoWait     bool
	Arguments  amqp091.Table
}

type QueueConsumeOptions

type QueueConsumeOptions struct {
	Consumer  string
	Exclusive bool
	NoLocal   bool
	NoWait    bool
	Arguments amqp091.Table
}

type QueueDeclarationOptions

type QueueDeclarationOptions struct {
	Name              string
	Durable           bool
	DeletedWhenUnused bool
	Exclusive         bool
	NoWait            bool
	Arguments         amqp091.Table
}

type RTSContainerConfig

type RTSContainerConfig struct {
	// PullingInterval is the interval between each data request in miliseconds.
	PullingInterval int32
}

type RTSMetricConfig

type RTSMetricConfig struct {
	// PullingTimes is how many times will pull the data.
	PullingTimes int16
	// Cache duration is the cached data durantion in miliseconds.
	CacheDuration int32
}

type ReverseProxyHTTP

type ReverseProxyHTTP struct {
	// Id is the reverse proxy unique id.
	Id int32 `json:"id" validate:"-"`
	// Name is the reverse proxy name.
	Name string `json:"name" validate:"required,max=50"`
	// Descr is the reverse proxy description.
	Descr string `json:"descr" validate:"max=255"`
	// Host is the host.
	Host string `json:"host" validate:"max=1000"`
	// Port is the port.
	Port int32 `json:"port" validate:"required"`
	// TLS is if the connection is over SSL/TLS.
	TLS bool `json:"tls" validate:"-"`
}

type ReverseProxyHTTPPath

type ReverseProxyHTTPPath struct {
	// Id is the reverse proxy unique path.
	Id int32 `json:"id" validate:"-"`
	// ProxyId is the reverse proxy id.
	ProxyId int32 `json:"proxy-id" validate:"-"`
	// Name is the name.
	Name string `json:"name" validate:"required,max=50"`
	// Descr is the description.
	Descr string `json:"descr" validate:"max=255"`
	// Path is the proxy path.
	Path string `json:"path" validate:"max=255"`
	// URL is the target url.
	URL string `json:"url" validate:"required,max=1000"`
	// RelativePath if true will use the relative path in the target URl.
	RelativePath bool `json:"relative-path" validate:"-"`
	// Headers is an array of headers (pairs) and values (odds).
	Headers []string `json:"headers" validate:"required"`
	// Auth if true will require the user to be authenticated.
	Auth bool `json:"auth" validate:"-"`
	// Role is the role role required to access the route.
	// Otherwise the user must be part of group that have access
	// to the reverse proxy.
	Role roles.Role `json:"role" validate:"-"`
}

type ReverseProxyRTSP

type ReverseProxyRTSP struct {
	// Id is the unique indetifier.
	Id int32 `json:"id" validate:"-"`
	// Name is the name.
	Name string `json:"name" validate:"required,max=50"`
	// Descr is the description.
	Descr string `json:"descr" validate:"max=255"`
	// Path is the relative path.
	Path string `json:"path" validate:"required"`
	// URL is the target URL.
	URL string `json:"url" validate:"required,max=1000"`
	// Auth is if require user to be authenticated.
	Auth bool `json:"auth" validate:"-"`
	// Role is the role required to access the proxy.
	// Otherwise the user must be part of group that have access
	// to the reverse proxy.
	Role roles.Role `json:"role" validate:"min=1"`
}

type SNMPMetric

type SNMPMetric struct {
	// Id is the metric identifier.
	Id int64 `json:"-" validate:"-"`
	// OID is the snmp object identifier.
	OID string `json:"oid" validate:"required,max=128"`
}

type SNMPMetricSimplified

type SNMPMetricSimplified struct {
	// OID is the snmp object identifier.
	OID string
}

type SNMPRawData

type SNMPRawData struct {
	Id     int64
	Value  any
	Failed bool
}

type SNMPv2cAction

type SNMPv2cAction struct {
	// ActionId is the action id.
	ActionId int32 `json:"-" validate:"-"`
	// ContainerId is the container id. The allowed container types
	// are: SNMPv2c and FlexLegacy.
	ContainerId int32 `json:"container-id" validade:"required"`
	// ContainerType is the container type.
	ContainerType container.ContainerType `json:"container-type" validate:"-"`
	// OID is the OID.
	OID string `json:"oid" validade:"required,max=128"`
	// Type is the snmp package type.
	Type action.SNMPActionTypes `json:"type" validate:"-"`
}

type SNMPv2cAgent

type SNMPv2cAgent struct {
	// Target is an ipv4 address.
	Target string
	// Port is a port.
	Port uint16
	// Community is an SNMP Community string.
	Community string
	// MaxOids is the maximum number of oids allowed in a Get().
	MaxOids int
}

type SNMPv2cContainer

type SNMPv2cContainer struct {
	// Id is the container id.
	Id int32 `json:"-" validate:"-"`
	// Target is an ipv4 address.
	Target string `json:"target" validate:"required,max=15"`
	// Port is a port.
	Port int32 `json:"port" validate:"required,max=65535"`
	// ReadCommunity is the read community.
	ReadCommunity string `json:"read-community" validate:"required,max=50"`
	// WriteCommunity is the write community.
	WriteCommunity string `json:"write-community" validate:"required,max=50"`
	// Max oids per request.
	MaxOids int16 `json:"max-oids" validate:"required,max=200"`
	// PullingInterval is the interval in miliseconds between each metric data pull. Max is one hour.
	PullingInterval int32 `json:"pulling-interval" validate:"required,min=100,max=3600000"`
}

type SNMPv2cRawDataReq

type SNMPv2cRawDataReq struct {
	Agent   SNMPv2cAgent
	Metrics []SNMPMetric
}

type ServerBasePlan

type ServerBasePlan struct {
	Cost                  float64 `json:"cost"`
	Users                 int     `json:"users"`
	Teams                 int     `json:"teams"`
	Contexts              int     `json:"contexts"`
	ContextualMetrics     int     `json:"contextual-metrics"`
	BasicContainers       int     `json:"basic-containers"`
	SNMPv2cContainers     int     `json:"snmpv2c-containers"`
	FlexLegacyContainers  int     `json:"flex-legacy-containers"`
	BasicMetrics          int     `json:"basic-metrics"`
	SNMPv2cMetrics        int     `json:"snmpv2c-metrics"`
	FlexLegacyMetrics     int     `json:"flex-legacy-metrics"`
	CustomQueries         int     `json:"custom-queries"`
	DataPolicies          int     `json:"data-policies"`
	AlarmExpressions      int     `json:"alarm-expressions"`
	AlarmProfiles         int     `json:"alarm-profiles"`
	AlarmProfilesEmails   int     `json:"alarm-profiles-emails"`
	AlarmCategories       int     `json:"alarm-categories"`
	TrapCategoryRelations int     `json:"trap-category-relations"`
	Refkeys               int     `json:"ref-keys"`
	APIKeys               int     `json:"api-keys"`
	InfluxDataPoints      int     `json:"influx-data-points"`
	Requests              int     `json:"requests"`
	RealtimeDataRequests  int     `json:"realtime-data-requests"`
	DataHistoryRequests   int     `json:"data-history-requests"`
}

type ServerCostResult

type ServerCostResult struct {
	// GeneratedAt is the time in seconds when the result was generated.
	GeneratedAt    int64            `json:"generated-at"`
	PriceTable     ServerPriceTable `json:"price-table"`
	Elements       ServerElements   `json:"elements"`
	BasePlanCost   float64          `json:"base-plan-cost"`
	AdditionalCost float64          `json:"additional-cost"`
	TotalCost      float64          `json:"total-cost"`
}

type ServerElements

type ServerElements struct {
	Users                 int `json:"users"`
	Teams                 int `json:"teams"`
	Contexts              int `json:"contexts"`
	ContextualMetrics     int `json:"contextual-metrics"`
	BasicContainers       int `json:"basic-containers"`
	SNMPv2cContainers     int `json:"snmpv2c-containers"`
	FlexLegacyContainers  int `json:"flex-legacy-containers"`
	BasicMetrics          int `json:"basic-metrics"`
	SNMPv2cMetrics        int `json:"snmpv2c-metrics"`
	FlexLegacyMetrics     int `json:"flex-legacy-metrics"`
	CustomQueries         int `json:"custom-queries"`
	DataPolicies          int `json:"data-policies"`
	AlarmExpressions      int `json:"alarm-expressions"`
	AlarmProfiles         int `json:"alarm-profiles"`
	AlarmProfilesEmails   int `json:"alarm-profiles-emails"`
	AlarmCategories       int `json:"alarm-categories"`
	TrapCategoryRelations int `json:"trap-category-relations"`
	Refkeys               int `json:"ref-keys"`
	APIKeys               int `json:"api-keys"`
	InfluxDataPoints      int `json:"influx-data-points"`
	Requests              int `json:"requests"`
	RealtimeDataRequests  int `json:"realtime-data-requests"`
	DataHistoryRequests   int `json:"data-history-requests"`
}

type ServerPriceTable

type ServerPriceTable struct {
	CoinType             string  `json:"coin-type" validate:"required,max=5"`
	User                 float64 `json:"user" validate:"min=0"`
	Team                 float64 `json:"team" validate:"min=0"`
	Context              float64 `json:"context" validate:"min=0"`
	ContextualMetric     float64 `json:"contextual-metric" validate:"min=0"`
	BasicContainer       float64 `json:"basic-container" validate:"min=0"`
	SNMPv2cContainer     float64 `json:"snmpv2c-container" validate:"min=0"`
	FlexLegacyContainer  float64 `json:"flex-legacy-container" validate:"min=0"`
	BasicMetric          float64 `json:"basic-metric" validate:"min=0"`
	SNMPv2cMetric        float64 `json:"snmpv2c-metric" validate:"min=0"`
	FlexLegacyMetric     float64 `json:"flex-legacy-metric" validate:"min=0"`
	CustomQuery          float64 `json:"custom-query" validate:"min=0"`
	DataPolicy           float64 `json:"data-policy" validate:"min=0"`
	AlarmExpression      float64 `json:"alarm-expression" validate:"min=0"`
	AlarmProfile         float64 `json:"alarm-profile" validate:"min=0"`
	AlarmProfileEmail    float64 `json:"alarm-profile-email" validate:"min=0"`
	AlarmCategory        float64 `json:"alarm-category" validate:"min=0"`
	TrapCategoryRelation float64 `json:"trap-category-relation" validate:"min=0"`
	Refkey               float64 `json:"ref-key" validate:"min=0"`
	APIKey               float64 `json:"api-key" validate:"min=0"`
	InfluxDataPoint      float64 `json:"influx-data-point" validate:"min=0"`
	Request              float64 `json:"request" validate:"min=0"`
	RealtimeDataRequest  float64 `json:"realtime-data-request" validate:"min=0"`
	DataHistoryRequests  float64 `json:"data-history-requests" validate:"min=0"`
}

type ServicePong

type ServicePong struct {
	ServiceIdent string
}

type Team

type Team struct {
	// Id is the identifier.
	Id int32 `json:"id" validate:"-"`
	// Name is the team name.
	Name string `json:"name" validate:"required,min=2,max=50"`
	// Descr is the team description.
	Descr string `json:"descr" validate:"max=255"`
	// Root is if the team is root or not.
	Root bool `json:"root" validate:"-"`
}

type Token

type Token struct {
	Token string `json:"token" validate:"required"`
}

type TrapCategoryRelation

type TrapCategoryRelation struct {
	// TrapCategoryId is the trap id.
	TrapCategoryId int16 `json:"trap-category-id" validate:"-"`
	// AlarmCategoryId is the category id.
	AlarmCategoryId int32 `json:"alarm-category-id" validate:"-"`
}

type TrapListener

type TrapListener struct {
	// Id is the trap listener unique identifier.
	Id int32 `json:"id" validate:"-"`
	// Host is the listener host.
	Host string `json:"host" validate:"required"`
	// Port is the listener port.
	Port int32 `json:"port" validate:"required"`
	// AlarmCategoryId is the alarm category id.
	AlarmCategoryId int32 `json:"alarm-category-id" validate:"required"`
	// Community is the snmp trap community.
	Community string `json:"community" validate:"required"`
	// Transport is the snmp transport ("udp" or "tcp").
	Transport string `json:"transport" validate:"min=3,max=3"`
}

type User

type User struct {
	// Id is the user identifier.
	Id int32 `json:"id" validate:"-"`
	// Role is the user role.
	Role roles.Role `json:"role" validate:"required"`
	// FirstName is the user first name.
	FirstName string `json:"first-name" validate:"required,min=2,max=50"`
	// LastName is the user last name.
	LastName string `json:"last-name" validate:"required,min=2,max=50"`
	// Username is the user's username.
	Username string `json:"username" validate:"required,min=3,max=50"`
	// Password is the user's password.
	Password string `json:"password" validate:"required,min=5,max=50"`
	// Email is the user's email.
	Email string `json:"email" validate:"required,email,max=255"`
	// LastActivity is the user last acvity.
	LastActivity int64 `json:"last-activity" validate:"-"`
}

type UserIcon

type UserIcon struct {
	// Id is the user id.
	Id int32 `json:"id"`
	// UserIcon is the user icon.
	UserIcon []byte `json:"user-icon"`
}

type UserRTSPSessionMeta

type UserRTSPSessionMeta struct {
	// UserId is the user id.
	UserId int32 `json:"user-id"`
	// Role is the user role.
	Role roles.Role `json:"role"`
}

type UserWithoutPW

type UserWithoutPW struct {
	// Id is the user identifier.
	Id int32 `json:"id" validate:"-"`
	// Role is the user role.
	Role roles.Role `json:"role" validate:"required"`
	// FirstName is the user first name.
	FirstName string `json:"first-name" validate:"required,min=2,max=50"`
	// LastName is the user last name.
	LastName string `json:"last-name" validate:"required,min=2,max=50"`
	// Username is the user's username.
	Username string `json:"username" validate:"required,min=3,max=50"`
	// Email is the user's email.
	Email string `json:"email" validate:"required,email"`
	// LastActivity is the user last acvity.
	LastActivity int64 `json:"last-activity" validate:"-"`
}

Jump to

Keyboard shortcuts

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