add metaURL to source

pull/10616/head
Jade McGough 2017-02-07 15:57:51 -08:00 committed by Chris Goller
parent 621fc03975
commit a7742fb9c1
6 changed files with 52 additions and 42 deletions

View File

@ -18,6 +18,7 @@ func MarshalSource(s chronograf.Source) ([]byte, error) {
Username: s.Username,
Password: s.Password,
URL: s.URL,
MetaURL: s.MetaURL,
InsecureSkipVerify: s.InsecureSkipVerify,
Default: s.Default,
Telegraf: s.Telegraf,
@ -37,6 +38,7 @@ func UnmarshalSource(data []byte, s *chronograf.Source) error {
s.Username = pb.Username
s.Password = pb.Password
s.URL = pb.URL
s.MetaURL = pb.MetaURL
s.InsecureSkipVerify = pb.InsecureSkipVerify
s.Default = pb.Default
s.Telegraf = pb.Telegraf

View File

@ -47,6 +47,7 @@ type Source struct {
Default bool `protobuf:"varint,7,opt,name=Default,proto3" json:"Default,omitempty"`
Telegraf string `protobuf:"bytes,8,opt,name=Telegraf,proto3" json:"Telegraf,omitempty"`
InsecureSkipVerify bool `protobuf:"varint,9,opt,name=InsecureSkipVerify,proto3" json:"InsecureSkipVerify,omitempty"`
MetaURL string `protobuf:"bytes,10,opt,name=MetaURL,proto3" json:"MetaURL,omitempty"`
}
func (m *Source) Reset() { *m = Source{} }
@ -223,46 +224,47 @@ func init() {
func init() { proto.RegisterFile("internal.proto", fileDescriptorInternal) }
var fileDescriptorInternal = []byte{
// 652 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xbc, 0x94, 0x51, 0x6e, 0xd3, 0x4c,
0x10, 0xc7, 0xb5, 0xb1, 0x9d, 0xc4, 0xd3, 0x7e, 0xfd, 0x3e, 0xad, 0xaa, 0x8f, 0x15, 0x4f, 0x91,
0x05, 0x52, 0x90, 0xa0, 0x0f, 0xf4, 0x04, 0x6d, 0x8d, 0x50, 0xa0, 0x94, 0xb2, 0x69, 0xe1, 0x09,
0xa4, 0x6d, 0x3a, 0x69, 0x2c, 0x36, 0x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x7d, 0x03, 0xc9, 0x8f, 0xf8, 0xd0, 0xc9, 0xde, 0x8b,
0x0f, 0x09, 0xcb, 0x33, 0x27, 0x72, 0x4f, 0x9e, 0x91, 0x6a, 0xcf, 0x75, 0x56, 0xe5, 0x87, 0xb5,
0x95, 0x37, 0x94, 0x2d, 0xe6, 0xff, 0x42, 0xff, 0xed, 0x02, 0xb5, 0xdb, 0x39, 0x94, 0x0e, 0xd1,
0x11, 0x1c, 0xd3, 0x54, 0x6e, 0x4b, 0x0b, 0xf8, 0x43, 0x08, 0x24, 0x6d, 0x61, 0x56, 0xbd, 0x25,
0x90, 0x49, 0x4b, 0x5b, 0x8d, 0xf6, 0xdd, 0x33, 0x62, 0xb9, 0xc8, 0x73, 0xd4, 0xee, 0x76, 0x2d,
0x30, 0xdc, 0xd9, 0x1a, 0xb5, 0x19, 0xd9, 0x93, 0x16, 0x44, 0xef, 0x20, 0x3c, 0x48, 0x51, 0x97,
0xb2, 0x4a, 0xf1, 0x97, 0x13, 0xe3, 0xe0, 0xbf, 0x98, 0xbe, 0x3a, 0x6d, 0x2e, 0x9e, 0xe2, 0xcd,
0x9d, 0x7a, 0x9d, 0x3b, 0xa5, 0x85, 0x5e, 0xaa, 0x5c, 0x4d, 0x62, 0x63, 0xac, 0x27, 0x1d, 0x8a,
0x1e, 0x83, 0x4f, 0xff, 0x87, 0x0e, 0xb3, 0x6f, 0x98, 0x77, 0x21, 0x78, 0xb6, 0x54, 0x49, 0xea,
0xa8, 0x2d, 0xb8, 0xec, 0x9b, 0xef, 0xf2, 0xfe, 0xcf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xbd, 0x59,
0x67, 0x12, 0xa9, 0x05, 0x00, 0x00,
}

View File

@ -11,6 +11,7 @@ message Source {
bool Default = 7; // Flags an source as the default.
string Telegraf = 8; // Telegraf is the db telegraf is written to. By default it is "telegraf"
bool InsecureSkipVerify = 9; // InsecureSkipVerify accepts any certificate from the influx server
string MetaURL = 10; // MetaURL is the connection URL for the meta node.
}
message Dashboard {

View File

@ -16,6 +16,7 @@ func TestMarshalSource(t *testing.T) {
Username: "docbrown",
Password: "1 point twenty-one g1g@w@tts",
URL: "http://twin-pines.mall.io:8086",
MetaURL: "http://twin-pines.meta.io:8086",
Default: true,
Telegraf: "telegraf",
}

View File

@ -83,6 +83,7 @@ type Source struct {
Username string `json:"username,omitempty"` // Username is the username to connect to the source
Password string `json:"password,omitempty"` // Password is in CLEARTEXT
URL string `json:"url"` // URL are the connections to the source
MetaURL string `json:"metaUrl,omitempty"` // MetaURL is the url for the meta node
InsecureSkipVerify bool `json:"insecureSkipVerify,omitempty"` // InsecureSkipVerify as true means any certificate presented by the source is accepted.
Default bool `json:"default"` // Default specifies the default source for the application
Telegraf string `json:"telegraf"` // Telegraf is the db telegraf is written to. By default it is "telegraf"

View File

@ -212,6 +212,9 @@ func (h *Service) UpdateSource(w http.ResponseWriter, r *http.Request) {
if req.URL != "" {
src.URL = req.URL
}
if req.MetaURL != "" {
src.MetaURL = req.MetaURL
}
if req.Type != "" {
src.Type = req.Type
}