pull/10616/head
Jade McGough 2017-03-22 11:29:38 -07:00
parent b1c45e1dbc
commit 47c6308482
2 changed files with 3 additions and 39 deletions

View File

@ -2,9 +2,11 @@ package influx
import (
"encoding/json"
"context"
"github.com/influxdata/chronograf"
)
// this stuff should probably live elsewhere?
func (c *Client) AllDB(ctx context.Context) ([]chronograf.Database, error) {
databases, err := c.showDatabases(ctx)
if err != nil {

View File

@ -2,10 +2,6 @@ package server
import (
"net/http"
"context"
"encoding/json"
"github.com/influxdata/chronograf"
)
type dbLinks struct {
@ -25,38 +21,6 @@ type dbsResponse struct {
Databases []dbResponse `json:"databases"`
}
// type influxResponse struct {
// Results interface{} `json:"results"` // results from influx
// }
// func (h *Service) sourcesSeries(ctx context.Context, w http.ResponseWriter, r *http.Request) (int, chronograf.TimeSeries, error) {
// srcID, err := paramID("id", r)
// if err != nil {
// Error(w, http.StatusUnprocessableEntity, err.Error(), h.Logger)
// return 0, nil, err
// }
//
// src, err := h.SourcesStore.Get(ctx, srcID)
// if err != nil {
// notFound(w, srcID, h.Logger)
// return 0, nil, err
// }
//
// ts, err := h.TimeSeries(src)
// if err != nil {
// msg := fmt.Sprintf("Unable to connect to source %d: %v", srcID, err)
// Error(w, http.StatusBadRequest, msg, h.Logger)
// return 0, nil, err
// }
//
// if err = ts.Connect(ctx, &src); err != nil {
// msg := fmt.Sprintf("Unable to connect to source %d: %v", srcID, err)
// Error(w, http.StatusBadRequest, msg, h.Logger)
// return 0, nil, err
// }
// return srcID, ts, nil
// }
// Databases queries the list of all databases for a source
func (h *Service) Databases(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
@ -76,8 +40,6 @@ func (h *Service) Databases(w http.ResponseWriter, r *http.Request) {
}
// res = append(res, database{Name: response})
res := dbsResponse{
Databases: dbs,
}