-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathanalytics.go
More file actions
128 lines (115 loc) · 4.64 KB
/
Copy pathanalytics.go
File metadata and controls
128 lines (115 loc) · 4.64 KB
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
// Code generated by internal/cmd/gen; DO NOT EDIT.
package flashduty
import "context"
// AnalyticsService handles the "On-call/Analytics" API resource.
type AnalyticsService service
// Get account-level insight.
//
// Return aggregated incident insight metrics for the entire account.
//
// API: POST /insight/account (insightByAccount).
func (s *AnalyticsService) ByAccount(ctx context.Context, req *InsightQueryRequest) (*DimensionInsightResponse, *Response, error) {
out := new(DimensionInsightResponse)
resp, err := s.client.do(ctx, "/insight/account", req, out)
if err != nil {
return nil, resp, err
}
return out, resp, nil
}
// Get channel insight.
//
// Return insight metrics aggregated by channel.
//
// API: POST /insight/channel (insightByChannel).
func (s *AnalyticsService) ByChannel(ctx context.Context, req *InsightQueryRequest) (*DimensionInsightResponse, *Response, error) {
out := new(DimensionInsightResponse)
resp, err := s.client.do(ctx, "/insight/channel", req, out)
if err != nil {
return nil, resp, err
}
return out, resp, nil
}
// Get responder insight.
//
// Return insight metrics aggregated by responder.
//
// API: POST /insight/responder (insightByResponder).
func (s *AnalyticsService) ByResponder(ctx context.Context, req *InsightQueryRequest) (*ResponderInsightResponse, *Response, error) {
out := new(ResponderInsightResponse)
resp, err := s.client.do(ctx, "/insight/responder", req, out)
if err != nil {
return nil, resp, err
}
return out, resp, nil
}
// Get team insight.
//
// Return insight metrics aggregated by team.
//
// API: POST /insight/team (insightByTeam).
func (s *AnalyticsService) ByTeam(ctx context.Context, req *InsightQueryRequest) (*DimensionInsightResponse, *Response, error) {
out := new(DimensionInsightResponse)
resp, err := s.client.do(ctx, "/insight/team", req, out)
if err != nil {
return nil, resp, err
}
return out, resp, nil
}
// Export channel insight.
//
// Export channel insight metrics as a CSV file. The response is a CSV stream delivered with `Content-Disposition: attachment` — it is not a JSON envelope.
//
// API: POST /insight/channel/export (insightChannelExport).
func (s *AnalyticsService) ChannelExport(ctx context.Context, req *InsightQueryRequest) (*Response, error) {
return s.client.do(ctx, "/insight/channel/export", req, nil)
}
// Export insight incidents.
//
// Export the filtered incident analytics list as a CSV file. The response is a CSV stream delivered with `Content-Disposition: attachment` — it is not a JSON envelope.
//
// API: POST /insight/incident/export (insightIncidentExport).
func (s *AnalyticsService) IncidentExport(ctx context.Context, req *InsightIncidentExportRequest) (*Response, error) {
return s.client.do(ctx, "/insight/incident/export", req, nil)
}
// List insight incidents.
//
// Return a paged list of incidents with per-incident handling metrics used by the analytics dashboard.
//
// API: POST /insight/incident/list (insightIncidentList).
func (s *AnalyticsService) IncidentList(ctx context.Context, req *InsightIncidentListRequest) (*InsightIncidentListResponse, *Response, error) {
out := new(InsightIncidentListResponse)
resp, err := s.client.do(ctx, "/insight/incident/list", req, out)
if err != nil {
return nil, resp, err
}
return out, resp, nil
}
// Export responder insight.
//
// Export responder insight metrics as a CSV file. The response is a CSV stream delivered with `Content-Disposition: attachment` — it is not a JSON envelope.
//
// API: POST /insight/responder/export (insightResponderExport).
func (s *AnalyticsService) ResponderExport(ctx context.Context, req *InsightQueryRequest) (*Response, error) {
return s.client.do(ctx, "/insight/responder/export", req, nil)
}
// Export team insight.
//
// Export team insight metrics as a CSV file. The response is a CSV stream delivered with `Content-Disposition: attachment` — it is not a JSON envelope.
//
// API: POST /insight/team/export (insightTeamExport).
func (s *AnalyticsService) TeamExport(ctx context.Context, req *InsightQueryRequest) (*Response, error) {
return s.client.do(ctx, "/insight/team/export", req, nil)
}
// Get top-K alerts grouped by check or resource.
//
// Return the top-K alert groups aggregated either by `check` or by `resource` label over the specified time range.
//
// API: POST /insight/alert/topk-by-label (insightTopkAlertsByLabel).
func (s *AnalyticsService) TopkAlertsByLabel(ctx context.Context, req *InsightTopkAlertByLabelRequest) (*InsightAlertByLabelResponse, *Response, error) {
out := new(InsightAlertByLabelResponse)
resp, err := s.client.do(ctx, "/insight/alert/topk-by-label", req, out)
if err != nil {
return nil, resp, err
}
return out, resp, nil
}