api

package
v0.0.0-...-900be4e Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2024 License: Apache-2.0 Imports: 84 Imported by: 0

Documentation

Overview

Package api contains API logic.

Index

Constants

This section is empty.

Variables

View Source
var ErrPluginNotFound error = errors.New("plugin not found, no installed plugin with that id")

ErrPluginNotFound is returned when an requested plugin is not installed.

View Source
var (
	OauthStateCookieName = "oauth_state"
)

Functions

func AddOrgInvite

func AddOrgInvite(c *models.ReqContext, inviteDto dtos.AddInviteForm) response.Response

func AddOrgUser

POST /api/orgs/:orgId/users

func AddOrgUserToCurrentOrg

func AddOrgUserToCurrentOrg(c *models.ReqContext, cmd models.AddOrgUserCommand) response.Response

POST /api/org/users

func AdminDeleteUser

func AdminDeleteUser(c *models.ReqContext) response.Response

func AdminEnableUser

func AdminEnableUser(c *models.ReqContext) response.Response

POST /api/admin/users/:id/enable

func AdminGetSettings

func AdminGetSettings(c *models.ReqContext) response.Response

func AdminGetStats

func AdminGetStats(c *models.ReqContext) response.Response

func AdminUpdateUserPermissions

func AdminUpdateUserPermissions(c *models.ReqContext, form dtos.AdminUpdateUserPermissionsForm) response.Response

PUT /api/admin/users/:id/permissions

func AlertTest

POST /api/alerts/test

func AppPluginRoute

func AppPluginRoute(route *plugins.AppPluginRoute, appID string, hs *HTTPServer) macaron.Handler

func BasicAuthenticatedRequest

func BasicAuthenticatedRequest(req macaron.Request, expectedUser, expectedPass string) bool

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 CalculateDashboardDiff

func CalculateDashboardDiff(c *models.ReqContext, apiOptions dtos.CalculateDiffOptions) response.Response

POST /api/dashboards/calculate-diff performs diffs on two dashboards

func ClearHelpFlags

func ClearHelpFlags(c *models.ReqContext) response.Response

func CreateDashboardSnapshot

func CreateDashboardSnapshot(c *models.ReqContext, cmd models.CreateDashboardSnapshotCommand)

POST /api/snapshots

func CreateOrg

POST /api/orgs

func DeleteAPIKey

func DeleteAPIKey(c *models.ReqContext) response.Response

func DeleteAlertNotification

func DeleteAlertNotification(c *models.ReqContext) response.Response

func DeleteAlertNotificationByUID

func DeleteAlertNotificationByUID(c *models.ReqContext) response.Response

func DeleteAnnotationByID

func DeleteAnnotationByID(c *models.ReqContext) response.Response

func DeleteDashboardSnapshot

func DeleteDashboardSnapshot(c *models.ReqContext) response.Response

DELETE /api/snapshots/:key

func DeleteDashboardSnapshotByDeleteKey

func DeleteDashboardSnapshotByDeleteKey(c *models.ReqContext) response.Response

GET /api/snapshots-delete/:deleteKey

func DeleteDataSourceById

func DeleteDataSourceById(c *models.ReqContext) response.Response

func DeleteDataSourceByName

func DeleteDataSourceByName(c *models.ReqContext) response.Response

func DeleteDataSourceByUID

func DeleteDataSourceByUID(c *models.ReqContext) response.Response

DELETE /api/datasources/uid/:uid

func DeleteOrgByID

func DeleteOrgByID(c *models.ReqContext) response.Response

GET /api/orgs/:orgId

func DeletePlaylist

func DeletePlaylist(c *models.ReqContext) response.Response

func GenStateString

func GenStateString() (string, error)

func GenerateSQLTestData

func GenerateSQLTestData(c *models.ReqContext) response.Response

GET /api/tsdb/testdata/gensql

func GetAPIKeys

func GetAPIKeys(c *models.ReqContext) response.Response

func GetAlert

func GetAlert(c *models.ReqContext) response.Response

GET /api/alerts/:id

func GetAlertNotificationByID

func GetAlertNotificationByID(c *models.ReqContext) response.Response

func GetAlertNotificationByUID

func GetAlertNotificationByUID(c *models.ReqContext) response.Response

func GetAlertNotificationLookup

func GetAlertNotificationLookup(c *models.ReqContext) response.Response

func GetAlertNotifications

func GetAlertNotifications(c *models.ReqContext) response.Response

