Documentation
¶
Index ¶
- Constants
- Variables
- func ApiCheckCreateSettingsByIdHandler(s services.ChecksService) gin.HandlerFunc
- func ApiCheckGetSettingsByIdHandler(s services.ClustersService) gin.HandlerFunc
- func ApiChecksCatalogHandler(s services.ChecksService) gin.HandlerFunc
- func ApiClusterCheckResultsHandler(s services.ChecksService) gin.HandlerFunc
- func ApiClusterCreateTagHandler(clustersService services.ClustersService, tagsService services.TagsService) gin.HandlerFunc
- func ApiClusterDeleteTagHandler(clustersService services.ClustersService, tagsService services.TagsService) gin.HandlerFunc
- func ApiCollectDataHandler(collectorService services.CollectorService) gin.HandlerFunc
- func ApiCreateChecksCatalogHandler(s services.ChecksService) gin.HandlerFunc
- func ApiCreateChecksResultHandler(s services.ChecksService) gin.HandlerFunc
- func ApiDatabaseCreateTagHandler(sapSystemsService services.SAPSystemsService, tagsService services.TagsService) gin.HandlerFunc
- func ApiDatabaseDeleteTagHandler(sapSystemsService services.SAPSystemsService, tagsService services.TagsService) gin.HandlerFunc
- func ApiGetClustersSettingsHandler(clusters services.ClustersService) gin.HandlerFunc
- func ApiGetPrometheusHttpSdTargets(s services.PrometheusService) gin.HandlerFunc
- func ApiHostCreateTagHandler(hostsService services.HostsService, tagsService services.TagsService) gin.HandlerFunc
- func ApiHostDeleteTagHandler(hostsService services.HostsService, tagsService services.TagsService) gin.HandlerFunc
- func ApiHostHeartbeatHandler(hostService services.HostsService) gin.HandlerFunc
- func ApiListTag(tagsService services.TagsService) gin.HandlerFunc
- func ApiPingHandler(c *gin.Context)
- func ApiSAPSystemCreateTagHandler(sapSystemsService services.SAPSystemsService, tagsService services.TagsService) gin.HandlerFunc
- func ApiSAPSystemDeleteTagHandler(sapSystemsService services.SAPSystemsService, tagsService services.TagsService) gin.HandlerFunc
- func ApiSAPSystemsHealthSummaryHandler(healthSummaryService services.HealthSummaryService) gin.HandlerFunc
- func ErrorHandler(c *gin.Context)
- func EulaAcceptHandler(settings services.SettingsService) gin.HandlerFunc
- func EulaMiddleware(premiumDetection services.PremiumDetectionService) gin.HandlerFunc
- func EulaShowHandler() gin.HandlerFunc
- func HomeHandler(c *gin.Context)
- func InitAlerts()
- func MigrateDB(db *gorm.DB) error
- func NewAboutHandler(s services.SubscriptionsService) gin.HandlerFunc
- func NewChecksCatalogHandler(s services.ChecksService) gin.HandlerFunc
- func NewClusterHandler(clusterService services.ClustersService) gin.HandlerFunc
- func NewClusterListHandler(clustersService services.ClustersService) gin.HandlerFunc
- func NewHANADatabaseListHandler(sapSystemsService services.SAPSystemsService) gin.HandlerFunc
- func NewHostHandler(hostsService services.HostsService, subsService services.SubscriptionsService, ...) gin.HandlerFunc
- func NewHostListHandler(hostsService services.HostsService) gin.HandlerFunc
- func NewLogHandler(instance string, logger *log.Logger) gin.HandlerFunc
- func NewNamedEngine(instance string) *gin.Engine
- func NewSAPResourceHandler(hostsService services.HostsService, ...) gin.HandlerFunc
- func NewSAPSystemListHandler(sapSystemsService services.SAPSystemsService) gin.HandlerFunc
- func StoreAlert(c *gin.Context, a Alert)
- type Alert
- type App
- type ClustersSettingsResponse
- type Config
- type Dependencies
- type HealthContainer
- type HomeData
- type HttpError
- type JSONCheck
- type JSONCheckResult
- type JSONChecksCatalog
- type JSONChecksGroup
- type JSONChecksGroupedCatalog
- type JSONChecksResult
- type JSONChecksSettings
- type JSONHosts
- type JSONTag
- type LayoutData
- type LayoutHTML
- type LayoutRender
- type Page
- type Pagination
- type Submenu
- type SubmenuItem
- type Targets
- type TargetsList
Constants ¶
const AlertsKey string = "alerts"
Variables ¶
var AlertCatalogNotFound = func() Alert { return Alert{ Type: "danger", Title: "Error loading the checks catalog", Text: "Checks catalog couldn't be retrieved", } }
Here some generic alerts
var AlertConnectionDataNotFound = func() Alert { return Alert{ Type: "danger", Title: "Error loading the connection data", Text: "Connection data couldn't be retrieved.", } }
var CheckResultsNotFound = func() Alert { return Alert{ Type: "danger", Title: "Error loading the checks result", Text: "Checks result couldn't be retrieved. Check if the Trento runner is running", } }
var DBTables = []interface{}{ &entities.Settings{}, &models.Tag{}, &models.SelectedChecks{}, &models.ConnectionSettings{}, &entities.Check{}, &datapipeline.DataCollectedEvent{}, &datapipeline.Subscription{}, &entities.HostTelemetry{}, &entities.Cluster{}, &entities.Host{}, &entities.HostHeartbeat{}, &entities.SlesSubscription{}, &entities.SAPSystemInstance{}, &entities.ChecksResult{}, &entities.HealthState{}, }
var NoCheckSelected = func() Alert { return Alert{ Type: "info", Title: "There is not any check selected", Text: "Select the desired checks in the settings modal in order to validate the cluster configuration", } }
Functions ¶
func ApiCheckCreateSettingsByIdHandler ¶
func ApiCheckCreateSettingsByIdHandler(s services.ChecksService) gin.HandlerFunc
ApiCheckCreateSettingsByIdHandler godoc @Summary Create the check settings @Accept json @Produce json @Param id path string true "Resource id" @Param Body body JSONChecksSettings true "Checks settings" @Success 201 {object} JSONChecksSettings @Failure 500 {object} map[string]string @Router /checks/{id}/settings [post]
func ApiCheckGetSettingsByIdHandler ¶
func ApiCheckGetSettingsByIdHandler(s services.ClustersService) gin.HandlerFunc
ApiCheckGetSettingsByIdHandler godoc @Summary Get the check settings @Accept json @Produce json @Param id path string true "Resource id" @Success 200 {object} JSONChecksSettings @Failure 404 {object} map[string]string @Router /checks/{id}/settings [get]
func ApiChecksCatalogHandler ¶
func ApiChecksCatalogHandler(s services.ChecksService) gin.HandlerFunc
ApiCheckCatalogHandler godoc @Summary Get the whole checks' catalog @Produce json @Success 200 {object} JSONChecksGroupedCatalog @Error 500 @Router /checks/catalog [get]
func ApiClusterCheckResultsHandler ¶
func ApiClusterCheckResultsHandler(s services.ChecksService) gin.HandlerFunc
ApiCheckResultsHandler godoc @Summary Get a specific cluster's check results @Produce json @Param cluster_id path string true "Cluster Id" @Success 200 {object} map[string]interface{} @Failure 500 {object} map[string]string @Router /clusters/{cluster_id}/results [get]
func ApiClusterCreateTagHandler ¶
func ApiClusterCreateTagHandler(clustersService services.ClustersService, tagsService services.TagsService) gin.HandlerFunc
ApiClusterCreateTagHandler godoc @Summary Add tag to Cluster @Accept json @Produce json @Param id path string true "Cluster id" @Param Body body JSONTag true "The tag to create" @Success 201 {object} JSONTag @Failure 404 {object} map[string]string @Failure 400 {object} map[string]string @Failure 500 {object} map[string]string @Router /clusters/{id}/tags [post]
func ApiClusterDeleteTagHandler ¶
func ApiClusterDeleteTagHandler(clustersService services.ClustersService, tagsService services.TagsService) gin.HandlerFunc
ApiClusterDeleteTagHandler godoc @Summary Delete a specific tag that belongs to a cluster @Accept json @Produce json @Param id path string true "Cluster id" @Param tag path string true "Tag" @Success 204 {object} map[string]interface{} @Router /clusters/{id}/tags/{tag} [delete]
func ApiCollectDataHandler ¶
func ApiCollectDataHandler(collectorService services.CollectorService) gin.HandlerFunc
ApiCollectDataHandler handles the request to collect agent data from the API
func ApiCreateChecksCatalogHandler ¶
func ApiCreateChecksCatalogHandler(s services.ChecksService) gin.HandlerFunc
ApiCreateChecksCatalogHandler godoc @Summary Create/Updates the checks catalog @Produce json @Param Body body JSONChecksCatalog true "Checks catalog" @Success 200 {object} JSONChecksCatalog @Failure 500 {object} map[string]string @Router /checks/catalog [put]
func ApiCreateChecksResultHandler ¶
func ApiCreateChecksResultHandler(s services.ChecksService) gin.HandlerFunc
ApiCreateChecksResultHandler godoc @Summary Create a checks result entry @Produce json @Param id path string true "Resource Id" @Param Body body JSONChecksResult true "Checks result" @Success 201 {object} JSONChecksResult @Failure 500 {object} map[string]string @Router /checks/{id}/results [post]
func ApiDatabaseCreateTagHandler ¶
func ApiDatabaseCreateTagHandler(sapSystemsService services.SAPSystemsService, tagsService services.TagsService) gin.HandlerFunc
ApiDatabaseCreateTagHandler godoc @Summary Add tag to a HANA database @Accept json @Produce json @Param id path string true "Database id" @Param Body body JSONTag true "The tag to create" @Success 201 {object} JSONTag @Failure 404 {object} map[string]string @Failure 400 {object} map[string]string @Failure 500 {object} map[string]string @Router /databases/{id}/tags [post]
func ApiDatabaseDeleteTagHandler ¶
func ApiDatabaseDeleteTagHandler(sapSystemsService services.SAPSystemsService, tagsService services.TagsService) gin.HandlerFunc
ApiDatabaseDeleteTagHandler godoc @Summary Delete a specific tag that belongs to a HANA database @Accept json @Produce json @Param id path string true "Database id" @Param tag path string true "Tag" @Success 204 {object} map[string]interface{} @Router /databases/{id}/tags/{tag} [delete]
func ApiGetClustersSettingsHandler ¶
func ApiGetClustersSettingsHandler(clusters services.ClustersService) gin.HandlerFunc
ApiGetClustersSettingsHandler godoc @Summary Retrieve Settings for all the clusters. Cluster's Selected checks and Hosts connection settings @Accept json @Produce json @Success 200 {object} ClustersSettingsResponse @Failure 500 {object} map[string]string @Router /clusters/settings [get]
func ApiGetPrometheusHttpSdTargets ¶
func ApiGetPrometheusHttpSdTargets(s services.PrometheusService) gin.HandlerFunc
ApiGetPrometheusHttpSdTargets godoc @Summary Get prometheus HTTP SD targets @Produce json @Success 200 {object} TargetsList @Error 500 @Router /prometheus/targets [get]
func ApiHostCreateTagHandler ¶
func ApiHostCreateTagHandler(hostsService services.HostsService, tagsService services.TagsService) gin.HandlerFunc
ApiHostCreateTagHandler godoc @Summary Add tag to host @Accept json @Produce json @Param id path string true "Host id" @Param Body body JSONTag true "The tag to create" @Success 201 {object} JSONTag @Failure 404 {object} map[string]string @Failure 400 {object} map[string]string @Failure 500 {object} map[string]string @Router /hosts/{id}/tags [post]
func ApiHostDeleteTagHandler ¶
func ApiHostDeleteTagHandler(hostsService services.HostsService, tagsService services.TagsService) gin.HandlerFunc
ApiHostDeleteTagHandler godoc @Summary Delete a specific tag that belongs to a host @Accept json @Produce json @Param id path string true "Host id" @Param tag path string true "Tag" @Success 204 {object} map[string]interface{} @Router /hosts/{id}/tags/{tag} [delete]
func ApiHostHeartbeatHandler ¶
func ApiHostHeartbeatHandler(hostService services.HostsService) gin.HandlerFunc
func ApiListTag ¶
func ApiListTag(tagsService services.TagsService) gin.HandlerFunc
ApiListTag godoc @Summary List all the tags in the system @Accept json @Produce json @Param resource_type query string false "Filter by resource type" @Success 200 {object} []string @Failure 500 {object} map[string]string @Router /tags [get]
func ApiPingHandler ¶
func ApiSAPSystemCreateTagHandler ¶
func ApiSAPSystemCreateTagHandler(sapSystemsService services.SAPSystemsService, tagsService services.TagsService) gin.HandlerFunc
ApiSAPSystemCreateTagHandler godoc @Summary Add tag to SAPSystem @Accept json @Produce json @Param id path string true "SAPSystem id" @Param Body body JSONTag true "The tag to create" @Success 201 {object} JSONTag @Failure 404 {object} map[string]string @Failure 400 {object} map[string]string @Failure 500 {object} map[string]string @Router /sapsystems/{id}/tags [post]
func ApiSAPSystemDeleteTagHandler ¶
func ApiSAPSystemDeleteTagHandler(sapSystemsService services.SAPSystemsService, tagsService services.TagsService) gin.HandlerFunc
ApiSAPSystemDeleteTagHandler godoc @Summary Delete a specific tag that belongs to a SAPSystem @Accept json @Produce json @Param id path string true "SAPSystem id" @Param tag path string true "Tag" @Success 204 {object} map[string]interface{} @Router /sapsystems/{id}/tags/{tag} [delete]
func ApiSAPSystemsHealthSummaryHandler ¶
func ApiSAPSystemsHealthSummaryHandler(healthSummaryService services.HealthSummaryService) gin.HandlerFunc
ApiSAPSystemsHealthSummaryHandler godoc @Summary Retrieve SAP Systems Health Summary @Accept json @Produce json @Success 200 {object} models.HealthSummary @Failure 500 {object} map[string]string @Router /sapsystems/health [get]
func ErrorHandler ¶
func EulaAcceptHandler ¶
func EulaAcceptHandler(settings services.SettingsService) gin.HandlerFunc
func EulaMiddleware ¶
func EulaMiddleware(premiumDetection services.PremiumDetectionService) gin.HandlerFunc
func EulaShowHandler ¶
func EulaShowHandler() gin.HandlerFunc
func HomeHandler ¶
func InitAlerts ¶
func InitAlerts()
func NewAboutHandler ¶
func NewAboutHandler(s services.SubscriptionsService) gin.HandlerFunc
func NewChecksCatalogHandler ¶
func NewChecksCatalogHandler(s services.ChecksService) gin.HandlerFunc
func NewClusterHandler ¶
func NewClusterHandler(clusterService services.ClustersService) gin.HandlerFunc
func NewClusterListHandler ¶
func NewClusterListHandler(clustersService services.ClustersService) gin.HandlerFunc
func NewHANADatabaseListHandler ¶
func NewHANADatabaseListHandler(sapSystemsService services.SAPSystemsService) gin.HandlerFunc
func NewHostHandler ¶
func NewHostHandler(hostsService services.HostsService, subsService services.SubscriptionsService, monitoringURL string) gin.HandlerFunc
func NewHostListHandler ¶
func NewHostListHandler(hostsService services.HostsService) gin.HandlerFunc
func NewLogHandler ¶
func NewLogHandler(instance string, logger *log.Logger) gin.HandlerFunc
func NewNamedEngine ¶
func NewSAPResourceHandler ¶
func NewSAPResourceHandler(hostsService services.HostsService, sapSystemsService services.SAPSystemsService) gin.HandlerFunc
func NewSAPSystemListHandler ¶
func NewSAPSystemListHandler(sapSystemsService services.SAPSystemsService) gin.HandlerFunc
func StoreAlert ¶
Types ¶
type App ¶
type App struct { InstallationID uuid.UUID Dependencies // contains filtered or unexported fields }
func NewAppWithDeps ¶
func NewAppWithDeps(config *Config, deps Dependencies) (*App, error)
type ClustersSettingsResponse ¶
type ClustersSettingsResponse models.ClustersSettings
type Dependencies ¶
type Dependencies struct {
// contains filtered or unexported fields
}
func DefaultDependencies ¶
func DefaultDependencies(ctx context.Context, config *Config) Dependencies
type HealthContainer ¶
func NewClustersHealthContainer ¶
func NewClustersHealthContainer(clusterList models.ClusterList) *HealthContainer
func NewHostsHealthContainer ¶
func NewHostsHealthContainer(hostList models.HostList) *HealthContainer
type HttpError ¶
type HttpError struct {
// contains filtered or unexported fields
}
func BadRequestError ¶
func InternalServerError ¶
func NotFoundError ¶
type JSONCheck ¶
type JSONCheck struct { ID string `json:"id,omitempty" binding:"required"` Name string `json:"name,omitempty" binding:"required"` Group string `json:"group,omitempty" binding:"required"` Description string `json:"description,omitempty"` Remediation string `json:"remediation,omitempty"` Implementation string `json:"implementation,omitempty"` Labels string `json:"labels,omitempty"` Premium bool `json:"premium,omitempty"` }
type JSONCheckResult ¶
type JSONChecksCatalog ¶
type JSONChecksCatalog []*JSONCheck
type JSONChecksGroup ¶
type JSONChecksGroupedCatalog ¶
type JSONChecksGroupedCatalog []*JSONChecksGroup
type JSONChecksResult ¶
type JSONChecksResult struct { Hosts map[string]*JSONHosts `json:"hosts,omitempty" binding:"required"` Checks map[string]*JSONCheckResult `json:"checks,omitempty" binding:"required"` }
type JSONChecksSettings ¶
type LayoutData ¶
type LayoutHTML ¶
type LayoutHTML struct { Templates map[string]*template.Template TemplateName string Data interface{} }
func (LayoutHTML) Render ¶
func (r LayoutHTML) Render(w http.ResponseWriter) error
func (LayoutHTML) RenderErrorPage ¶
func (r LayoutHTML) RenderErrorPage(e *HttpError, w http.ResponseWriter)
func (LayoutHTML) WriteContentType ¶
func (r LayoutHTML) WriteContentType(w http.ResponseWriter)
type LayoutRender ¶
type LayoutRender struct {
// contains filtered or unexported fields
}
LayoutRender wraps user templates into a root one which has it's own data and a bunch of inner blocks
func NewLayoutRender ¶
func NewLayoutRender(templatesFS fs.FS, templates ...string) *LayoutRender
The default constructor expects an FS, some data, and user templates; user templates are the ones that can be referenced by the Gin context.
type Pagination ¶
func NewPagination ¶
func NewPagination(items, page, perPage int) *Pagination
func (*Pagination) GetCurrentPages ¶
func (p *Pagination) GetCurrentPages() []*Page
func (*Pagination) GetPerPages ¶
func (p *Pagination) GetPerPages() []int
func (*Pagination) GetSliceNumbers ¶
func (p *Pagination) GetSliceNumbers() (int, int)
Function to get the 1st and last indexes using the current pagination
type Submenu ¶
type Submenu []SubmenuItem
type SubmenuItem ¶
type SubmenuItem struct {}
type TargetsList ¶
type TargetsList []*Targets