Documentation ¶
Index ¶
- func CountPublicDashboardRequest() func(c *contextmodel.ReqContext)
- func RequiresExistingAccessToken(publicDashboardService publicdashboards.Service) func(c *contextmodel.ReqContext)
- func SetPublicDashboardAccessToken(c *contextmodel.ReqContext)
- func SetPublicDashboardOrgIdOnContext(publicDashboardService publicdashboards.Service) func(c *contextmodel.ReqContext)
- type Api
- func (api *Api) CreatePublicDashboard(c *contextmodel.ReqContext) response.Response
- func (api *Api) DeletePublicDashboard(c *contextmodel.ReqContext) response.Response
- func (api *Api) GetPublicAnnotations(c *contextmodel.ReqContext) response.Response
- func (api *Api) GetPublicDashboard(c *contextmodel.ReqContext) response.Response
- func (api *Api) ListPublicDashboards(c *contextmodel.ReqContext) response.Response
- func (api *Api) QueryPublicDashboard(c *contextmodel.ReqContext) response.Response
- func (api *Api) RegisterAPIEndpoints()
- func (api *Api) UpdatePublicDashboard(c *contextmodel.ReqContext) response.Response
- func (api *Api) ViewPublicDashboard(c *contextmodel.ReqContext) response.Response
- type CreatePublicDashboardParams
- type CreatePublicDashboardResponse
- type DeletePublicDashboardParams
- type GetPublicAnnotationsParams
- type GetPublicAnnotationsResponse
- type GetPublicDashboardParams
- type GetPublicDashboardResponse
- type ListPublicDashboardsResponse
- type Middleware
- type QueryPublicDashboardParams
- type QueryPublicDashboardResponse
- type UpdatePublicDashboardParams
- type UpdatePublicDashboardResponse
- type ViewPublicDashboardParams
- type ViewPublicDashboardResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CountPublicDashboardRequest ¶
func CountPublicDashboardRequest() func(c *contextmodel.ReqContext)
func RequiresExistingAccessToken ¶
func RequiresExistingAccessToken(publicDashboardService publicdashboards.Service) func(c *contextmodel.ReqContext)
RequiresExistingAccessToken Middleware to enforce that a public dashboards exists before continuing to handler. This method will query the database to ensure that it exists. Use when we want to enforce a public dashboard is valid on an endpoint we do not maintain
func SetPublicDashboardAccessToken ¶
func SetPublicDashboardAccessToken(c *contextmodel.ReqContext)
SetPublicDashboardAccessToken Adds public dashboard flag on context
func SetPublicDashboardOrgIdOnContext ¶
func SetPublicDashboardOrgIdOnContext(publicDashboardService publicdashboards.Service) func(c *contextmodel.ReqContext)
SetPublicDashboardOrgIdOnContext Adds orgId to context based on org of public dashboard
Types ¶
type Api ¶
type Api struct { PublicDashboardService publicdashboards.Service Middleware publicdashboards.Middleware // contains filtered or unexported fields }
func ProvideApi ¶
func ProvideApi( pd publicdashboards.Service, rr routing.RouteRegister, ac accesscontrol.AccessControl, features featuremgmt.FeatureToggles, md publicdashboards.Middleware, cfg *setting.Cfg, license licensing.Licensing, ) *Api
func (*Api) CreatePublicDashboard ¶
func (api *Api) CreatePublicDashboard(c *contextmodel.ReqContext) response.Response
swagger:route POST /dashboards/uid/{dashboardUid}/public-dashboards dashboard_public createPublicDashboard
Create public dashboard for a dashboard
Produces: - application/json
Responses: 200: createPublicDashboardResponse 400: badRequestPublicError 401: unauthorisedPublicError 403: forbiddenPublicError 500: internalServerPublicError
func (*Api) DeletePublicDashboard ¶
func (api *Api) DeletePublicDashboard(c *contextmodel.ReqContext) response.Response
swagger:route DELETE /dashboards/uid/{dashboardUid}/public-dashboards/{uid} dashboard_public deletePublicDashboard
Delete public dashboard for a dashboard
Responses: 200: okResponse 400: badRequestPublicError 401: unauthorisedPublicError 403: forbiddenPublicError 500: internalServerPublicError
func (*Api) GetPublicAnnotations ¶
func (api *Api) GetPublicAnnotations(c *contextmodel.ReqContext) response.Response
swagger:route GET /public/dashboards/{accessToken}/annotations dashboard_public getPublicAnnotations
Get annotations for a public dashboard
Responses: 200: getPublicAnnotationsResponse 400: badRequestPublicError 404: notFoundPublicError 401: unauthorisedPublicError 403: forbiddenPublicError 500: internalServerPublicError
func (*Api) GetPublicDashboard ¶
func (api *Api) GetPublicDashboard(c *contextmodel.ReqContext) response.Response
swagger:route GET /dashboards/uid/{dashboardUid}/public-dashboards dashboard_public getPublicDashboard
Get public dashboard by dashboardUid
Responses: 200: getPublicDashboardResponse 400: badRequestPublicError 401: unauthorisedPublicError 403: forbiddenPublicError 404: notFoundPublicError 500: internalServerPublicError
func (*Api) ListPublicDashboards ¶
func (api *Api) ListPublicDashboards(c *contextmodel.ReqContext) response.Response
swagger:route GET /dashboards/public-dashboards dashboard_public listPublicDashboards
Get list of public dashboards
Responses: 200: listPublicDashboardsResponse 401: unauthorisedPublicError 403: forbiddenPublicError 500: internalServerPublicError
func (*Api) QueryPublicDashboard ¶
func (api *Api) QueryPublicDashboard(c *contextmodel.ReqContext) response.Response
swagger:route POST /public/dashboards/{accessToken}/panels/{panelId}/query dashboard_public queryPublicDashboard
Get results for a given panel on a public dashboard
Responses: 200: queryPublicDashboardResponse 400: badRequestPublicError 401: unauthorisedPublicError 404: panelNotFoundPublicError 404: notFoundPublicError 403: forbiddenPublicError 500: internalServerPublicError
func (*Api) RegisterAPIEndpoints ¶
func (api *Api) RegisterAPIEndpoints()
RegisterAPIEndpoints Registers Endpoints on Grafana Router
func (*Api) UpdatePublicDashboard ¶
func (api *Api) UpdatePublicDashboard(c *contextmodel.ReqContext) response.Response
swagger:route PATCH /dashboards/uid/{dashboardUid}/public-dashboards/{uid} dashboard_public updatePublicDashboard
Update public dashboard for a dashboard
Produces: - application/json
Responses: 200: updatePublicDashboardResponse 400: badRequestPublicError 401: unauthorisedPublicError 403: forbiddenPublicError 500: internalServerPublicError
func (*Api) ViewPublicDashboard ¶
func (api *Api) ViewPublicDashboard(c *contextmodel.ReqContext) response.Response
swagger:route GET /public/dashboards/{accessToken} dashboard_public viewPublicDashboard
Get public dashboard for view
Responses: 200: viewPublicDashboardResponse 400: badRequestPublicError 401: unauthorisedPublicError 403: forbiddenPublicError 404: notFoundPublicError 500: internalServerPublicError
type CreatePublicDashboardParams ¶
type CreatePublicDashboardParams struct { // in:path // required:true DashboardUid string `json:"dashboardUid"` // in:body // required:true Body PublicDashboardDTO }
swagger:parameters createPublicDashboard
type CreatePublicDashboardResponse ¶
type CreatePublicDashboardResponse struct {
// in: body
Body PublicDashboard `json:"body"`
}
swagger:response createPublicDashboardResponse
type DeletePublicDashboardParams ¶
type DeletePublicDashboardParams struct { // in:path // required:true DashboardUid string `json:"dashboardUid"` // in:path // required:true Uid string `json:"uid"` }
swagger:parameters deletePublicDashboard
type GetPublicAnnotationsParams ¶
type GetPublicAnnotationsParams struct { // in: path AccessToken string `json:"accessToken"` }
swagger:parameters getPublicAnnotations
type GetPublicAnnotationsResponse ¶
type GetPublicAnnotationsResponse struct {
// in: body
Body []AnnotationEvent `json:"body"`
}
swagger:response getPublicAnnotationsResponse
type GetPublicDashboardParams ¶
type GetPublicDashboardParams struct { // in:path DashboardUid string `json:"dashboardUid"` }
swagger:parameters getPublicDashboard
type GetPublicDashboardResponse ¶
type GetPublicDashboardResponse struct {
// in: body
Body PublicDashboard `json:"body"`
}
swagger:response getPublicDashboardResponse
type ListPublicDashboardsResponse ¶
type ListPublicDashboardsResponse struct {
// in: body
Body PublicDashboardListResponseWithPagination `json:"body"`
}
swagger:response listPublicDashboardsResponse
type Middleware ¶
type Middleware struct { }
Empty middleware created in order to bind the enterprise one
func ProvideMiddleware ¶
func ProvideMiddleware() *Middleware
func (*Middleware) HandleAccessView ¶
func (m *Middleware) HandleAccessView(c *contextmodel.ReqContext)
func (*Middleware) HandleApi ¶
func (m *Middleware) HandleApi(c *contextmodel.ReqContext)
func (*Middleware) HandleConfirmAccessView ¶
func (m *Middleware) HandleConfirmAccessView(c *contextmodel.ReqContext)
func (*Middleware) HandleView ¶
func (m *Middleware) HandleView(c *contextmodel.ReqContext)
type QueryPublicDashboardParams ¶
type QueryPublicDashboardParams struct { // in: path AccessToken string `json:"accessToken"` // in: path PanelId int64 `json:"panelId"` }
swagger:parameters queryPublicDashboard
type QueryPublicDashboardResponse ¶
type QueryPublicDashboardResponse struct { // in: body Body backend.QueryDataResponse `json:"body"` }
swagger:response queryPublicDashboardResponse
type UpdatePublicDashboardParams ¶
type UpdatePublicDashboardParams struct { // in:path // required:true DashboardUid string `json:"dashboardUid"` // in:path // required:true Uid string `json:"uid"` // in:body // required:true Body PublicDashboardDTO }
swagger:parameters updatePublicDashboard
type UpdatePublicDashboardResponse ¶
type UpdatePublicDashboardResponse struct {
// in: body
Body PublicDashboard `json:"body"`
}
swagger:response updatePublicDashboardResponse
type ViewPublicDashboardParams ¶
type ViewPublicDashboardParams struct { // in: path AccessToken string `json:"accessToken"` }
swagger:parameters viewPublicDashboard
type ViewPublicDashboardResponse ¶
type ViewPublicDashboardResponse struct { // in: body Body dtos.DashboardFullWithMeta `json:"body"` }
swagger:response viewPublicDashboardResponse