func GetAlertNotifiers

func GetAlertNotifiers(c *models.ReqContext) response.Response

func GetAlertStatesForDashboard

func GetAlertStatesForDashboard(c *models.ReqContext) response.Response

func GetAlerts

func GetAlerts(c *models.ReqContext) response.Response

GET /api/alerts

func GetAnnotations

func GetAnnotations(c *models.ReqContext) response.Response

func GetAuthProviderLabel

func GetAuthProviderLabel(authModule string) string

func GetDashboardSnapshot

func GetDashboardSnapshot(c *models.ReqContext) response.Response

GET /api/snapshots/:key

func GetDashboardTags

func GetDashboardTags(c *models.ReqContext)

func GetDashboardVersion

func GetDashboardVersion(c *models.ReqContext) response.Response

GetDashboardVersion returns the dashboard version with the given ID.

func GetDashboardVersions

func GetDashboardVersions(c *models.ReqContext) response.Response

GetDashboardVersions returns all dashboard versions as JSON

func GetDataSourceById

func GetDataSourceById(c *models.ReqContext) response.Response

func GetDataSourceByName

func GetDataSourceByName(c *models.ReqContext) response.Response

Get /api/datasources/name/:name

func GetDataSourceByUID

func GetDataSourceByUID(c *models.ReqContext) response.Response

GET /api/datasources/uid/:uid

func GetDataSourceIdByName

func GetDataSourceIdByName(c *models.ReqContext) response.Response

Get /api/datasources/id/:name

func GetFolderByID

func GetFolderByID(c *models.ReqContext) response.Response

func GetFolderByUID

func GetFolderByUID(c *models.ReqContext) response.Response

func GetFolders

func GetFolders(c *models.ReqContext) response.Response

func GetInviteInfoByCode

func GetInviteInfoByCode(c *models.ReqContext) response.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 GetOrgByID

func GetOrgByID(c *models.ReqContext) response.Response

GET /api/orgs/:orgId

func GetOrgCurrent

func GetOrgCurrent(c *models.ReqContext) response.Response

GET /api/org

func GetOrgPreferences

func GetOrgPreferences(c *models.ReqContext) response.Response

GET /api/org/preferences

func GetOrgQuotas

func GetOrgQuotas(c *models.ReqContext) response.Response

func GetPendingOrgInvites

func GetPendingOrgInvites(c *models.ReqContext) response.Response

func GetPlaylist

func GetPlaylist(c *models.ReqContext) response.Response

func GetPlaylistDashboards

func GetPlaylistDashboards(c *models.ReqContext) response.Response

func GetPlaylistItems

func GetPlaylistItems(c *models.ReqContext) response.Response

func GetPluginDashboards

func GetPluginDashboards(c *models.ReqContext) response.Response

func GetPluginMarkdown

func GetPluginMarkdown(c *models.ReqContext) response.Response

func GetPluginSettingByID

func GetPluginSettingByID(c *models.ReqContext) response.Response

func GetSharingOptions

func GetSharingOptions(c *models.ReqContext)

func GetSignUpOptions

func GetSignUpOptions(c *models.ReqContext) response.Response

GET /api/user/signup/options

func GetSignedInUser

func GetSignedInUser(c *models.ReqContext) response.Response

GET /api/user (current authenticated user)

func GetSignedInUserOrgList

func GetSignedInUserOrgList(c *models.ReqContext) response.Response

GET /api/user/orgs

func GetSignedInUserTeamList

func GetSignedInUserTeamList(c *models.ReqContext) response.Response

GET /api/user/teams

func GetTestDataRandomWalk

func GetTestDataRandomWalk(c *models.ReqContext) response.Response

GET /api/tsdb/testdata/random-walk

func GetUserByID

func GetUserByID(c *models.ReqContext) response.Response

GET /api/users/:id

func GetUserByLoginOrEmail

func GetUserByLoginOrEmail(c *models.ReqContext) response.Response

GET /api/users/lookup

func GetUserOrgList

func GetUserOrgList(c *models.ReqContext) response.Response

GET /api/users/:id/orgs

func GetUserPreferences

func GetUserPreferences(c *models.ReqContext) response.Response

GET /api/user/preferences

func GetUserQuotas

func GetUserQuotas(c *models.ReqContext) response.Response

func GetUserTeams

func GetUserTeams(c *models.ReqContext) response.Response

GET /api/users/:id/teams

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 NewFrontendLogMessageHandler

