Documentation
¶
Index ¶
- Constants
- Variables
- func AppPluginRoute(route *plugins.AppPluginRoute, appID string, hs *HTTPServer) macaron.Handler
- func BasicAuthenticatedRequest(req macaron.Request, expectedUser, expectedPass string) bool
- func CreateDashboardSnapshot(c *models.ReqContext, cmd models.CreateDashboardSnapshotCommand)
- func GenStateString() (string, error)
- func GetAuthProviderLabel(authModule string) string
- func GetDashboardSnapshot(c *models.ReqContext)
- func GetDashboardTags(c *models.ReqContext)
- func GetSharingOptions(c *models.ReqContext)
- func LoadPlaylistDashboards(orgID int64, signedInUser *models.SignedInUser, playlistID int64) (dtos.PlaylistDashboardsSlice, error)
- func LoadPlaylistItemDTOs(id int64) ([]models.PlaylistItemDTO, error)
- func LoadPlaylistItems(id int64) ([]models.PlaylistItem, error)
- func ProxyGnetRequest(c *models.ReqContext)
- func ReverseProxyGnetReq(proxyPath string) *httputil.ReverseProxy
- func ValidateOrgAlert(c *models.ReqContext)
- func ValidateOrgPlaylist(c *models.ReqContext)
- func Wrap(action interface{}) macaron.Handler
- type CreateAnnotationError
- type CreateExternalSnapshotResponse
- type HTTPServer
- func (hs *HTTPServer) AddAPIKey(c *models.ReqContext, cmd models.AddApiKeyCommand) Response
- func (hs *HTTPServer) AddMiddleware(middleware macaron.Handler)
- func (hs *HTTPServer) AddTeamMember(c *models.ReqContext, cmd models.AddTeamMemberCommand) Response
- func (server *HTTPServer) AdminDisableUser(c *models.ReqContext) Response
- func (server *HTTPServer) AdminGetUserAuthTokens(c *models.ReqContext) Response
- func (server *HTTPServer) AdminLogoutUser(c *models.ReqContext) Response
- func (server *HTTPServer) AdminProvisioningReloadDashboards(c *models.ReqContext) Response
- func (server *HTTPServer) AdminProvisioningReloadDatasources(c *models.ReqContext) Response
- func (server *HTTPServer) AdminProvisioningReloadNotifications(c *models.ReqContext) Response
- func (server *HTTPServer) AdminProvisioningReloadPlugins(c *models.ReqContext) Response
- func (server *HTTPServer) AdminRevokeUserAuthToken(c *models.ReqContext, cmd models.RevokeAuthTokenCmd) Response
- func (hs *HTTPServer) CallDatasourceResource(c *models.ReqContext)
- func (hs *HTTPServer) CallResource(c *models.ReqContext)
- func (hs *HTTPServer) ChangeActiveOrgAndRedirectToHome(c *models.ReqContext)
- func (hs *HTTPServer) CheckDatasourceHealth(c *models.ReqContext) Response
- func (hs *HTTPServer) CheckHealth(c *models.ReqContext) Response
- func (hs *HTTPServer) CollectPluginMetrics(c *models.ReqContext) Response
- func (hs *HTTPServer) CompleteInvite(c *models.ReqContext, completeInvite dtos.CompleteInviteForm) Response
- func (hs *HTTPServer) CookieOptionsFromCfg() middleware.CookieOptions
- func (hs *HTTPServer) CreateFolder(c *models.ReqContext, cmd models.CreateFolderCommand) Response
- func (hs *HTTPServer) CreateTeam(c *models.ReqContext, cmd models.CreateTeamCommand) Response
- func (hs *HTTPServer) DeleteTeamByID(c *models.ReqContext) Response
- func (hs *HTTPServer) GetDashboard(c *models.ReqContext) Response
- func (hs *HTTPServer) GetFrontendSettings(c *models.ReqContext)
- func (hs *HTTPServer) GetHomeDashboard(c *models.ReqContext) Response
- func (server *HTTPServer) GetLDAPStatus(c *models.ReqContext) Response
- func (hs *HTTPServer) GetPluginList(c *models.ReqContext) Response
- func (hs *HTTPServer) GetTeamMembers(c *models.ReqContext) Response
- func (hs *HTTPServer) GetTeamPreferences(c *models.ReqContext) Response
- func (server *HTTPServer) GetUserAuthTokens(c *models.ReqContext) Response
- func (server *HTTPServer) GetUserFromLDAP(c *models.ReqContext) Response
- func (hs *HTTPServer) Index(c *models.ReqContext)
- func (hs *HTTPServer) Init() error
- func (hs *HTTPServer) ListSortOptions(c *models.ReqContext) Response
- func (hs *HTTPServer) LoginAPIPing(c *models.ReqContext) Response
- func (hs *HTTPServer) LoginPost(c *models.ReqContext, cmd dtos.LoginCommand) Response
- func (hs *HTTPServer) LoginView(c *models.ReqContext)
- func (hs *HTTPServer) Logout(c *models.ReqContext)
- func (hs *HTTPServer) NotFoundHandler(c *models.ReqContext)
- func (hs *HTTPServer) OAuthLogin(ctx *models.ReqContext)
- func (hs *HTTPServer) PostDashboard(c *models.ReqContext, cmd models.SaveDashboardCommand) Response
- func (server *HTTPServer) PostSyncUserWithLDAP(c *models.ReqContext) Response
- func (hs *HTTPServer) ProxyDataSourceRequest(c *models.ReqContext)
- func (hs *HTTPServer) QueryMetrics(c *models.ReqContext, reqDto dtos.MetricRequest) Response
- func (hs *HTTPServer) QueryMetricsV2(c *models.ReqContext, reqDto dtos.MetricRequest) Response
- func (hs *HTTPServer) RedirectResponseWithError(ctx *models.ReqContext, err error, v ...interface{}) *RedirectResponse
- func (server *HTTPServer) ReloadLDAPCfg() Response
- func (hs *HTTPServer) RemoveTeamMember(c *models.ReqContext) Response
- func (hs *HTTPServer) RenderToPng(c *models.ReqContext)
- func (hs *HTTPServer) RestoreDashboardVersion(c *models.ReqContext, apiCmd dtos.RestoreDashboardVersionCommand) Response
- func (server *HTTPServer) RevokeUserAuthToken(c *models.ReqContext, cmd models.RevokeAuthTokenCmd) Response
- func (hs *HTTPServer) Run(ctx context.Context) error
- func (hs *HTTPServer) SearchTeams(c *models.ReqContext) Response
- func (hs *HTTPServer) SendLoginLog(cmd *models.SendLoginLogCommand)
- func (hs *HTTPServer) SignUpStep2(c *models.ReqContext, form dtos.SignUpStep2Form) Response
- func (hs *HTTPServer) UpdateTeam(c *models.ReqContext, cmd models.UpdateTeamCommand) Response
- func (hs *HTTPServer) UpdateTeamMember(c *models.ReqContext, cmd models.UpdateTeamMemberCommand) Response
- func (hs *HTTPServer) UpdateTeamPreferences(c *models.ReqContext, dtoCmd dtos.UpdatePrefsCmd) Response
- func (hs *HTTPServer) ValidateRedirectTo(redirectTo string) error
- type LDAPAttribute
- type LDAPRoleDTO
- type LDAPServerDTO
- type LDAPUserDTO
- type LoginError
- type LoginInformation
- type NormalResponse
- type RedirectResponse
- type Response
- func AddDataSource(c *models.ReqContext, cmd models.AddDataSourceCommand) Response
- func AddOrgInvite(c *models.ReqContext, inviteDto dtos.AddInviteForm) Response
- func AddOrgUser(c *models.ReqContext, cmd models.AddOrgUserCommand) Response
- func AddOrgUserToCurrentOrg(c *models.ReqContext, cmd models.AddOrgUserCommand) Response
- func AdminCreateUser(c *models.ReqContext, form dtos.AdminCreateUserForm) Response
- func AdminDeleteUser(c *models.ReqContext) Response
- func AdminEnableUser(c *models.ReqContext) Response
- func AdminGetSettings(c *models.ReqContext) Response
- func AdminGetStats(c *models.ReqContext) Response
- func AdminUpdateUserPassword(c *models.ReqContext, form dtos.AdminUpdateUserPasswordForm) Response
- func AdminUpdateUserPermissions(c *models.ReqContext, form dtos.AdminUpdateUserPermissionsForm) Response
- func AlertTest(c *models.ReqContext, dto dtos.AlertTestCommand) Response
- func CalculateDashboardDiff(c *models.ReqContext, apiOptions dtos.CalculateDiffOptions) Response
- func ChangeUserPassword(c *models.ReqContext, cmd models.ChangeUserPasswordCommand) Response
- func ClearHelpFlags(c *models.ReqContext) Response
- func CreateAlertNotification(c *models.ReqContext, cmd models.CreateAlertNotificationCommand) Response
- func CreateOrg(c *models.ReqContext, cmd models.CreateOrgCommand) Response
- func CreatePlaylist(c *models.ReqContext, cmd models.CreatePlaylistCommand) Response
- func DeleteAPIKey(c *models.ReqContext) Response
- func DeleteAlertNotification(c *models.ReqContext) Response
- func DeleteAlertNotificationByUID(c *models.ReqContext) Response
- func DeleteAnnotationByID(c *models.ReqContext) Response
- func DeleteAnnotations(c *models.ReqContext, cmd dtos.DeleteAnnotationsCmd) Response
- func DeleteDashboardBySlug(c *models.ReqContext) Response
- func DeleteDashboardByUID(c *models.ReqContext) Response
- func DeleteDashboardSnapshot(c *models.ReqContext) Response
- func DeleteDashboardSnapshotByDeleteKey(c *models.ReqContext) Response
- func DeleteDataSourceById(c *models.ReqContext) Response
- func DeleteDataSourceByName(c *models.ReqContext) Response
- func DeleteFolder(c *models.ReqContext) Response
- func DeleteOrgByID(c *models.ReqContext) Response
- func DeletePlaylist(c *models.ReqContext) Response
- func GenerateError(c *models.ReqContext) Response
- func GenerateSQLTestData(c *models.ReqContext) Response
- func GetAPIKeys(c *models.ReqContext) Response
- func GetAlert(c *models.ReqContext) Response
- func GetAlertNotificationByID(c *models.ReqContext) Response
- func GetAlertNotificationByUID(c *models.ReqContext) Response
- func GetAlertNotificationLookup(c *models.ReqContext) Response
- func GetAlertNotifications(c *models.ReqContext) Response
- func GetAlertNotifiers(c *models.ReqContext) Response
- func GetAlertStatesForDashboard(c *models.ReqContext) Response
- func GetAlerts(c *models.ReqContext) Response
- func GetAnnotations(c *models.ReqContext) Response
- func GetDashboardPermissionList(c *models.ReqContext) Response
- func GetDashboardVersion(c *models.ReqContext) Response
- func GetDashboardVersions(c *models.ReqContext) Response
- func GetDataSourceById(c *models.ReqContext) Response
- func GetDataSourceByName(c *models.ReqContext) Response
- func GetDataSourceIdByName(c *models.ReqContext) Response
- func GetDataSources(c *models.ReqContext) Response
- func GetFolderByID(c *models.ReqContext) Response
- func GetFolderByUID(c *models.ReqContext) Response
- func GetFolderPermissionList(c *models.ReqContext) Response
- func GetFolders(c *models.ReqContext) Response
- func GetInviteInfoByCode(c *models.ReqContext) Response
- func GetOrgByID(c *models.ReqContext) Response
- func GetOrgByName(c *models.ReqContext) Response
- func GetOrgCurrent(c *models.ReqContext) Response
- func GetOrgPreferences(c *models.ReqContext) Response
- func GetOrgQuotas(c *models.ReqContext) Response
- func GetOrgUsers(c *models.ReqContext) Response
- func GetOrgUsersForCurrentOrg(c *models.ReqContext) Response
- func GetOrgUsersForCurrentOrgLookup(c *models.ReqContext) Response
- func GetPendingOrgInvites(c *models.ReqContext) Response
- func GetPlaylist(c *models.ReqContext) Response
- func GetPlaylistDashboards(c *models.ReqContext) Response
- func GetPlaylistItems(c *models.ReqContext) Response
- func GetPluginDashboards(c *models.ReqContext) Response
- func GetPluginMarkdown(c *models.ReqContext) Response
- func GetPluginSettingByID(c *models.ReqContext) Response
- func GetSignUpOptions(c *models.ReqContext) Response
- func GetSignedInUser(c *models.ReqContext) Response
- func GetSignedInUserOrgList(c *models.ReqContext) Response
- func GetSignedInUserTeamList(c *models.ReqContext) Response
- func GetTeamByID(c *models.ReqContext) Response
- func GetTestDataRandomWalk(c *models.ReqContext) Response
- func GetTestDataScenarios(c *models.ReqContext) Response
- func GetUserByID(c *models.ReqContext) Response
- func GetUserByLoginOrEmail(c *models.ReqContext) Response
- func GetUserOrgList(c *models.ReqContext) Response
- func GetUserPreferences(c *models.ReqContext) Response
- func GetUserQuotas(c *models.ReqContext) Response
- func GetUserTeams(c *models.ReqContext) Response
- func ImportDashboard(c *models.ReqContext, apiCmd dtos.ImportDashboardCommand) Response
- func NotificationTest(c *models.ReqContext, dto dtos.NotificationTestCommand) Response
- func PatchAnnotation(c *models.ReqContext, cmd dtos.PatchAnnotationsCmd) Response
- func PauseAlert(c *models.ReqContext, dto dtos.PauseAlertCommand) Response
- func PauseAllAlerts(c *models.ReqContext, dto dtos.PauseAllAlertsCommand) Response
- func PostAnnotation(c *models.ReqContext, cmd dtos.PostAnnotationsCmd) Response
- func PostGraphiteAnnotation(c *models.ReqContext, cmd dtos.PostGraphiteAnnotationsCmd) Response
- func RemoveOrgUser(c *models.ReqContext) Response
- func RemoveOrgUserForCurrentOrg(c *models.ReqContext) Response
- func ResetPassword(c *models.ReqContext, form dtos.ResetUserPasswordForm) Response
- func RevokeInvite(c *models.ReqContext) Response
- func Search(c *models.ReqContext) Response
- func SearchDashboardSnapshots(c *models.ReqContext) Response
- func SearchOrgs(c *models.ReqContext) Response
- func SearchPlaylists(c *models.ReqContext) Response
- func SearchUsers(c *models.ReqContext) Response
- func SearchUsersWithPaging(c *models.ReqContext) Response
- func SendResetPasswordEmail(c *models.ReqContext, form dtos.SendResetPasswordEmailForm) Response
- func SetHelpFlag(c *models.ReqContext) Response
- func SetHomeDashboard(c *models.ReqContext, cmd models.SavePreferencesCommand) Response
- func SignUp(c *models.ReqContext, form dtos.SignUpForm) Response
- func StarDashboard(c *models.ReqContext) Response
- func UnstarDashboard(c *models.ReqContext) Response
- func UpdateAlertNotification(c *models.ReqContext, cmd models.UpdateAlertNotificationCommand) Response
- func UpdateAlertNotificationByUID(c *models.ReqContext, cmd models.UpdateAlertNotificationWithUidCommand) Response
- func UpdateAnnotation(c *models.ReqContext, cmd dtos.UpdateAnnotationsCmd) Response
- func UpdateDashboardPermissions(c *models.ReqContext, apiCmd dtos.UpdateDashboardAclCommand) Response
- func UpdateDataSource(c *models.ReqContext, cmd models.UpdateDataSourceCommand) Response
- func UpdateFolder(c *models.ReqContext, cmd models.UpdateFolderCommand) Response
- func UpdateFolderPermissions(c *models.ReqContext, apiCmd dtos.UpdateDashboardAclCommand) Response
- func UpdateOrg(c *models.ReqContext, form dtos.UpdateOrgForm) Response
- func UpdateOrgAddress(c *models.ReqContext, form dtos.UpdateOrgAddressForm) Response
- func UpdateOrgAddressCurrent(c *models.ReqContext, form dtos.UpdateOrgAddressForm) Response
- func UpdateOrgCurrent(c *models.ReqContext, form dtos.UpdateOrgForm) Response
- func UpdateOrgPreferences(c *models.ReqContext, dtoCmd dtos.UpdatePrefsCmd) Response
- func UpdateOrgQuota(c *models.ReqContext, cmd models.UpdateOrgQuotaCmd) Response
- func UpdateOrgUser(c *models.ReqContext, cmd models.UpdateOrgUserCommand) Response
- func UpdateOrgUserForCurrentOrg(c *models.ReqContext, cmd models.UpdateOrgUserCommand) Response
- func UpdatePlaylist(c *models.ReqContext, cmd models.UpdatePlaylistCommand) Response
- func UpdatePluginSetting(c *models.ReqContext, cmd models.UpdatePluginSettingCmd) Response
- func UpdateSignedInUser(c *models.ReqContext, cmd models.UpdateUserCommand) Response
- func UpdateUser(c *models.ReqContext, cmd models.UpdateUserCommand) Response
- func UpdateUserActiveOrg(c *models.ReqContext) Response
- func UpdateUserPreferences(c *models.ReqContext, dtoCmd dtos.UpdatePrefsCmd) Response
- func UpdateUserQuota(c *models.ReqContext, cmd models.UpdateUserQuotaCmd) Response
- func UserSetUsingOrg(c *models.ReqContext) Response
Constants ¶
const ( ViewIndex = "index" LoginErrorCookieName = "login_error" )
Variables ¶
var ( NotFound = func() Response { return Error(404, "Not found", nil) } ServerError = func(err error) Response { return Error(500, "Server error", err) } )
var ErrPluginNotFound error = errors.New("plugin not found, no installed plugin with that id")
ErrPluginNotFound is returned when an requested plugin is not installed.
var (
OauthStateCookieName = "oauth_state"
)
Functions ¶
func AppPluginRoute ¶
func AppPluginRoute(route *plugins.AppPluginRoute, appID string, hs *HTTPServer) macaron.Handler
func BasicAuthenticatedRequest ¶
BasicAuthenticatedRequest parses the provided HTTP request for basic authentication credentials and returns true if the provided credentials match the expected username and password. Returns false if the request is unauthenticated. Uses constant-time comparison in order to mitigate timing attacks.
func CreateDashboardSnapshot ¶
func CreateDashboardSnapshot(c *models.ReqContext, cmd models.CreateDashboardSnapshotCommand)
POST /api/snapshots
func GenStateString ¶
func GetAuthProviderLabel ¶
func GetDashboardTags ¶
func GetDashboardTags(c *models.ReqContext)
func GetSharingOptions ¶
func GetSharingOptions(c *models.ReqContext)
func LoadPlaylistDashboards ¶
func LoadPlaylistDashboards(orgID int64, signedInUser *models.SignedInUser, playlistID int64) (dtos.PlaylistDashboardsSlice, error)
func LoadPlaylistItemDTOs ¶
func LoadPlaylistItemDTOs(id int64) ([]models.PlaylistItemDTO, error)
func LoadPlaylistItems ¶
func LoadPlaylistItems(id int64) ([]models.PlaylistItem, error)
func ProxyGnetRequest ¶
func ProxyGnetRequest(c *models.ReqContext)
func ReverseProxyGnetReq ¶
func ReverseProxyGnetReq(proxyPath string) *httputil.ReverseProxy
func ValidateOrgAlert ¶
func ValidateOrgAlert(c *models.ReqContext)
func ValidateOrgPlaylist ¶
func ValidateOrgPlaylist(c *models.ReqContext)
Types ¶
type CreateAnnotationError ¶
type CreateAnnotationError struct {
// contains filtered or unexported fields
}
func (*CreateAnnotationError) Error ¶
func (e *CreateAnnotationError) Error() string
type HTTPServer ¶
type HTTPServer struct { RouteRegister routing.RouteRegister `inject:""` Bus bus.Bus `inject:""` RenderService rendering.Service `inject:""` Cfg *setting.Cfg `inject:""` HooksService *hooks.HooksService `inject:""` CacheService *localcache.CacheService `inject:""` DatasourceCache datasources.CacheService `inject:""` AuthTokenService models.UserTokenService `inject:""` QuotaService *quota.QuotaService `inject:""` RemoteCacheService *remotecache.RemoteCache `inject:""` ProvisioningService provisioning.ProvisioningService `inject:""` Login *login.LoginService `inject:""` License models.Licensing `inject:""` BackendPluginManager backendplugin.Manager `inject:""` PluginManager *plugins.PluginManager `inject:""` SearchService *search.SearchService `inject:""` Live *live.GrafanaLive Listener net.Listener // contains filtered or unexported fields }
func (*HTTPServer) AddAPIKey ¶
func (hs *HTTPServer) AddAPIKey(c *models.ReqContext, cmd models.AddApiKeyCommand) Response
func (*HTTPServer) AddMiddleware ¶
func (hs *HTTPServer) AddMiddleware(middleware macaron.Handler)
func (*HTTPServer) AddTeamMember ¶
func (hs *HTTPServer) AddTeamMember(c *models.ReqContext, cmd models.AddTeamMemberCommand) Response
POST /api/teams/:teamId/members
func (*HTTPServer) AdminDisableUser ¶
func (server *HTTPServer) AdminDisableUser(c *models.ReqContext) Response
POST /api/admin/users/:id/disable
func (*HTTPServer) AdminGetUserAuthTokens ¶
func (server *HTTPServer) AdminGetUserAuthTokens(c *models.ReqContext) Response
GET /api/admin/users/:id/auth-tokens
func (*HTTPServer) AdminLogoutUser ¶
func (server *HTTPServer) AdminLogoutUser(c *models.ReqContext) Response
POST /api/admin/users/:id/logout
func (*HTTPServer) AdminProvisioningReloadDashboards ¶
func (server *HTTPServer) AdminProvisioningReloadDashboards(c *models.ReqContext) Response
func (*HTTPServer) AdminProvisioningReloadDatasources ¶
func (server *HTTPServer) AdminProvisioningReloadDatasources(c *models.ReqContext) Response
func (*HTTPServer) AdminProvisioningReloadNotifications ¶
func (server *HTTPServer) AdminProvisioningReloadNotifications(c *models.ReqContext) Response
func (*HTTPServer) AdminProvisioningReloadPlugins ¶
func (server *HTTPServer) AdminProvisioningReloadPlugins(c *models.ReqContext) Response
func (*HTTPServer) AdminRevokeUserAuthToken ¶
func (server *HTTPServer) AdminRevokeUserAuthToken(c *models.ReqContext, cmd models.RevokeAuthTokenCmd) Response
POST /api/admin/users/:id/revoke-auth-token
func (*HTTPServer) CallDatasourceResource ¶
func (hs *HTTPServer) CallDatasourceResource(c *models.ReqContext)
/api/datasources/:id/resources/*
func (*HTTPServer) CallResource ¶
func (hs *HTTPServer) CallResource(c *models.ReqContext)
CallResource passes a resource call from a plugin to the backend plugin.
/api/plugins/:pluginId/resources/*
func (*HTTPServer) ChangeActiveOrgAndRedirectToHome ¶
func (hs *HTTPServer) ChangeActiveOrgAndRedirectToHome(c *models.ReqContext)
GET /profile/switch-org/:id
func (*HTTPServer) CheckDatasourceHealth ¶
func (hs *HTTPServer) CheckDatasourceHealth(c *models.ReqContext) Response
CheckDatasourceHealth sends a health check request to the plugin datasource /api/datasource/:id/health
func (*HTTPServer) CheckHealth ¶
func (hs *HTTPServer) CheckHealth(c *models.ReqContext) Response
CheckHealth returns the health of a plugin. /api/plugins/:pluginId/health
func (*HTTPServer) CollectPluginMetrics ¶
func (hs *HTTPServer) CollectPluginMetrics(c *models.ReqContext) Response
CollectPluginMetrics collect metrics from a plugin.
/api/plugins/:pluginId/metrics
func (*HTTPServer) CompleteInvite ¶
func (hs *HTTPServer) CompleteInvite(c *models.ReqContext, completeInvite dtos.CompleteInviteForm) Response
func (*HTTPServer) CookieOptionsFromCfg ¶
func (hs *HTTPServer) CookieOptionsFromCfg() middleware.CookieOptions
func (*HTTPServer) CreateFolder ¶
func (hs *HTTPServer) CreateFolder(c *models.ReqContext, cmd models.CreateFolderCommand) Response
func (*HTTPServer) CreateTeam ¶
func (hs *HTTPServer) CreateTeam(c *models.ReqContext, cmd models.CreateTeamCommand) Response
POST /api/teams
func (*HTTPServer) DeleteTeamByID ¶
func (hs *HTTPServer) DeleteTeamByID(c *models.ReqContext) Response
DELETE /api/teams/:teamId
func (*HTTPServer) GetDashboard ¶
func (hs *HTTPServer) GetDashboard(c *models.ReqContext) Response
func (*HTTPServer) GetFrontendSettings ¶
func (hs *HTTPServer) GetFrontendSettings(c *models.ReqContext)
func (*HTTPServer) GetHomeDashboard ¶
func (hs *HTTPServer) GetHomeDashboard(c *models.ReqContext) Response
GetHomeDashboard returns the home dashboard.
func (*HTTPServer) GetLDAPStatus ¶
func (server *HTTPServer) GetLDAPStatus(c *models.ReqContext) Response
GetLDAPStatus attempts to connect to all the configured LDAP servers and returns information on whenever they're available or not.
func (*HTTPServer) GetPluginList ¶
func (hs *HTTPServer) GetPluginList(c *models.ReqContext) Response
func (*HTTPServer) GetTeamMembers ¶
func (hs *HTTPServer) GetTeamMembers(c *models.ReqContext) Response
GET /api/teams/:teamId/members
func (*HTTPServer) GetTeamPreferences ¶
func (hs *HTTPServer) GetTeamPreferences(c *models.ReqContext) Response
GET /api/teams/:teamId/preferences
func (*HTTPServer) GetUserAuthTokens ¶
func (server *HTTPServer) GetUserAuthTokens(c *models.ReqContext) Response
GET /api/user/auth-tokens
func (*HTTPServer) GetUserFromLDAP ¶
func (server *HTTPServer) GetUserFromLDAP(c *models.ReqContext) Response
GetUserFromLDAP finds an user based on a username in LDAP. This helps illustrate how would the particular user be mapped in Grafana when synced.
func (*HTTPServer) Index ¶
func (hs *HTTPServer) Index(c *models.ReqContext)
func (*HTTPServer) Init ¶
func (hs *HTTPServer) Init() error
func (*HTTPServer) ListSortOptions ¶
func (hs *HTTPServer) ListSortOptions(c *models.ReqContext) Response
func (*HTTPServer) LoginAPIPing ¶
func (hs *HTTPServer) LoginAPIPing(c *models.ReqContext) Response
func (*HTTPServer) LoginPost ¶
func (hs *HTTPServer) LoginPost(c *models.ReqContext, cmd dtos.LoginCommand) Response
func (*HTTPServer) LoginView ¶
func (hs *HTTPServer) LoginView(c *models.ReqContext)
func (*HTTPServer) Logout ¶
func (hs *HTTPServer) Logout(c *models.ReqContext)
func (*HTTPServer) NotFoundHandler ¶
func (hs *HTTPServer) NotFoundHandler(c *models.ReqContext)
func (*HTTPServer) OAuthLogin ¶
func (hs *HTTPServer) OAuthLogin(ctx *models.ReqContext)
func (*HTTPServer) PostDashboard ¶
func (hs *HTTPServer) PostDashboard(c *models.ReqContext, cmd models.SaveDashboardCommand) Response
func (*HTTPServer) PostSyncUserWithLDAP ¶
func (server *HTTPServer) PostSyncUserWithLDAP(c *models.ReqContext) Response
PostSyncUserWithLDAP enables a single Grafana user to be synchronized against LDAP
func (*HTTPServer) ProxyDataSourceRequest ¶
func (hs *HTTPServer) ProxyDataSourceRequest(c *models.ReqContext)
ProxyDataSourceRequest proxies datasource requests
func (*HTTPServer) QueryMetrics ¶
func (hs *HTTPServer) QueryMetrics(c *models.ReqContext, reqDto dtos.MetricRequest) Response
QueryMetrics returns query metrics POST /api/tsdb/query
func (*HTTPServer) QueryMetricsV2 ¶
func (hs *HTTPServer) QueryMetricsV2(c *models.ReqContext, reqDto dtos.MetricRequest) Response
QueryMetricsV2 returns query metrics POST /api/ds/query DataSource query w/ expressions
func (*HTTPServer) RedirectResponseWithError ¶
func (hs *HTTPServer) RedirectResponseWithError(ctx *models.ReqContext, err error, v ...interface{}) *RedirectResponse
func (*HTTPServer) ReloadLDAPCfg ¶
func (server *HTTPServer) ReloadLDAPCfg() Response
ReloadLDAPCfg reloads the LDAP configuration
func (*HTTPServer) RemoveTeamMember ¶
func (hs *HTTPServer) RemoveTeamMember(c *models.ReqContext) Response
DELETE /api/teams/:teamId/members/:userId
func (*HTTPServer) RenderToPng ¶
func (hs *HTTPServer) RenderToPng(c *models.ReqContext)
func (*HTTPServer) RestoreDashboardVersion ¶
func (hs *HTTPServer) RestoreDashboardVersion(c *models.ReqContext, apiCmd dtos.RestoreDashboardVersionCommand) Response
RestoreDashboardVersion restores a dashboard to the given version.
func (*HTTPServer) RevokeUserAuthToken ¶
func (server *HTTPServer) RevokeUserAuthToken(c *models.ReqContext, cmd models.RevokeAuthTokenCmd) Response
POST /api/user/revoke-auth-token
func (*HTTPServer) SearchTeams ¶
func (hs *HTTPServer) SearchTeams(c *models.ReqContext) Response
GET /api/teams/search
func (*HTTPServer) SendLoginLog ¶
func (hs *HTTPServer) SendLoginLog(cmd *models.SendLoginLogCommand)
func (*HTTPServer) SignUpStep2 ¶
func (hs *HTTPServer) SignUpStep2(c *models.ReqContext, form dtos.SignUpStep2Form) Response
func (*HTTPServer) UpdateTeam ¶
func (hs *HTTPServer) UpdateTeam(c *models.ReqContext, cmd models.UpdateTeamCommand) Response
PUT /api/teams/:teamId
func (*HTTPServer) UpdateTeamMember ¶
func (hs *HTTPServer) UpdateTeamMember(c *models.ReqContext, cmd models.UpdateTeamMemberCommand) Response
PUT /:teamId/members/:userId
func (*HTTPServer) UpdateTeamPreferences ¶
func (hs *HTTPServer) UpdateTeamPreferences(c *models.ReqContext, dtoCmd dtos.UpdatePrefsCmd) Response
PUT /api/teams/:teamId/preferences
func (*HTTPServer) ValidateRedirectTo ¶
func (hs *HTTPServer) ValidateRedirectTo(redirectTo string) error
type LDAPAttribute ¶
type LDAPAttribute struct { ConfigAttributeValue string `json:"cfgAttrValue"` LDAPAttributeValue string `json:"ldapValue"` }
LDAPAttribute is a serializer for user attributes mapped from LDAP. Is meant to display both the serialized value and the LDAP key we received it from.
type LDAPRoleDTO ¶
type LDAPRoleDTO struct { OrgId int64 `json:"orgId"` OrgName string `json:"orgName"` OrgRole models.RoleType `json:"orgRole"` GroupDN string `json:"groupDN"` }
RoleDTO is a serializer for mapped roles from LDAP
type LDAPServerDTO ¶
type LDAPServerDTO struct { Host string `json:"host"` Port int `json:"port"` Available bool `json:"available"` Error string `json:"error"` }
LDAPServerDTO is a serializer for LDAP server statuses
type LDAPUserDTO ¶
type LDAPUserDTO struct { Name *LDAPAttribute `json:"name"` Surname *LDAPAttribute `json:"surname"` Email *LDAPAttribute `json:"email"` Username *LDAPAttribute `json:"login"` IsGrafanaAdmin *bool `json:"isGrafanaAdmin"` IsDisabled bool `json:"isDisabled"` OrgRoles []LDAPRoleDTO `json:"roles"` Teams []models.TeamOrgGroupDTO `json:"teams"` }
LDAPUserDTO is a serializer for users mapped from LDAP
func (*LDAPUserDTO) FetchOrgs ¶
func (user *LDAPUserDTO) FetchOrgs() error
FetchOrgs fetches the organization(s) information by executing a single query to the database. Then, populating the DTO with the information retrieved.
type LoginError ¶
type LoginInformation ¶
type LoginInformation struct { Action string User *models.User ExtUserInfo *models.ExternalUserInfo }
type NormalResponse ¶
type NormalResponse struct {
// contains filtered or unexported fields
}
func Error ¶
func Error(status int, message string, err error) *NormalResponse
Error create a erroneous response
func (*NormalResponse) Cache ¶
func (r *NormalResponse) Cache(ttl string) *NormalResponse
func (*NormalResponse) Header ¶
func (r *NormalResponse) Header(key, value string) *NormalResponse
func (*NormalResponse) WriteTo ¶
func (r *NormalResponse) WriteTo(ctx *models.ReqContext)
type RedirectResponse ¶
type RedirectResponse struct {
// contains filtered or unexported fields
}
func Redirect ¶
func Redirect(location string) *RedirectResponse
func (*RedirectResponse) WriteTo ¶
func (r *RedirectResponse) WriteTo(ctx *models.ReqContext)
type Response ¶
type Response interface {
WriteTo(ctx *models.ReqContext)
}
func AddDataSource ¶
func AddDataSource(c *models.ReqContext, cmd models.AddDataSourceCommand) Response
func AddOrgInvite ¶
func AddOrgInvite(c *models.ReqContext, inviteDto dtos.AddInviteForm) Response
func AddOrgUser ¶
func AddOrgUser(c *models.ReqContext, cmd models.AddOrgUserCommand) Response
POST /api/orgs/:orgId/users
func AddOrgUserToCurrentOrg ¶
func AddOrgUserToCurrentOrg(c *models.ReqContext, cmd models.AddOrgUserCommand) Response
POST /api/org/users
func AdminCreateUser ¶
func AdminCreateUser(c *models.ReqContext, form dtos.AdminCreateUserForm) Response
func AdminDeleteUser ¶
func AdminDeleteUser(c *models.ReqContext) Response
func AdminEnableUser ¶
func AdminEnableUser(c *models.ReqContext) Response
POST /api/admin/users/:id/enable
func AdminGetSettings ¶
func AdminGetSettings(c *models.ReqContext) Response
func AdminGetStats ¶
func AdminGetStats(c *models.ReqContext) Response
func AdminUpdateUserPassword ¶
func AdminUpdateUserPassword(c *models.ReqContext, form dtos.AdminUpdateUserPasswordForm) Response
func AdminUpdateUserPermissions ¶
func AdminUpdateUserPermissions(c *models.ReqContext, form dtos.AdminUpdateUserPermissionsForm) Response
PUT /api/admin/users/:id/permissions
func AlertTest ¶
func AlertTest(c *models.ReqContext, dto dtos.AlertTestCommand) Response
POST /api/alerts/test
func CalculateDashboardDiff ¶
func CalculateDashboardDiff(c *models.ReqContext, apiOptions dtos.CalculateDiffOptions) Response
POST /api/dashboards/calculate-diff performs diffs on two dashboards
func ChangeUserPassword ¶
func ChangeUserPassword(c *models.ReqContext, cmd models.ChangeUserPasswordCommand) Response
func ClearHelpFlags ¶
func ClearHelpFlags(c *models.ReqContext) Response
func CreateAlertNotification ¶
func CreateAlertNotification(c *models.ReqContext, cmd models.CreateAlertNotificationCommand) Response
func CreateOrg ¶
func CreateOrg(c *models.ReqContext, cmd models.CreateOrgCommand) Response
POST /api/orgs
func CreatePlaylist ¶
func CreatePlaylist(c *models.ReqContext, cmd models.CreatePlaylistCommand) Response
func DeleteAPIKey ¶
func DeleteAPIKey(c *models.ReqContext) Response
func DeleteAlertNotification ¶
func DeleteAlertNotification(c *models.ReqContext) Response
func DeleteAlertNotificationByUID ¶
func DeleteAlertNotificationByUID(c *models.ReqContext) Response
func DeleteAnnotationByID ¶
func DeleteAnnotationByID(c *models.ReqContext) Response
func DeleteAnnotations ¶
func DeleteAnnotations(c *models.ReqContext, cmd dtos.DeleteAnnotationsCmd) Response
func DeleteDashboardBySlug ¶
func DeleteDashboardBySlug(c *models.ReqContext) Response
func DeleteDashboardByUID ¶
func DeleteDashboardByUID(c *models.ReqContext) Response
func DeleteDashboardSnapshot ¶
func DeleteDashboardSnapshot(c *models.ReqContext) Response
DELETE /api/snapshots/:key
func DeleteDashboardSnapshotByDeleteKey ¶
func DeleteDashboardSnapshotByDeleteKey(c *models.ReqContext) Response
GET /api/snapshots-delete/:deleteKey
func DeleteDataSourceById ¶
func DeleteDataSourceById(c *models.ReqContext) Response
func DeleteDataSourceByName ¶
func DeleteDataSourceByName(c *models.ReqContext) Response
func DeleteFolder ¶
func DeleteFolder(c *models.ReqContext) Response
func DeletePlaylist ¶
func DeletePlaylist(c *models.ReqContext) Response
func GenerateError ¶
func GenerateError(c *models.ReqContext) Response
GenerateError generates a index out of range error
func GenerateSQLTestData ¶
func GenerateSQLTestData(c *models.ReqContext) Response
GET /api/tsdb/testdata/gensql
func GetAPIKeys ¶
func GetAPIKeys(c *models.ReqContext) Response
func GetAlertNotificationByID ¶
func GetAlertNotificationByID(c *models.ReqContext) Response
func GetAlertNotificationByUID ¶
func GetAlertNotificationByUID(c *models.ReqContext) Response
func GetAlertNotificationLookup ¶
func GetAlertNotificationLookup(c *models.ReqContext) Response
func GetAlertNotifications ¶
func GetAlertNotifications(c *models.ReqContext) Response
func GetAlertNotifiers ¶
func GetAlertNotifiers(c *models.ReqContext) Response
func GetAlertStatesForDashboard ¶
func GetAlertStatesForDashboard(c *models.ReqContext) Response
func GetAnnotations ¶
func GetAnnotations(c *models.ReqContext) Response
func GetDashboardPermissionList ¶
func GetDashboardPermissionList(c *models.ReqContext) Response
func GetDashboardVersion ¶
func GetDashboardVersion(c *models.ReqContext) Response
GetDashboardVersion returns the dashboard version with the given ID.
func GetDashboardVersions ¶
func GetDashboardVersions(c *models.ReqContext) Response
GetDashboardVersions returns all dashboard versions as JSON
func GetDataSourceById ¶
func GetDataSourceById(c *models.ReqContext) Response
func GetDataSourceByName ¶
func GetDataSourceByName(c *models.ReqContext) Response
Get /api/datasources/name/:name
func GetDataSourceIdByName ¶
func GetDataSourceIdByName(c *models.ReqContext) Response
Get /api/datasources/id/:name
func GetDataSources ¶
func GetDataSources(c *models.ReqContext) Response
func GetFolderByID ¶
func GetFolderByID(c *models.ReqContext) Response
func GetFolderByUID ¶
func GetFolderByUID(c *models.ReqContext) Response
func GetFolderPermissionList ¶
func GetFolderPermissionList(c *models.ReqContext) Response
func GetFolders ¶
func GetFolders(c *models.ReqContext) Response
func GetInviteInfoByCode ¶
func GetInviteInfoByCode(c *models.ReqContext) Response
GetInviteInfoByCode gets a pending user invite corresponding to a certain code. A response containing an InviteInfo object is returned if the invite is found. If a (pending) invite is not found, 404 is returned.
func GetOrgPreferences ¶
func GetOrgPreferences(c *models.ReqContext) Response
GET /api/org/preferences
func GetOrgQuotas ¶
func GetOrgQuotas(c *models.ReqContext) Response
func GetOrgUsersForCurrentOrg ¶
func GetOrgUsersForCurrentOrg(c *models.ReqContext) Response
GET /api/org/users
func GetOrgUsersForCurrentOrgLookup ¶
func GetOrgUsersForCurrentOrgLookup(c *models.ReqContext) Response
GET /api/org/users/lookup
func GetPendingOrgInvites ¶
func GetPendingOrgInvites(c *models.ReqContext) Response
func GetPlaylist ¶
func GetPlaylist(c *models.ReqContext) Response
func GetPlaylistDashboards ¶
func GetPlaylistDashboards(c *models.ReqContext) Response
func GetPlaylistItems ¶
func GetPlaylistItems(c *models.ReqContext) Response
func GetPluginDashboards ¶
func GetPluginDashboards(c *models.ReqContext) Response
func GetPluginMarkdown ¶
func GetPluginMarkdown(c *models.ReqContext) Response
func GetPluginSettingByID ¶
func GetPluginSettingByID(c *models.ReqContext) Response
func GetSignUpOptions ¶
func GetSignUpOptions(c *models.ReqContext) Response
GET /api/user/signup/options
func GetSignedInUser ¶
func GetSignedInUser(c *models.ReqContext) Response
GET /api/user (current authenticated user)
func GetSignedInUserOrgList ¶
func GetSignedInUserOrgList(c *models.ReqContext) Response
GET /api/user/orgs
func GetSignedInUserTeamList ¶
func GetSignedInUserTeamList(c *models.ReqContext) Response
GET /api/user/teams
func GetTestDataRandomWalk ¶
func GetTestDataRandomWalk(c *models.ReqContext) Response
GET /api/tsdb/testdata/random-walk
func GetTestDataScenarios ¶
func GetTestDataScenarios(c *models.ReqContext) Response
GET /api/tsdb/testdata/scenarios
func GetUserByLoginOrEmail ¶
func GetUserByLoginOrEmail(c *models.ReqContext) Response
GET /api/users/lookup
func GetUserPreferences ¶
func GetUserPreferences(c *models.ReqContext) Response
GET /api/user/preferences
func GetUserQuotas ¶
func GetUserQuotas(c *models.ReqContext) Response
func ImportDashboard ¶
func ImportDashboard(c *models.ReqContext, apiCmd dtos.ImportDashboardCommand) Response
func NotificationTest ¶
func NotificationTest(c *models.ReqContext, dto dtos.NotificationTestCommand) Response
POST /api/alert-notifications/test
func PatchAnnotation ¶
func PatchAnnotation(c *models.ReqContext, cmd dtos.PatchAnnotationsCmd) Response
func PauseAlert ¶
func PauseAlert(c *models.ReqContext, dto dtos.PauseAlertCommand) Response
POST /api/alerts/:alertId/pause
func PauseAllAlerts ¶
func PauseAllAlerts(c *models.ReqContext, dto dtos.PauseAllAlertsCommand) Response
POST /api/admin/pause-all-alerts
func PostAnnotation ¶
func PostAnnotation(c *models.ReqContext, cmd dtos.PostAnnotationsCmd) Response
func PostGraphiteAnnotation ¶
func PostGraphiteAnnotation(c *models.ReqContext, cmd dtos.PostGraphiteAnnotationsCmd) Response
func RemoveOrgUser ¶
func RemoveOrgUser(c *models.ReqContext) Response
DELETE /api/orgs/:orgId/users/:userId
func RemoveOrgUserForCurrentOrg ¶
func RemoveOrgUserForCurrentOrg(c *models.ReqContext) Response
DELETE /api/org/users/:userId
func ResetPassword ¶
func ResetPassword(c *models.ReqContext, form dtos.ResetUserPasswordForm) Response
func RevokeInvite ¶
func RevokeInvite(c *models.ReqContext) Response
func Search ¶
func Search(c *models.ReqContext) Response
func SearchDashboardSnapshots ¶
func SearchDashboardSnapshots(c *models.ReqContext) Response
GET /api/dashboard/snapshots
func SearchOrgs ¶
func SearchOrgs(c *models.ReqContext) Response
func SearchPlaylists ¶
func SearchPlaylists(c *models.ReqContext) Response
func SearchUsersWithPaging ¶
func SearchUsersWithPaging(c *models.ReqContext) Response
GET /api/users/search
func SendResetPasswordEmail ¶
func SendResetPasswordEmail(c *models.ReqContext, form dtos.SendResetPasswordEmailForm) Response
func SetHelpFlag ¶
func SetHelpFlag(c *models.ReqContext) Response
func SetHomeDashboard ¶
func SetHomeDashboard(c *models.ReqContext, cmd models.SavePreferencesCommand) Response
POST /api/preferences/set-home-dash
func SignUp ¶
func SignUp(c *models.ReqContext, form dtos.SignUpForm) Response
POST /api/user/signup
func StarDashboard ¶
func StarDashboard(c *models.ReqContext) Response
func UnstarDashboard ¶
func UnstarDashboard(c *models.ReqContext) Response
func UpdateAlertNotification ¶
func UpdateAlertNotification(c *models.ReqContext, cmd models.UpdateAlertNotificationCommand) Response
func UpdateAlertNotificationByUID ¶
func UpdateAlertNotificationByUID(c *models.ReqContext, cmd models.UpdateAlertNotificationWithUidCommand) Response
func UpdateAnnotation ¶
func UpdateAnnotation(c *models.ReqContext, cmd dtos.UpdateAnnotationsCmd) Response
func UpdateDashboardPermissions ¶
func UpdateDashboardPermissions(c *models.ReqContext, apiCmd dtos.UpdateDashboardAclCommand) Response
func UpdateDataSource ¶
func UpdateDataSource(c *models.ReqContext, cmd models.UpdateDataSourceCommand) Response
func UpdateFolder ¶
func UpdateFolder(c *models.ReqContext, cmd models.UpdateFolderCommand) Response
func UpdateFolderPermissions ¶
func UpdateFolderPermissions(c *models.ReqContext, apiCmd dtos.UpdateDashboardAclCommand) Response
func UpdateOrg ¶
func UpdateOrg(c *models.ReqContext, form dtos.UpdateOrgForm) Response
PUT /api/orgs/:orgId
func UpdateOrgAddress ¶
func UpdateOrgAddress(c *models.ReqContext, form dtos.UpdateOrgAddressForm) Response
PUT /api/orgs/:orgId/address
func UpdateOrgAddressCurrent ¶
func UpdateOrgAddressCurrent(c *models.ReqContext, form dtos.UpdateOrgAddressForm) Response
PUT /api/org/address
func UpdateOrgCurrent ¶
func UpdateOrgCurrent(c *models.ReqContext, form dtos.UpdateOrgForm) Response
PUT /api/org
func UpdateOrgPreferences ¶
func UpdateOrgPreferences(c *models.ReqContext, dtoCmd dtos.UpdatePrefsCmd) Response
PUT /api/org/preferences
func UpdateOrgQuota ¶
func UpdateOrgQuota(c *models.ReqContext, cmd models.UpdateOrgQuotaCmd) Response
func UpdateOrgUser ¶
func UpdateOrgUser(c *models.ReqContext, cmd models.UpdateOrgUserCommand) Response
PATCH /api/orgs/:orgId/users/:userId
func UpdateOrgUserForCurrentOrg ¶
func UpdateOrgUserForCurrentOrg(c *models.ReqContext, cmd models.UpdateOrgUserCommand) Response
PATCH /api/org/users/:userId
func UpdatePlaylist ¶
func UpdatePlaylist(c *models.ReqContext, cmd models.UpdatePlaylistCommand) Response
func UpdatePluginSetting ¶
func UpdatePluginSetting(c *models.ReqContext, cmd models.UpdatePluginSettingCmd) Response
func UpdateSignedInUser ¶
func UpdateSignedInUser(c *models.ReqContext, cmd models.UpdateUserCommand) Response
POST /api/user
func UpdateUser ¶
func UpdateUser(c *models.ReqContext, cmd models.UpdateUserCommand) Response
POST /api/users/:id
func UpdateUserActiveOrg ¶
func UpdateUserActiveOrg(c *models.ReqContext) Response
POST /api/users/:id/using/:orgId
func UpdateUserPreferences ¶
func UpdateUserPreferences(c *models.ReqContext, dtoCmd dtos.UpdatePrefsCmd) Response
PUT /api/user/preferences
func UpdateUserQuota ¶
func UpdateUserQuota(c *models.ReqContext, cmd models.UpdateUserQuotaCmd) Response
Source Files
¶
- admin.go
- admin_provisioning.go
- admin_users.go
- alerting.go
- annotations.go
- api.go
- apikey.go
- app_routes.go
- basic_auth.go
- common.go
- dashboard.go
- dashboard_permission.go
- dashboard_snapshot.go
- dataproxy.go
- datasources.go
- folder.go
- folder_permission.go
- frontendsettings.go
- grafana_com_proxy.go
- http_server.go
- index.go
- ldap_debug.go
- login.go
- login_oauth.go
- metrics.go
- org.go
- org_invite.go
- org_users.go
- password.go
- playlist.go
- playlist_play.go
- plugins.go
- preferences.go
- quota.go
- render.go
- search.go
- signup.go
- stars.go
- team.go
- team_members.go
- user.go
- user_token.go