Documentation ¶
Index ¶
- Variables
- type AddCollectorCommand
- type AddCollectorSessionCommand
- type AddEndpointCommand
- type AddMonitorCommand
- type AlertSchedulerValue
- type CheckEvalResult
- type ClearCollectorSessionCommand
- type Collector
- type CollectorDTO
- type CollectorSession
- type CollectorTag
- type DeleteCollectorCommand
- type DeleteCollectorSessionCommand
- type DeleteEndpointCommand
- type DeleteMonitorCommand
- type Endpoint
- type EndpointDTO
- type EndpointDiscoveryCommand
- type EndpointTag
- type GetAlertSchedulerValueQuery
- type GetAllCollectorTagsQuery
- type GetAllEndpointTagsQuery
- type GetCollectorByIdQuery
- type GetCollectorByNameQuery
- type GetCollectorSessionsQuery
- type GetCollectorsQuery
- type GetEndpointByIdQuery
- type GetEndpointsQuery
- type GetEventsQuery
- type GetGlobalQuotaByTargetQuery
- type GetMonitorByIdQuery
- type GetMonitorTypeByIdQuery
- type GetMonitorTypesQuery
- type GetMonitorsForAlertsQuery
- type GetMonitorsQuery
- type GetOrgQuotaByTargetQuery
- type GetOrgQuotasQuery
- type GlobalQuotaDTO
- type Monitor
- type MonitorCollector
- type MonitorCollectorTag
- type MonitorDTO
- type MonitorForAlertDTO
- type MonitorHealthSettingDTO
- type MonitorNotificationSetting
- type MonitorSettingDTO
- type MonitorType
- type MonitorTypeDTO
- type MonitorTypeSetting
- type MonitorTypeSettingDTO
- type OAuthType
- type OrgQuotaDTO
- type Quota
- type QuotaScope
- type RoleType
- type SendEmailCommand
- type SignedInUser
- type SuggestedMonitor
- type UpdateAlertSchedulerValueCommand
- type UpdateCollectorCommand
- type UpdateCollectorSessionCmd
- type UpdateEndpointCommand
- type UpdateMonitorCommand
- type UpdateMonitorStateCommand
- type UpdateOrgQuotaCmd
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrCollectorNotFound = errors.New("Collector not found") ErrCollectorWithSameCodeExists = errors.New("A Collector with the same code already exists") )
Typed errors
View Source
var ( ErrEndpointNotFound = errors.New("Endpoint not found") ErrWithMonitorsDelete = errors.New("Endpoint can't be deleted as it still has monitors") )
Typed errors
View Source
var ( ErrMonitorNotFound = errors.New("Monitor not found") ErrMonitorCollectorsInvalid = errors.New("Invalid Collector specified for Monitor") ErrMonitorSettingsInvalid = errors.New("Invald variables used in Monitor Settings") ErrorEndpointCantBeChanged = errors.New("A monitor's endpoint_id can not be changed.") )
Typed errors
View Source
var ( ErrInvalidRoleType = errors.New("Invalid role type") ErrLastOrgAdmin = errors.New("Cannot remove last organization admin") ErrOrgUserNotFound = errors.New("Cannot find the organization user") ErrOrgUserAlreadyAdded = errors.New("User is already added to organization") ErrInvalidApiKey = errors.New("Invalid API Key") )
Typed errors
View Source
var ErrInvalidEmailCode = errors.New("Invalid or expired email code")
View Source
var ErrInvalidQuotaTarget = errors.New("Invalid quota target")
Functions ¶
This section is empty.
Types ¶
type AddCollectorCommand ¶
type AddCollectorCommand struct { OrgId int64 `json:"-"` Name string `json:"name" binding:"Required"` Tags []string `json:"tags"` Public bool `json:"public"` Online bool `json:"online"` Enabled bool `json:"enabled"` Latitude float64 `json:"latitude"` Longitude float64 `json:"longitude"` Result *CollectorDTO }
type AddEndpointCommand ¶
type AddEndpointCommand struct { OrgId int64 `json:"-"` Name string `json:"name" binding:"Required"` Tags []string `json:"tags"` Monitors []*AddMonitorCommand `json:"monitors"` Result *EndpointDTO `json:"-"` }
type AddMonitorCommand ¶
type AddMonitorCommand struct { OrgId int64 `json:"-"` EndpointId int64 `json:"endpoint_id" binding:"Required"` MonitorTypeId int64 `json:"monitor_type_id" binding:"Required"` CollectorIds []int64 `json:"collector_ids"` CollectorTags []string `json:"collector_tags"` Settings []*MonitorSettingDTO `json:"settings"` HealthSettings *MonitorHealthSettingDTO `json:"health_settings"` Frequency int64 `json:"frequency" binding:"Required;Range(10,600)"` Enabled bool `json:"enabled"` Offset int64 `json:"-"` Result *MonitorDTO `json:"-"` }
type AlertSchedulerValue ¶
type CheckEvalResult ¶
type CheckEvalResult int
const ( EvalResultOK CheckEvalResult = iota EvalResultWarn EvalResultCrit EvalResultUnknown = -1 )
func (CheckEvalResult) String ¶
func (c CheckEvalResult) String() string
type ClearCollectorSessionCommand ¶
type ClearCollectorSessionCommand struct {
InstanceId string
}
type Collector ¶
type Collector struct { Id int64 OrgId int64 Slug string Name string Public bool Latitude float64 Longitude float64 Created time.Time Updated time.Time Online bool OnlineChange time.Time Enabled bool EnabledChange time.Time }
func (*Collector) UpdateCollectorSlug ¶
func (collector *Collector) UpdateCollectorSlug()
type CollectorDTO ¶
type CollectorDTO struct { Id int64 `json:"id"` OrgId int64 `json:"org_id"` Slug string `json:"slug"` Name string `json:"name"` Tags []string `json:"tags"` Public bool `json:"public"` Latitude float64 `json:"latitude"` Longitude float64 `json:"longitude"` Online bool `json:"online"` OnlineChange time.Time `json:"online_change"` Enabled bool `json:"enabled"` EnabledChange time.Time `json:"enabled_change"` }
---------------------- DTO
type CollectorSession ¶
type DeleteCollectorCommand ¶
type DeleteEndpointCommand ¶
type DeleteMonitorCommand ¶
type Endpoint ¶
type Endpoint struct { Id int64 OrgId int64 Name string Slug string Created time.Time Updated time.Time }
func (*Endpoint) UpdateEndpointSlug ¶
func (endpoint *Endpoint) UpdateEndpointSlug()
type EndpointDTO ¶
type EndpointDTO struct { Id int64 `json:"id"` OrgId int64 `json:"org_id"` Name string `json:"name"` Slug string `json:"slug"` Tags []string `json:"tags"` }
--------------- DTOs
type EndpointDiscoveryCommand ¶
type EndpointDiscoveryCommand struct { Name string `form:"name"` Result []*SuggestedMonitor }
---------------------- COMMANDS
type GetAllEndpointTagsQuery ¶
type GetCollectorByIdQuery ¶
type GetCollectorByIdQuery struct { Id int64 OrgId int64 Result *CollectorDTO }
type GetCollectorByNameQuery ¶
type GetCollectorByNameQuery struct { Name string OrgId int64 Result *CollectorDTO }
type GetCollectorSessionsQuery ¶
type GetCollectorSessionsQuery struct { CollectorId int64 InstanceId string Result []*CollectorSession }
type GetCollectorsQuery ¶
type GetEndpointByIdQuery ¶
type GetEndpointByIdQuery struct { Id int64 OrgId int64 Result *EndpointDTO }
type GetEndpointsQuery ¶
type GetEndpointsQuery struct { OrgId int64 Tag []string `form:"tag"` Result []*EndpointDTO }
type GetEventsQuery ¶
type GetGlobalQuotaByTargetQuery ¶
type GetGlobalQuotaByTargetQuery struct { Target string Default int64 Result *GlobalQuotaDTO }
type GetMonitorByIdQuery ¶
type GetMonitorByIdQuery struct { Id int64 OrgId int64 IsGrafanaAdmin bool Result *MonitorDTO }
type GetMonitorTypeByIdQuery ¶
type GetMonitorTypeByIdQuery struct { Id int64 Result *MonitorTypeDTO }
type GetMonitorTypesQuery ¶
type GetMonitorTypesQuery struct {
Result []*MonitorTypeDTO
}
type GetMonitorsForAlertsQuery ¶
type GetMonitorsForAlertsQuery struct { Timestamp int64 Result []*MonitorForAlertDTO }
type GetMonitorsQuery ¶
type GetMonitorsQuery struct { MonitorId []int64 `form:"id"` EndpointId []int64 `form:"endpoint_id"` MonitorTypeId []int64 `form:"monitor_type_id"` CollectorId []int64 `form:"collector_id"` Frequency []int64 `form:"frequency"` Enabled string `form:"enabled"` Modulo int64 `form:"modulo"` ModuloOffset int64 `form:"modulo_offset"` State CheckEvalResult `form:"state"` OrgId int64 IsGrafanaAdmin bool Result []*MonitorDTO }
type GetOrgQuotaByTargetQuery ¶
type GetOrgQuotaByTargetQuery struct { Target string OrgId int64 Default int64 Result *OrgQuotaDTO }
type GetOrgQuotasQuery ¶
type GetOrgQuotasQuery struct { OrgId int64 Result []*OrgQuotaDTO }
type GlobalQuotaDTO ¶
type MonitorCollector ¶
type MonitorCollectorTag ¶
type MonitorDTO ¶
type MonitorDTO struct { Id int64 `json:"id"` OrgId int64 `json:"org_id"` EndpointId int64 `json:"endpoint_id" ` EndpointSlug string `json:"endpoint_slug"` MonitorTypeId int64 `json:"monitor_type_id"` MonitorTypeName string `json:"monitor_type_name"` CollectorIds []int64 `json:"collector_ids"` CollectorTags []string `json:"collector_tags"` Collectors []int64 `json:"collectors"` State CheckEvalResult `json:"state"` StateChange time.Time `json:"state_change"` StateCheck time.Time `json:"state_check"` Settings []*MonitorSettingDTO `json:"settings"` HealthSettings *MonitorHealthSettingDTO `json:"health_settings"` Frequency int64 `json:"frequency"` Enabled bool `json:"enabled"` Offset int64 `json:"offset"` Updated time.Time `json:"updated"` }
type MonitorForAlertDTO ¶
type MonitorForAlertDTO struct { Id int64 OrgId int64 EndpointId int64 EndpointSlug string EndpointName string MonitorTypeId int64 MonitorTypeName string Offset int64 Frequency int64 Enabled bool StateChange time.Time StateCheck time.Time Settings []*MonitorSettingDTO HealthSettings *MonitorHealthSettingDTO Created time.Time Updated time.Time }
func (*MonitorForAlertDTO) SettingsMap ¶
func (m *MonitorForAlertDTO) SettingsMap() map[string]string
type MonitorHealthSettingDTO ¶
type MonitorHealthSettingDTO struct { NumCollectors int `json:"num_collectors" binding:"Required"` Steps int `json:"steps" binding:"Required"` Notifications MonitorNotificationSetting `json:"notifications"` }
func (*MonitorHealthSettingDTO) FromDB ¶
func (e *MonitorHealthSettingDTO) FromDB(data []byte) error
implement the go-xorm/core.Conversion interface
func (*MonitorHealthSettingDTO) ToDB ¶
func (e *MonitorHealthSettingDTO) ToDB() ([]byte, error)
type MonitorSettingDTO ¶
type MonitorType ¶
type MonitorTypeDTO ¶
type MonitorTypeDTO struct { Id int64 `json:"id"` Name string `json:"name"` Settings []*MonitorTypeSettingDTO `json:"settings"` }
type MonitorTypeSetting ¶
type MonitorTypeSettingDTO ¶
type OrgQuotaDTO ¶
type QuotaScope ¶
func GetQuotaScopes ¶
func GetQuotaScopes(target string) ([]QuotaScope, error)
type SendEmailCommand ¶
type SignedInUser ¶
type SuggestedMonitor ¶
type SuggestedMonitor struct { MonitorTypeId int64 `json:"monitor_type_id"` Settings []MonitorSettingDTO `json:"settings"` }
type UpdateCollectorCommand ¶
type UpdateCollectorCommand struct { Id int64 `json:"id" binding:"Required"` OrgId int64 `json:"-"` Name string `json:"name" binding:"Required"` Tags []string `json:"tags"` Public bool `json:"public"` Enabled bool `json:"enabled"` Latitude float64 `json:"latitude"` Longitude float64 `json:"longitude"` }
type UpdateEndpointCommand ¶
type UpdateEndpointCommand struct { Id int64 `json:"id" binding:"Required"` OrgId int64 `json:"-"` Name string `json:"name" binding:"Required"` Tags []string `json:"tags"` Result *EndpointDTO }
type UpdateMonitorCommand ¶
type UpdateMonitorCommand struct { Id int64 `json:"id" binding:"Required"` EndpointId int64 `json:"endpoint_id" binding:"Required"` OrgId int64 `json:"-"` MonitorTypeId int64 `json:"monitor_type_id" binding:"Required"` CollectorIds []int64 `json:"collector_ids"` CollectorTags []string `json:"collector_tags"` Settings []*MonitorSettingDTO `json:"settings"` HealthSettings *MonitorHealthSettingDTO `json:"health_settings"` Frequency int64 `json:"frequency" binding:"Required;Range(10,600)"` Enabled bool `json:"enabled"` Offset int64 `json:"-"` }
type UpdateOrgQuotaCmd ¶
Click to show internal directories.
Click to hide internal directories.