func NewFrontendLogMessageHandler(store *frontendlogging.SourceMapStore) frontendLogMessageHandler

func NotificationTest

POST /api/alert-notifications/test

func PauseAlert

POST /api/alerts/:alertId/pause

func PauseAllAlerts

POST /api/admin/pause-all-alerts

func ProxyGnetRequest

func ProxyGnetRequest(c *models.ReqContext)

func RemoveOrgUser

func RemoveOrgUser(c *models.ReqContext) response.Response

DELETE /api/orgs/:orgId/users/:userId

func RemoveOrgUserForCurrentOrg

func RemoveOrgUserForCurrentOrg(c *models.ReqContext) response.Response

DELETE /api/org/users/:userId

func ReverseProxyGnetReq

func ReverseProxyGnetReq(proxyPath string) *httputil.ReverseProxy

func RevokeInvite

func RevokeInvite(c *models.ReqContext) response.Response

func SearchDashboardSnapshots

func SearchDashboardSnapshots(c *models.ReqContext) response.Response

GET /api/dashboard/snapshots

func SearchOrgs

func SearchOrgs(c *models.ReqContext) response.Response

func SearchPlaylists

func SearchPlaylists(c *models.ReqContext) response.Response

func SearchUsers

func SearchUsers(c *models.ReqContext) response.Response

GET /api/users

func SearchUsersWithPaging

func SearchUsersWithPaging(c *models.ReqContext) response.Response

GET /api/users/search

func SetHelpFlag

func SetHelpFlag(c *models.ReqContext) response.Response

func SetHomeDashboard

POST /api/preferences/set-home-dash

func SignUp

POST /api/user/signup

func StarDashboard

func StarDashboard(c *models.ReqContext) response.Response

func UnstarDashboard

func UnstarDashboard(c *models.ReqContext) response.Response

func UpdateOrg

PUT /api/orgs/:orgId

func UpdateOrgAddress

func UpdateOrgAddress(c *models.ReqContext, form dtos.UpdateOrgAddressForm) response.Response

PUT /api/orgs/:orgId/address

func UpdateOrgAddressCurrent

func UpdateOrgAddressCurrent(c *models.ReqContext, form dtos.UpdateOrgAddressForm) response.Response

PUT /api/org/address

func UpdateOrgCurrent

func UpdateOrgCurrent(c *models.ReqContext, form dtos.UpdateOrgForm) response.Response

PUT /api/org

func UpdateOrgPreferences

func UpdateOrgPreferences(c *models.ReqContext, dtoCmd dtos.UpdatePrefsCmd) response.Response

PUT /api/org/preferences

func UpdateOrgUser

PATCH /api/orgs/:orgId/users/:userId

func UpdateOrgUserForCurrentOrg

func UpdateOrgUserForCurrentOrg(c *models.ReqContext, cmd models.UpdateOrgUserCommand) response.Response

PATCH /api/org/users/:userId

func UpdateSignedInUser

func UpdateSignedInUser(c *models.ReqContext, cmd models.UpdateUserCommand) response.Response

POST /api/user

func UpdateUser

POST /api/users/:id

func UpdateUserActiveOrg

func UpdateUserActiveOrg(c *models.ReqContext) response.Response

POST /api/users/:id/using/:orgId

func UpdateUserPreferences

func UpdateUserPreferences(c *models.ReqContext, dtoCmd dtos.UpdatePrefsCmd) response.Response

PUT /api/user/preferences

func UserSetUsingOrg

func UserSetUsingOrg(c *models.ReqContext) response.Response

POST /api/user/using/:id

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 CreateExternalSnapshotResponse

