forked from grafana/grafana
-
Notifications
You must be signed in to change notification settings - Fork 1
/
types.go
77 lines (72 loc) · 2.21 KB
/
types.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
package azuremonitor
import (
"net/url"
"time"
)
// AzureMonitorQuery is the query for all the services as they have similar queries
// with a url, a querystring and an alias field
type AzureMonitorQuery struct {
URL string
UrlComponents map[string]string
Target string
Params url.Values
RefID string
Alias string
}
// AzureMonitorResponse is the json response from the Azure Monitor API
type AzureMonitorResponse struct {
Cost int `json:"cost"`
Timespan string `json:"timespan"`
Interval string `json:"interval"`
Value []struct {
ID string `json:"id"`
Type string `json:"type"`
Name struct {
Value string `json:"value"`
LocalizedValue string `json:"localizedValue"`
} `json:"name"`
Unit string `json:"unit"`
Timeseries []struct {
Metadatavalues []struct {
Name struct {
Value string `json:"value"`
LocalizedValue string `json:"localizedValue"`
} `json:"name"`
Value string `json:"value"`
} `json:"metadatavalues"`
Data []struct {
TimeStamp time.Time `json:"timeStamp"`
Average float64 `json:"average,omitempty"`
Total float64 `json:"total,omitempty"`
Count float64 `json:"count,omitempty"`
Maximum float64 `json:"maximum,omitempty"`
Minimum float64 `json:"minimum,omitempty"`
} `json:"data"`
} `json:"timeseries"`
} `json:"value"`
Namespace string `json:"namespace"`
Resourceregion string `json:"resourceregion"`
}
// ApplicationInsightsResponse is the json response from the Application Insights API
type ApplicationInsightsResponse struct {
Tables []struct {
TableName string `json:"TableName"`
Columns []struct {
ColumnName string `json:"ColumnName"`
DataType string `json:"DataType"`
ColumnType string `json:"ColumnType"`
} `json:"Columns"`
Rows [][]interface{} `json:"Rows"`
} `json:"Tables"`
}
// AzureLogAnalyticsResponse is the json response object from the Azure Log Analytics API.
type AzureLogAnalyticsResponse struct {
Tables []struct {
Name string `json:"name"`
Columns []struct {
Name string `json:"name"`
Type string `json:"type"`
} `json:"columns"`
Rows [][]interface{} `json:"rows"`
} `json:"tables"`
}