Update Database to be DB

pull/96/head
Chris Goller 2016-09-21 15:11:29 -07:00
parent 113fa01323
commit 2b17378e76
7 changed files with 14 additions and 14 deletions

View File

@ -16,9 +16,9 @@ type InfluxProxy struct {
func (h *InfluxProxy) Proxy(ctx context.Context, params op.PostSourcesIDProxyParams) middleware.Responder {
// TODO: Add support for multiple TimeSeries with lookup based on params.ID
query := mrfusion.Query{
Command: *params.Query.Query,
Database: params.Query.Database,
RP: params.Query.Rp,
Command: *params.Query.Query,
DB: params.Query.DB,
RP: params.Query.Rp,
}
response, err := h.TimeSeries.Query(ctx, query)

View File

@ -34,7 +34,7 @@ func NewClient(host string) (*Client, error) {
// include both the database and retention policy. In-flight requests can be
// cancelled using the provided context.
func (c *Client) Query(ctx context.Context, query mrfusion.Query) (mrfusion.Response, error) {
q := ixClient.NewQuery(query.Command, query.Database, query.RP)
q := ixClient.NewQuery(query.Command, query.DB, query.RP)
resps := make(chan (response))
go func() {
resp, err := c.ix.Query(q)

View File

@ -58,9 +58,9 @@ func (m *Handler) SourcesID(ctx context.Context, params op.GetSourcesIDParams) m
func (m *Handler) Proxy(ctx context.Context, params op.PostSourcesIDProxyParams) middleware.Responder {
query := mrfusion.Query{
Command: *params.Query.Query,
Database: params.Query.Database,
RP: params.Query.Rp,
Command: *params.Query.Query,
DB: params.Query.DB,
RP: params.Query.Rp,
}
response, err := m.TimeSeries.Query(ctx, mrfusion.Query(query))
if err != nil {

View File

@ -19,9 +19,9 @@ swagger:model Proxy
*/
type Proxy struct {
/* database
/* db
*/
Database string `json:"database,omitempty"`
Db string `json:"db,omitempty"`
/* format
*/

File diff suppressed because one or more lines are too long

View File

@ -788,7 +788,7 @@ definitions:
properties:
query:
type: string
database:
db:
type: string
rp:
type: string

View File

@ -4,9 +4,9 @@ import "golang.org/x/net/context"
// Query retrieves a Response from a TimeSeries.
type Query struct {
Command string // Command is the query itself
Database string // Database is optional and if empty will not be used.
RP string // RP is a retention policy and optional; if empty will not be used.
Command string // Command is the query itself
DB string // DB is optional and if empty will not be used.
RP string // RP is a retention policy and optional; if empty will not be used.
}
// Response is the result of a query against a TimeSeries