-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathalerts.go
More file actions
138 lines (125 loc) · 4.66 KB
/
Copy pathalerts.go
File metadata and controls
138 lines (125 loc) · 4.66 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
129
130
131
132
133
134
135
136
137
138
// Code generated by internal/cmd/gen; DO NOT EDIT.
package flashduty
import "context"
// AlertsService handles the "On-call/Alerts" API resource.
type AlertsService service
// List raw alert events.
//
// Return a cursor-paginated list of raw alert events across all alerts, with filtering by integration, channel, time range, and severity.
//
// API: POST /alert-event/list (alert-event-read-list).
func (s *AlertsService) EventReadList(ctx context.Context, req *AlertEventGlobalListRequest) (*AlertEventGlobalListResponse, *Response, error) {
out := new(AlertEventGlobalListResponse)
resp, err := s.client.do(ctx, "/alert-event/list", req, out)
if err != nil {
return nil, resp, err
}
return out, resp, nil
}
// List events for an alert.
//
// Return raw events for an alert with cursor or page-number pagination.
//
// API: POST /alert/event/list (alert-read-event-list).
func (s *AlertsService) ReadEventList(ctx context.Context, req *AlertEventListRequest) (*AlertEventListResponse, *Response, error) {
out := new(AlertEventListResponse)
resp, err := s.client.do(ctx, "/alert/event/list", req, out)
if err != nil {
return nil, resp, err
}
return out, resp, nil
}
// List alert activity feed.
//
// Return the activity feed (comments, state changes, merges, silence events) for a single alert, with page-based pagination.
//
// API: POST /alert/feed (alert-read-feed).
func (s *AlertsService) ReadFeed(ctx context.Context, req *AlertFeedRequest) (*AlertFeedResponse, *Response, error) {
out := new(AlertFeedResponse)
resp, err := s.client.do(ctx, "/alert/feed", req, out)
if err != nil {
return nil, resp, err
}
return out, resp, nil
}
// Get alert detail.
//
// Return the full details of a single alert by its ID, including its associated incident and event count.
//
// API: POST /alert/info (alert-read-info).
func (s *AlertsService) ReadInfo(ctx context.Context, req *AlertInfoRequest) (*AlertItem, *Response, error) {
out := new(AlertItem)
resp, err := s.client.do(ctx, "/alert/info", req, out)
if err != nil {
return nil, resp, err
}
return out, resp, nil
}
// List alerts.
//
// Return a cursor-paginated list of alerts matching the given filters.
//
// API: POST /alert/list (alert-read-list).
func (s *AlertsService) ReadList(ctx context.Context, req *AlertListRequest) (*AlertListResponse, *Response, error) {
out := new(AlertListResponse)
resp, err := s.client.do(ctx, "/alert/list", req, out)
if err != nil {
return nil, resp, err
}
return out, resp, nil
}
// List alerts by IDs.
//
// Return the details of multiple alerts by their IDs in a single request.
//
// API: POST /alert/list-by-ids (alert-read-list-by-ids).
func (s *AlertsService) ReadListByIDs(ctx context.Context, req *AlertListByIDsRequest) (*AlertListResponse, *Response, error) {
out := new(AlertListResponse)
resp, err := s.client.do(ctx, "/alert/list-by-ids", req, out)
if err != nil {
return nil, resp, err
}
return out, resp, nil
}
// Get alert pipeline.
//
// Return the alert processing pipeline configured for a specific integration.
//
// API: POST /alert/pipeline/info (alert-read-pipeline-info).
func (s *AlertsService) ReadPipelineInfo(ctx context.Context, req *AlertPipelineInfoRequest) (*AlertPipelineItem, *Response, error) {
out := new(AlertPipelineItem)
resp, err := s.client.do(ctx, "/alert/pipeline/info", req, out)
if err != nil {
return nil, resp, err
}
return out, resp, nil
}
// List alert pipelines.
//
// Return the alert processing pipelines configured for multiple integrations.
//
// API: POST /alert/pipeline/list (alert-read-pipeline-list).
func (s *AlertsService) ReadPipelineList(ctx context.Context, req *AlertPipelineListRequest) (*AlertPipelineListResponse, *Response, error) {
out := new(AlertPipelineListResponse)
resp, err := s.client.do(ctx, "/alert/pipeline/list", req, out)
if err != nil {
return nil, resp, err
}
return out, resp, nil
}
// Merge alerts into an incident.
//
// Associate one or more alerts with an existing incident. If a source alert previously belonged to a different incident and that incident becomes empty after the merge, it will be automatically closed.
//
// API: POST /alert/merge (alert-write-merge).
func (s *AlertsService) WriteMerge(ctx context.Context, req *AlertMergeRequest) (*Response, error) {
return s.client.do(ctx, "/alert/merge", req, nil)
}
// Create or update alert pipeline.
//
// Set the alert processing pipeline for an integration. Replaces the existing configuration entirely.
//
// API: POST /alert/pipeline/upsert (alert-write-pipeline-upsert).
func (s *AlertsService) WritePipelineUpsert(ctx context.Context, req *AlertPipelineUpsertRequest) (*Response, error) {
return s.client.do(ctx, "/alert/pipeline/upsert", req, nil)
}