Update Source to have a username and password in spec
parent
8fb95fac23
commit
5762359f24
|
@ -33,12 +33,18 @@ func sampleSource() *models.Source {
|
||||||
Self: "/chronograf/v1/sources/1",
|
Self: "/chronograf/v1/sources/1",
|
||||||
Proxy: "/chronograf/v1/sources/1/proxy",
|
Proxy: "/chronograf/v1/sources/1/proxy",
|
||||||
},
|
},
|
||||||
Name: &name,
|
Name: &name,
|
||||||
Type: &influxType,
|
Type: &influxType,
|
||||||
|
Username: "HOWDY!",
|
||||||
|
Password: "changeme",
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (m *Handler) NewSource(ctx context.Context, params op.PostSourcesParams) middleware.Responder {
|
||||||
|
return op.NewPostSourcesCreated()
|
||||||
|
}
|
||||||
|
|
||||||
func (m *Handler) Sources(ctx context.Context, params op.GetSourcesParams) middleware.Responder {
|
func (m *Handler) Sources(ctx context.Context, params op.GetSourcesParams) middleware.Responder {
|
||||||
res := &models.Sources{
|
res := &models.Sources{
|
||||||
Sources: []*models.Source{
|
Sources: []*models.Source{
|
||||||
|
|
|
@ -15,6 +15,7 @@ import (
|
||||||
swagger:model Exploration
|
swagger:model Exploration
|
||||||
*/
|
*/
|
||||||
type Exploration struct {
|
type Exploration struct {
|
||||||
|
|
||||||
/* created at
|
/* created at
|
||||||
*/
|
*/
|
||||||
CreatedAt strfmt.DateTime `json:"created_at,omitempty"`
|
CreatedAt strfmt.DateTime `json:"created_at,omitempty"`
|
||||||
|
|
|
@ -35,11 +35,19 @@ type Source struct {
|
||||||
*/
|
*/
|
||||||
Name *string `json:"name"`
|
Name *string `json:"name"`
|
||||||
|
|
||||||
|
/* Password in cleartext!
|
||||||
|
*/
|
||||||
|
Password string `json:"password,omitempty"`
|
||||||
|
|
||||||
/* Format of the data source
|
/* Format of the data source
|
||||||
|
|
||||||
Required: true
|
Required: true
|
||||||
*/
|
*/
|
||||||
Type *string `json:"type"`
|
Type *string `json:"type"`
|
||||||
|
|
||||||
|
/* Username for authentication to data source
|
||||||
|
*/
|
||||||
|
Username string `json:"username,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Validate validates this source
|
// Validate validates this source
|
||||||
|
|
|
@ -139,9 +139,7 @@ func configureAPI(api *operations.MrFusionAPI) http.Handler {
|
||||||
api.PostDashboardsHandler = operations.PostDashboardsHandlerFunc(func(ctx context.Context, params operations.PostDashboardsParams) middleware.Responder {
|
api.PostDashboardsHandler = operations.PostDashboardsHandlerFunc(func(ctx context.Context, params operations.PostDashboardsParams) middleware.Responder {
|
||||||
return middleware.NotImplemented("operation .PostDashboards has not yet been implemented")
|
return middleware.NotImplemented("operation .PostDashboards has not yet been implemented")
|
||||||
})
|
})
|
||||||
api.PostSourcesHandler = operations.PostSourcesHandlerFunc(func(ctx context.Context, params operations.PostSourcesParams) middleware.Responder {
|
api.PostSourcesHandler = operations.PostSourcesHandlerFunc(mockHandler.NewSource)
|
||||||
return middleware.NotImplemented("operation .PostSources has not yet been implemented")
|
|
||||||
})
|
|
||||||
|
|
||||||
if len(influxFlags.Server) > 0 {
|
if len(influxFlags.Server) > 0 {
|
||||||
c, err := influx.NewClient(influxFlags.Server)
|
c, err := influx.NewClient(influxFlags.Server)
|
||||||
|
|
|
@ -754,6 +754,12 @@ definitions:
|
||||||
enum:
|
enum:
|
||||||
- influx
|
- influx
|
||||||
- influx-enterprise
|
- influx-enterprise
|
||||||
|
username:
|
||||||
|
type: string
|
||||||
|
description: Username for authentication to data source
|
||||||
|
password:
|
||||||
|
type: string
|
||||||
|
description: Password in cleartext!
|
||||||
links:
|
links:
|
||||||
type: object
|
type: object
|
||||||
properties:
|
properties:
|
||||||
|
|
Loading…
Reference in New Issue