Documentation
¶
Index ¶
- Constants
- type AlertContactPoints
- type AlertPolicies
- type AlertRules
- type AlertTemplates
- type AlertTimings
- type AlertingApi
- type AuthenticationApi
- type CipherEncoder
- type ConnectionPermissions
- type ConnectionsApi
- type DashboardPermissionsApi
- type DashboardsApi
- type ExtendedApi
- type Filter
- type FoldersApi
- type GrafanaService
- type LibraryElementsApi
- type LicenseApi
- type OrgPreferencesApi
- type OrganizationsApi
- type ServerInfoApi
- type ServiceAccountApi
- type Storage
- type TeamsApi
- type Templating
- type UsersApi
Constants ¶
View Source
const ( EncodeOperation = "Encode" DecodeOperation = "Decode" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AlertContactPoints ¶
type AlertPolicies ¶
type AlertRules ¶
type AlertRules interface {
DownloadAlertRules(filter Filter) ([]string, error)
ListAlertRules(filter Filter) ([]*customModels.AlertRuleWithNestedFolder, error)
ClearAlertRules(filter Filter) ([]string, error)
UploadAlertRules(filter Filter) ([]*customModels.AlertRuleWithNestedFolder, error)
}
type AlertTemplates ¶
type AlertTimings ¶
type AlertingApi ¶
type AlertingApi interface {
AlertContactPoints
AlertRules
AlertTemplates
AlertPolicies
AlertTimings
}
type AuthenticationApi ¶
type AuthenticationApi interface {
// TokenApi
ServiceAccountApi
Login()
EncodeValue(in string) string
DecodeValue(in string) string
}
AuthenticationApi Contract definition
type CipherEncoder ¶
type ConnectionPermissions ¶
type ConnectionPermissions interface {
// Permissions Enterprise only
ListConnectionPermissions(filter Filter) []customModels.ConnectionPermissionItem
DownloadConnectionPermissions(filter Filter) []string
UploadConnectionPermissions(filter Filter) []string
DeleteAllConnectionPermissions(filter Filter) []string
}
type ConnectionsApi ¶
type ConnectionsApi interface {
ListConnections(filter Filter) []models.DataSourceListItemDTO
DownloadConnections(filter Filter) []string
UploadConnections(filter Filter) []string
DeleteAllConnections(filter Filter) []string
ConnectionPermissions
}
ConnectionsApi Contract definition
type DashboardPermissionsApi ¶
type DashboardPermissionsApi interface {
ListDashboardPermissions(filterReq Filter) ([]customModels.DashboardAndPermissions, error)
DownloadDashboardPermissions(filterReq Filter) ([]string, error)
ClearDashboardPermissions(filterReq Filter) error
UploadDashboardPermissions(filterReq Filter) ([]string, error)
}
type DashboardsApi ¶
type DashboardsApi interface {
ListDashboards(filter Filter) []*customModels.NestedHit
DownloadDashboards(filter Filter) []string
UploadDashboards(filterReq Filter) ([]string, error)
DeleteAllDashboards(filter Filter) []string
}
DashboardsApi Contract definition
type ExtendedApi ¶
type Filter ¶
type Filter interface {
// Setup should not need ctx, but may revisit
RegisterReader(entityType reflect.Type, fn domain.FilterReader) error
RegisterDataProcessor(entityType domain.FilterType, entity domain.ProcessorEntity) error
AddValidation(f domain.FilterType, validation domain.InputValidation, expected any)
// Runtime validation all have context
Validate(context.Context, domain.FilterType, any) bool
ValidateAll(ctx context.Context, data any) bool // ValidateAll if Entry is valid
GetExpectedValue(ctx context.Context, filterType domain.FilterType) any
GetExpectedString(ctx context.Context, filterType domain.FilterType) string
GetExpectedStringSlice(ctx context.Context, filterType domain.FilterType) ([]string, error)
GetReaderValue(ctx context.Context, filterType domain.FilterType, obj any) any
}
type FoldersApi ¶
type FoldersApi interface {
ListFolders(filter Filter) []*customModels.NestedHit
DownloadFolders(filter Filter) []string
UploadFolders(filter Filter) []string
DeleteAllFolders(filter Filter) []string
// Permissions
ListFolderPermissions(filter Filter) map[*customModels.NestedHit][]*models.DashboardACLInfoDTO
DownloadFolderPermissions(filter Filter) []string
UploadFolderPermissions(filter Filter) []string
}
FoldersApi Contract definition
type GrafanaService ¶
type GrafanaService interface {
OrganizationsApi
DashboardsApi
DashboardPermissionsApi
ConnectionsApi
UsersApi
FoldersApi
LibraryElementsApi
TeamsApi
AlertingApi
AuthenticationApi
// MetaData
ServerInfoApi
LicenseApi
}
type LibraryElementsApi ¶
type LibraryElementsApi interface {
ListLibraryElements(filter Filter) []*customModels.WithNested[models.LibraryElementDTO]
ListLibraryElementsConnections(filter Filter, connectionID string) []*models.DashboardFullWithMeta
DownloadLibraryElements(filter Filter) []string
UploadLibraryElements(filter Filter) []string
DeleteAllLibraryElements(filter Filter) []string
}
type LicenseApi ¶
type LicenseApi interface {
IsEnterprise() bool
}
type OrgPreferencesApi ¶
type OrgPreferencesApi interface {
GetOrgPreferences() (*models.PreferencesSpec, error)
UploadOrgPreferences(orgName string, pref *models.PreferencesSpec) error
}
OrgPreferencesApi Contract definition
type OrganizationsApi ¶
type OrganizationsApi interface {
OrgPreferencesApi
InitOrganizations()
// contains filtered or unexported methods
}
OrganizationsApi Contract definition
type ServerInfoApi ¶
type ServiceAccountApi ¶
type ServiceAccountApi interface {
ListServiceAccounts() []*customModels.ServiceAccountDTOWithTokens
ListServiceAccountsTokens(id int64) ([]*models.TokenDTO, error)
DeleteServiceAccount(accountId int64) error
DeleteAllServiceAccounts() []string
DeleteServiceAccountTokens(serviceId int64) []string
CreateServiceAccountToken(serviceAccountId int64, name string, expiration int64) (*models.NewAPIKeyResult, error)
CreateServiceAccount(name, role string, expiration int64) (*models.ServiceAccountDTO, error)
}
type Storage ¶
type Storage interface {
WriteFile(filename string, data []byte) error // WriteFile returns error or writes byte array to destination
ReadFile(filename string) ([]byte, error) // ReadFile returns byte array or error with data from file
FindAllFiles(folder string, fullPath bool) ([]string, error) // FindAllFiles recursively list all files for a given path
Name() string // Name of storage engine
GetPrefix() string // Prefix used by storage engine
}
TODO: pull all the cloud based interaction into a Plugin System
type TeamsApi ¶
type TeamsApi interface {
// Team
DownloadTeams(filter Filter) map[*models.TeamDTO][]*models.TeamMemberDTO
UploadTeams(filter Filter) map[*models.TeamDTO][]*models.TeamMemberDTO
ListTeams(filter Filter) map[*models.TeamDTO][]*models.TeamMemberDTO
DeleteTeam(filter Filter) ([]*models.TeamDTO, error)
}
type Templating ¶
type Templating interface {
Generate(templateName string) (map[string][]string, error)
ListTemplates() []string
}
Templating defines an interface for generating and listing dashboard templates based on templating configuration.
type UsersApi ¶
type UsersApi interface {
// UserApi
ListUsers(filter Filter) []*models.UserSearchHitDTO
DownloadUsers(filter Filter) []string
UploadUsers(filter Filter) []customModels.UserProfileWithAuth
DeleteAllUsers(filter Filter) []string
// Tools
PromoteUser(userLogin string) (string, error)
GetUserInfo() (*models.UserProfileDTO, error)
}
UsersApi Contract definition
Source Files
¶
Click to show internal directories.
Click to hide internal directories.