File tree 3 files changed +33
-0
lines changed
3 files changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -25,3 +25,4 @@ _testmain.go
25
25
26
26
# vim swap files
27
27
. * .sw ?
28
+ .idea
Original file line number Diff line number Diff line change @@ -37,6 +37,9 @@ type JSONData struct {
37
37
CustomMetricsNamespaces string `json:"customMetricsNamespaces,omitempty"`
38
38
DefaultRegion string `json:"defaultRegion,omitempty"`
39
39
TlsSkipVerify bool `json:"tlsSkipVerify,omitempty"`
40
+ HttpMethod string `json:"httpMethod,omitempty"`
41
+ QueryTimeout string `json:"queryTimeout,omitempty"`
42
+ TimeInterval string `json:"timeInterval,omitempty"`
40
43
}
41
44
42
45
// 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) {
73
73
t .Error ("datasource creation response should return the created datasource ID" )
74
74
}
75
75
}
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