This repository was archived by the owner on Mar 17, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +33
-0
lines changed Expand file tree Collapse file tree 3 files changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -25,3 +25,4 @@ _testmain.go
2525
2626# vim swap files
2727. * .sw ?
28+ .idea
Original file line number Diff line number Diff line change @@ -37,6 +37,9 @@ type JSONData struct {
3737 CustomMetricsNamespaces string `json:"customMetricsNamespaces,omitempty"`
3838 DefaultRegion string `json:"defaultRegion,omitempty"`
3939 TlsSkipVerify bool `json:"tlsSkipVerify,omitempty"`
40+ HttpMethod string `json:"httpMethod,omitempty"`
41+ QueryTimeout string `json:"queryTimeout,omitempty"`
42+ TimeInterval string `json:"timeInterval,omitempty"`
4043}
4144
4245// SecureJSONData is a representation of the datasource `secureJsonData` property
Original file line number Diff line number Diff line change @@ -73,3 +73,32 @@ func TestNewDataSource(t *testing.T) {
7373 t .Error ("datasource creation response should return the created datasource ID" )
7474 }
7575}
76+
77+ func TestNewPrometheusDataSource (t * testing.T ) {
78+ server , client := gapiTestTools (200 , createdDataSourceJSON )
79+ defer server .Close ()
80+
81+ ds := & DataSource {
82+ Name : "foo_prometheus" ,
83+ Type : "prometheus" ,
84+ URL : "http://some-url.com" ,
85+ Access : "access" ,
86+ IsDefault : true ,
87+ JSONData : JSONData {
88+ HttpMethod : "POST" ,
89+ QueryTimeout : "60s" ,
90+ TimeInterval : "1m" ,
91+ },
92+ }
93+
94+ created , err := client .NewDataSource (ds )
95+ if err != nil {
96+ t .Error (err )
97+ }
98+
99+ t .Log (pretty .PrettyFormat (created ))
100+
101+ if created != 1 {
102+ t .Error ("datasource creation response should return the created datasource ID" )
103+ }
104+ }
You can’t perform that action at this time.
0 commit comments