type CreateExternalSnapshotResponse struct {
	Key       string `json:"key"`
	DeleteKey string `json:"deleteKey"`
	Url       string `json:"url"`
	DeleteUrl string `json:"deleteUrl"`
}

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:""`
	PluginRequestValidator models.PluginRequestValidator      `inject:""`
	PluginManager          *plugins.PluginManager             `inject:""`
	SearchService          *search.SearchService              `inject:""`
	ShortURLService        *shorturls.ShortURLService         `inject:""`
	Live                   *live.GrafargLive                  `inject:""`
	ContextHandler         *contexthandler.ContextHandler     `inject:""`
	SQLStore               *sqlstore.SQLStore                 `inject:""`
	LibraryPanelService    *librarypanels.LibraryPanelService `inject:""`
	Listener               net.Listener
	// contains filtered or unexported fields
}

func (*HTTPServer) AddAPIKey

func (*HTTPServer) AddMiddleware

func (hs *HTTPServer) AddMiddleware(middleware macaron.Handler)

func (*HTTPServer) AddTeamMember

POST /api/teams/:teamId/members

func (*HTTPServer) AdminDisableUser

func (hs *HTTPServer) AdminDisableUser(c *models.ReqContext) response.Response

POST /api/admin/users/:id/disable

func (*HTTPServer) AdminGetUserAuthTokens

func (hs *HTTPServer) AdminGetUserAuthTokens(c *models.ReqContext) response.Response

GET /api/admin/users/:id/auth-tokens

func (*HTTPServer) AdminLogoutUser

func (hs *HTTPServer) AdminLogoutUser(c *models.ReqContext) response.Response

POST /api/admin/users/:id/logout

func (*HTTPServer) AdminProvisioningReloadDashboards

func (hs *HTTPServer) AdminProvisioningReloadDashboards(c *models.ReqContext) response.Response

func (*HTTPServer) AdminProvisioningReloadDatasources

func (hs *HTTPServer) AdminProvisioningReloadDatasources(c *models.ReqContext) response.Response

func (*HTTPServer) AdminProvisioningReloadNotifications

func (hs *HTTPServer) AdminProvisioningReloadNotifications(c *models.ReqContext) response.Response

func (*HTTPServer) AdminProvisioningReloadPlugins

func (hs *HTTPServer) AdminProvisioningReloadPlugins(c *models.ReqContext) response.Response

func (*HTTPServer) AdminRevokeUserAuthToken

func (hs *HTTPServer) AdminRevokeUserAuthToken(c *models.ReqContext, cmd models.RevokeAuthTokenCmd) response.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.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.Response

CheckHealth returns the health of a plugin. /api/plugins/:pluginId/health

func (*HTTPServer) CollectPluginMetrics

func (hs *HTTPServer) CollectPluginMetrics(c *models.ReqContext) response.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.Response

func (*HTTPServer) CookieOptionsFromCfg

func (hs *HTTPServer) CookieOptionsFromCfg() cookies.CookieOptions

func (*HTTPServer) CreateFolder

func (*HTTPServer) CreateTeam

POST /api/teams

func (*HTTPServer) DeleteDashboardBySlug

func (hs *HTTPServer) DeleteDashboardBySlug(c *models.ReqContext) response.Response

func (*HTTPServer) DeleteDashboardByUID

func (hs *HTTPServer) DeleteDashboardByUID(c *models.ReqContext) response.Response

func (*HTTPServer) DeleteFolder

func (hs *HTTPServer) DeleteFolder(c *models.ReqContext) response.Response

func (*HTTPServer) DeleteTeamByID

func (hs *HTTPServer) DeleteTeamByID(c *models.ReqContext) response.Response

DELETE /api/teams/:teamId

func (*HTTPServer) GetDashboard

func (hs *HTTPServer) GetDashboard(c *models.ReqContext) response.Response

func (*HTTPServer) GetDashboardPermissionList

func (hs *HTTPServer) GetDashboardPermissionList(c *models.ReqContext) response.Response

func (*HTTPServer) GetDataSources

func (hs *HTTPServer) GetDataSources(c *models.ReqContext) response.Response

func (*HTTPServer) GetFolderPermissionList

func (hs *HTTPServer) GetFolderPermissionList(c *models.ReqContext) response.Response

func (*HTTPServer) GetFrontendSettings

func (hs *HTTPServer) GetFrontendSettings(c *models.ReqContext)

func (*HTTPServer) GetHomeDashboard

func (hs *HTTPServer) GetHomeDashboard(c *models.ReqContext) response.Response

GetHomeDashboard returns the home dashboard.

func (*HTTPServer) GetLDAPStatus

func (hs *HTTPServer) GetLDAPStatus(c *models.ReqContext) response.Response

GetLDAPStatus attempts to connect to all the configured LDAP servers and returns information on whenever they're available or not.

func (*HTTPServer) GetOrgByName

func (hs *HTTPServer) GetOrgByName(c *models.ReqContext) response.Response

Get /api/orgs/name/:name

func (*HTTPServer) GetOrgUsers

func (hs *HTTPServer) GetOrgUsers(c *models.ReqContext) response.Response

GET /api/orgs/:orgId/users

func (*HTTPServer) GetOrgUsersForCurrentOrg

func (hs *HTTPServer) GetOrgUsersForCurrentOrg(c *models.ReqContext) response.Response

GET /api/org/users

func (*HTTPServer) GetOrgUsersForCurrentOrgLookup

func (hs *HTTPServer) GetOrgUsersForCurrentOrgLookup(c *models.ReqContext) response.Response

GET /api/org/users/lookup

func (*HTTPServer) GetPluginErrorsList

func (hs *HTTPServer) GetPluginErrorsList(c *models.ReqContext) response.Response

func (*HTTPServer) GetPluginList

func (hs *HTTPServer) GetPluginList(c *models.ReqContext) response.Response

func (*HTTPServer) GetTeamByID

func (hs *HTTPServer) GetTeamByID(c *models.ReqContext) response.Response

GET /api/teams/:teamId

func (*HTTPServer) GetTeamMembers

func (hs *HTTPServer) GetTeamMembers(c *models.ReqContext) response.Response

GET /api/teams/:teamId/members

func (*HTTPServer) GetTeamPreferences

func (hs *HTTPServer) GetTeamPreferences(c *models.ReqContext) response.Response

GET /api/teams/:teamId/preferences

func (*HTTPServer) GetUserAuthTokens

func (hs *HTTPServer) GetUserAuthTokens(c *models.ReqContext) response.Response

GET /api/user/auth-tokens

func (*HTTPServer) GetUserFromLDAP

func (hs *HTTPServer) GetUserFromLDAP(c *models.ReqContext) response.Response

GetUserFromLDAP finds an user based on a username in LDAP. This helps illustrate how would the particular user be mapped in Grafarg 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.Response

func (*HTTPServer) LoginAPIPing

func (hs *HTTPServer) LoginAPIPing(c *models.ReqContext) response.Response

func (*HTTPServer) LoginPost

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 (*HTTPServer) PostFrontendMetrics

func (*HTTPServer) PostSyncUserWithLDAP

func (hs *HTTPServer) PostSyncUserWithLDAP(c *models.ReqContext) response.Response

PostSyncUserWithLDAP enables a single Grafarg 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.Response

QueryMetrics returns query metrics POST /api/tsdb/query

func (*HTTPServer) QueryMetricsV2

func (hs *HTTPServer) QueryMetricsV2(c *models.ReqContext, reqDTO dtos.MetricRequest) response.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{}) *response.RedirectResponse

func (*HTTPServer) ReloadLDAPCfg

func (hs *HTTPServer) ReloadLDAPCfg() response.Response

ReloadLDAPCfg reloads the LDAP configuration

func (*HTTPServer) RemoveTeamMember

func (hs *HTTPServer) RemoveTeamMember(c *models.ReqContext) response.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.Response

RestoreDashboardVersion restores a dashboard to the given version.

func (*HTTPServer) RevokeUserAuthToken

func (hs *HTTPServer) RevokeUserAuthToken(c *models.ReqContext, cmd models.RevokeAuthTokenCmd) response.Response

POST /api/user/revoke-auth-token

func (*HTTPServer) Run

func (hs *HTTPServer) Run(ctx context.Context) error

func (*HTTPServer) SearchTeams

func (hs *HTTPServer) SearchTeams(c *models.ReqContext) response.Response

GET /api/teams/search

func (*HTTPServer) SignUpStep2

func (hs *HTTPServer) SignUpStep2(c *models.ReqContext, form dtos.SignUpStep2Form) response.Response

func (*HTTPServer) UpdateDashboardPermissions

func (hs *HTTPServer) UpdateDashboardPermissions(c *models.ReqContext, apiCmd dtos.UpdateDashboardAclCommand) response.Response

func (*HTTPServer) UpdateFolderPermissions

func (hs *HTTPServer) UpdateFolderPermissions(c *models.ReqContext, apiCmd dtos.UpdateDashboardAclCommand) response.Response

func (*HTTPServer) UpdateTeam

PUT /api/teams/:teamId

func (*HTTPServer) UpdateTeamMember

PUT /:teamId/members/:userId

func (*HTTPServer) UpdateTeamPreferences

func (hs *HTTPServer) UpdateTeamPreferences(c *models.ReqContext, dtoCmd dtos.UpdatePrefsCmd) response.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"`
	IsGrafargAdmin *bool                    `json:"isGrafargAdmin"`
	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 LoginError struct {
	HttpStatus    int
	PublicMessage string
	Err           error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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