Merge pull request #114 from influxdata/feature/namepassword
Update Source to have a username and password in specpull/10616/head
commit
7fe02063d3
|
@ -33,12 +33,18 @@ func sampleSource() *models.Source {
|
|||
Self: "/chronograf/v1/sources/1",
|
||||
Proxy: "/chronograf/v1/sources/1/proxy",
|
||||
},
|
||||
Name: &name,
|
||||
Type: &influxType,
|
||||
Name: &name,
|
||||
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 {
|
||||
res := &models.Sources{
|
||||
Sources: []*models.Source{
|
||||
|
|
|
@ -15,6 +15,7 @@ import (
|
|||
swagger:model Exploration
|
||||
*/
|
||||
type Exploration struct {
|
||||
|
||||
/* created at
|
||||
*/
|
||||
CreatedAt strfmt.DateTime `json:"created_at,omitempty"`
|
||||
|
|
|
@ -35,11 +35,19 @@ type Source struct {
|
|||
*/
|
||||
Name *string `json:"name"`
|
||||
|
||||
/* Password in cleartext!
|
||||
*/
|
||||
Password string `json:"password,omitempty"`
|
||||
|
||||
/* Format of the data source
|
||||
|
||||
Required: true
|
||||
*/
|
||||
Type *string `json:"type"`
|
||||
|
||||
/* Username for authentication to data source
|
||||
*/
|
||||
Username string `json:"username,omitempty"`
|
||||
}
|
||||
|
||||
// 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 {
|
||||
return middleware.NotImplemented("operation .PostDashboards has not yet been implemented")
|
||||
})
|
||||
api.PostSourcesHandler = operations.PostSourcesHandlerFunc(func(ctx context.Context, params operations.PostSourcesParams) middleware.Responder {
|
||||
return middleware.NotImplemented("operation .PostSources has not yet been implemented")
|
||||
})
|
||||
api.PostSourcesHandler = operations.PostSourcesHandlerFunc(mockHandler.NewSource)
|
||||
|
||||
if len(influxFlags.Server) > 0 {
|
||||
c, err := influx.NewClient(influxFlags.Server)
|
||||
|
|
|
@ -754,6 +754,12 @@ definitions:
|
|||
enum:
|
||||
- influx
|
||||
- influx-enterprise
|
||||
username:
|
||||
type: string
|
||||
description: Username for authentication to data source
|
||||
password:
|
||||
type: string
|
||||
description: Password in cleartext!
|
||||
links:
|
||||
type: object
|
||||
properties:
|
||||
|
|
Loading…
Reference in New Issue