add routes and stubs for dashboard API endpoints

pull/691/head
Jade McGough 2016-12-07 15:18:04 -08:00
parent fa8edf94c5
commit 9a2e49b4d2
2 changed files with 36 additions and 0 deletions

28
server/dashboards.go Normal file
View File

@ -0,0 +1,28 @@
package server
import "net/http"
// Dashboards returns all dashboards within the store
func (s *Service) Dashboards(w http.ResponseWriter, r *http.Request) {
}
// DashboardID returns a single specified dashboard
func (s *Service) DashboardID(w http.ResponseWriter, r *http.Request) {
}
// NewDashboard creates and returns a new dashboard object
func (s *Service) NewDashboard(w http.ResponseWriter, r *http.Request) {
}
// RemoveDashboard deletes a dashboard
func (s *Service) RemoveDashboard(w http.ResponseWriter, r *http.Request) {
}
// UpdateDashboard updates a dashboard
func (s *Service) UpdateDashboard(w http.ResponseWriter, r *http.Request) {
}

View File

@ -109,6 +109,14 @@ func NewMux(opts MuxOpts, service Service) http.Handler {
router.PATCH("/chronograf/v1/users/:id/explorations/:eid", service.UpdateExploration)
router.DELETE("/chronograf/v1/users/:id/explorations/:eid", service.RemoveExploration)
// Dashboards
router.GET("/chronograf/v1/dashboards", service.Dashboards)
router.POST("/chronograf/v1/dashboards", service.NewDashboard)
router.GET("/chronograf/v1/dashboards/:id", service.DashboardID)
router.DELETE("/chronograf/v1/dashboard/:id", service.RemoveDashboard)
router.PUT("/chronograf/v1/dashboard/:id", service.UpdateDashboard)
/* Authentication */
if opts.UseAuth {
auth := AuthAPI(opts, router)