@daocloud-proto/insight 0.14.0-dev-e669e7d9 → 0.14.0-dev-661895cf

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,178 @@
1
+ /* eslint-disable */
2
+ // @ts-nocheck
3
+ /*
4
+ * This file is a generated Typescript file for GRPC Gateway, DO NOT MODIFY
5
+ */
6
+
7
+ import * as InsightIoApiTypeV1alpha1Page from "../../type/v1alpha1/page.pb"
8
+ import * as InsightIoApiAlertV1alpha1Type from "./type.pb"
9
+ export type ID = {
10
+ id?: string
11
+ }
12
+
13
+ export type ListGroupsRequest = {
14
+ builtin?: boolean
15
+ name?: string
16
+ clusterName?: string
17
+ namespace?: string
18
+ page?: number
19
+ pageSize?: number
20
+ sorts?: string[]
21
+ }
22
+
23
+ export type ListGroupsResponse = {
24
+ items?: GroupSummary[]
25
+ pagination?: InsightIoApiTypeV1alpha1Page.Pagination
26
+ }
27
+
28
+ export type GroupSummary = {
29
+ id?: string
30
+ name?: string
31
+ builtin?: boolean
32
+ clusterName?: string
33
+ namespace?: string
34
+ targetType?: InsightIoApiAlertV1alpha1Type.TargetType
35
+ targets?: string[]
36
+ groupRuleStatus?: groupRuleStatus[]
37
+ description?: string
38
+ createAt?: string
39
+ updateAt?: string
40
+ }
41
+
42
+ export type groupRuleStatus = {
43
+ status?: InsightIoApiAlertV1alpha1Type.RuleStatus
44
+ count?: number
45
+ }
46
+
47
+ export type CreateGroupRequest = {
48
+ name?: string
49
+ description?: string
50
+ clusterName?: string
51
+ namespace?: string
52
+ targetType?: InsightIoApiAlertV1alpha1Type.TargetType
53
+ targets?: string[]
54
+ rules?: CreateGroupRule[]
55
+ notificationTemplate?: string
56
+ receivers?: receiver[]
57
+ notifyRepeatConfig?: repeatConfig[]
58
+ }
59
+
60
+ export type repeatConfig = {
61
+ severity?: InsightIoApiAlertV1alpha1Type.Severity
62
+ interval?: number
63
+ }
64
+
65
+ export type receiver = {
66
+ type?: string
67
+ names?: string[]
68
+ }
69
+
70
+ export type Group = {
71
+ id?: string
72
+ name?: string
73
+ builtin?: boolean
74
+ clusterName?: string
75
+ namespace?: string
76
+ targetType?: InsightIoApiAlertV1alpha1Type.TargetType
77
+ targets?: string[]
78
+ description?: string
79
+ notificationTemplate?: string
80
+ receivers?: receiver[]
81
+ notifyRepeatConfig?: repeatConfig[]
82
+ createAt?: string
83
+ updateAt?: string
84
+ }
85
+
86
+ export type UpdateGroupRequest = {
87
+ id?: string
88
+ description?: string
89
+ notificationTemplate?: string
90
+ receivers?: receiver[]
91
+ notifyRepeatConfig?: repeatConfig[]
92
+ }
93
+
94
+ export type ListGroupRulesRequest = {
95
+ id?: string
96
+ name?: string
97
+ severity?: InsightIoApiAlertV1alpha1Type.Severity
98
+ status?: InsightIoApiAlertV1alpha1Type.RuleStatus
99
+ page?: number
100
+ pageSize?: number
101
+ sorts?: string[]
102
+ }
103
+
104
+ export type ListRulesV2Response = {
105
+ items?: RuleV2Summary[]
106
+ pagination?: InsightIoApiTypeV1alpha1Page.Pagination
107
+ }
108
+
109
+ export type RuleV2Summary = {
110
+ id?: string
111
+ name?: string
112
+ groupId?: string
113
+ groupName?: string
114
+ severity?: InsightIoApiAlertV1alpha1Type.Severity
115
+ source?: InsightIoApiAlertV1alpha1Type.RuleSource
116
+ expr?: string
117
+ thresholdSymbol?: string
118
+ thresholdNum?: number
119
+ status?: InsightIoApiAlertV1alpha1Type.RuleStatus
120
+ description?: string
121
+ createAt?: string
122
+ }
123
+
124
+ export type RuleV2 = {
125
+ id?: string
126
+ name?: string
127
+ groupId?: string
128
+ groupName?: string
129
+ expr?: string
130
+ thresholdSymbol?: string
131
+ thresholdNum?: number
132
+ duration?: string
133
+ severity?: InsightIoApiAlertV1alpha1Type.Severity
134
+ source?: InsightIoApiAlertV1alpha1Type.RuleSource
135
+ status?: InsightIoApiAlertV1alpha1Type.RuleStatus
136
+ promQL?: string
137
+ labels?: {[key: string]: string}
138
+ annotations?: {[key: string]: string}
139
+ description?: string
140
+ createAt?: string
141
+ updateAt?: string
142
+ }
143
+
144
+ export type AddGroupRuleRequest = {
145
+ groupId?: string
146
+ rule?: CreateGroupRule
147
+ }
148
+
149
+ export type CreateGroupRule = {
150
+ name?: string
151
+ description?: string
152
+ source?: InsightIoApiAlertV1alpha1Type.RuleSource
153
+ expr?: string
154
+ thresholdSymbol?: string
155
+ thresholdNum?: number
156
+ duration?: string
157
+ severity?: InsightIoApiAlertV1alpha1Type.Severity
158
+ labels?: {[key: string]: string}
159
+ annotations?: {[key: string]: string}
160
+ }
161
+
162
+ export type UpdateRuleV2Request = {
163
+ groupId?: string
164
+ name?: string
165
+ description?: string
166
+ expr?: string
167
+ thresholdSymbol?: string
168
+ thresholdNum?: number
169
+ duration?: string
170
+ severity?: InsightIoApiAlertV1alpha1Type.Severity
171
+ labels?: {[key: string]: string}
172
+ annotations?: {[key: string]: string}
173
+ }
174
+
175
+ export type GroupRule = {
176
+ groupId?: string
177
+ name?: string
178
+ }
@@ -0,0 +1,44 @@
1
+ /* eslint-disable */
2
+ // @ts-nocheck
3
+ /*
4
+ * This file is a generated Typescript file for GRPC Gateway, DO NOT MODIFY
5
+ */
6
+
7
+ export enum RuleSource {
8
+ RULE_SOURCE_UNSPECIFIED = "RULE_SOURCE_UNSPECIFIED",
9
+ METRIC_TPL = "METRIC_TPL",
10
+ PROMQL = "PROMQL",
11
+ LOG_TPL = "LOG_TPL",
12
+ }
13
+
14
+ export enum TargetType {
15
+ TARGET_TYPE_UNSPECIFIED = "TARGET_TYPE_UNSPECIFIED",
16
+ GLOBAL = "GLOBAL",
17
+ CLUSTER = "CLUSTER",
18
+ NAMESPACE = "NAMESPACE",
19
+ NODE = "NODE",
20
+ DEPLOYMENT = "DEPLOYMENT",
21
+ STATEFULSET = "STATEFULSET",
22
+ DAEMONSET = "DAEMONSET",
23
+ CRONJOB = "CRONJOB",
24
+ POD = "POD",
25
+ }
26
+
27
+ export enum Severity {
28
+ SEVERITY_UNSPECIFIED = "SEVERITY_UNSPECIFIED",
29
+ CRITICAL = "CRITICAL",
30
+ WARNING = "WARNING",
31
+ INFO = "INFO",
32
+ }
33
+
34
+ export enum RuleStatus {
35
+ UNSPECIFIED = "UNSPECIFIED",
36
+ FIRING = "FIRING",
37
+ ENABLED = "ENABLED",
38
+ }
39
+
40
+ export enum AlertStatus {
41
+ ALERT_STATUS_UNSPECIFIED = "ALERT_STATUS_UNSPECIFIED",
42
+ ALERT_STATUS_FIRING = "ALERT_STATUS_FIRING",
43
+ ALERT_STATUS_RESOLVED = "ALERT_STATUS_RESOLVED",
44
+ }
@@ -4,6 +4,7 @@
4
4
  * This file is a generated Typescript file for GRPC Gateway, DO NOT MODIFY
5
5
  */
6
6
 
7
+ import * as InsightIoApiAlertV1alpha1Type from "../../alert/v1alpha1/type.pb"
7
8
  import * as InsightIoApiTypeV1alpha1Page from "../../type/v1alpha1/page.pb"
8
9
 
9
10
  export enum CleanRuleType {
@@ -12,52 +13,13 @@ export enum CleanRuleType {
12
13
  Clean_Specific = "Clean_Specific",
13
14
  }
14
15
 
15
- export enum RuleSource {
16
- RULE_SOURCE_UNSPECIFIED = "RULE_SOURCE_UNSPECIFIED",
17
- METRIC_TPL = "METRIC_TPL",
18
- PROMQL = "PROMQL",
19
- LOG_TPL = "LOG_TPL",
20
- }
21
-
22
- export enum TargetType {
23
- TARGET_TYPE_UNSPECIFIED = "TARGET_TYPE_UNSPECIFIED",
24
- GLOBAL = "GLOBAL",
25
- CLUSTER = "CLUSTER",
26
- NAMESPACE = "NAMESPACE",
27
- NODE = "NODE",
28
- DEPLOYMENT = "DEPLOYMENT",
29
- STATEFULSET = "STATEFULSET",
30
- DAEMONSET = "DAEMONSET",
31
- CRONJOB = "CRONJOB",
32
- POD = "POD",
33
- }
34
-
35
- export enum Severity {
36
- SEVERITY_UNSPECIFIED = "SEVERITY_UNSPECIFIED",
37
- CRITICAL = "CRITICAL",
38
- WARNING = "WARNING",
39
- INFO = "INFO",
40
- }
41
-
42
- export enum RuleStatus {
43
- UNSPECIFIED = "UNSPECIFIED",
44
- FIRING = "FIRING",
45
- ENABLED = "ENABLED",
46
- }
47
-
48
- export enum AlertStatus {
49
- ALERT_STATUS_UNSPECIFIED = "ALERT_STATUS_UNSPECIFIED",
50
- ALERT_STATUS_FIRING = "ALERT_STATUS_FIRING",
51
- ALERT_STATUS_RESOLVED = "ALERT_STATUS_RESOLVED",
52
- }
53
-
54
16
  export type ListRulesRequest = {
55
17
  builtin?: boolean
56
18
  name?: string
57
19
  clusterName?: string
58
20
  namespace?: string
59
- severity?: Severity
60
- status?: RuleStatus
21
+ severity?: InsightIoApiAlertV1alpha1Type.Severity
22
+ status?: InsightIoApiAlertV1alpha1Type.RuleStatus
61
23
  page?: number
62
24
  pageSize?: number
63
25
  sorts?: string[]
@@ -71,17 +33,17 @@ export type ListRulesResponse = {
71
33
  export type RuleSummary = {
72
34
  ruleId?: string
73
35
  ruleName?: string
74
- severity?: Severity
36
+ severity?: InsightIoApiAlertV1alpha1Type.Severity
75
37
  clusterName?: string
76
38
  namespace?: string
77
- targetType?: TargetType
39
+ targetType?: InsightIoApiAlertV1alpha1Type.TargetType
78
40
  targetNames?: string[]
79
- source?: RuleSource
41
+ source?: InsightIoApiAlertV1alpha1Type.RuleSource
80
42
  expr?: string
81
43
  thresholdSymbol?: string
82
44
  thresholdNum?: number
83
45
  duration?: number
84
- status?: RuleStatus
46
+ status?: InsightIoApiAlertV1alpha1Type.RuleStatus
85
47
  builtin?: boolean
86
48
  createAt?: string
87
49
  }
@@ -96,15 +58,15 @@ export type Rule = {
96
58
  builtin?: boolean
97
59
  clusterName?: string
98
60
  namespace?: string
99
- source?: RuleSource
100
- targetType?: TargetType
61
+ source?: InsightIoApiAlertV1alpha1Type.RuleSource
62
+ targetType?: InsightIoApiAlertV1alpha1Type.TargetType
101
63
  targetNames?: string[]
102
64
  expr?: string
103
65
  thresholdSymbol?: string
104
66
  thresholdNum?: number
105
67
  duration?: number
106
- severity?: Severity
107
- status?: RuleStatus
68
+ severity?: InsightIoApiAlertV1alpha1Type.Severity
69
+ status?: InsightIoApiAlertV1alpha1Type.RuleStatus
108
70
  labels?: {[key: string]: string}
109
71
  description?: string
110
72
  notificationTemplate?: string
@@ -128,14 +90,14 @@ export type CreateRuleRequest = {
128
90
  description?: string
129
91
  clusterName?: string
130
92
  namespace?: string
131
- source?: RuleSource
132
- targetType?: TargetType
93
+ source?: InsightIoApiAlertV1alpha1Type.RuleSource
94
+ targetType?: InsightIoApiAlertV1alpha1Type.TargetType
133
95
  targetNames?: string[]
134
96
  expr?: string
135
97
  thresholdSymbol?: string
136
98
  thresholdNum?: number
137
99
  duration?: number
138
- severity?: Severity
100
+ severity?: InsightIoApiAlertV1alpha1Type.Severity
139
101
  notificationTemplate?: string
140
102
  annotation?: Annotation
141
103
  }
@@ -147,7 +109,7 @@ export type UpdateRuleRequest = {
147
109
  thresholdSymbol?: string
148
110
  thresholdNum?: number
149
111
  duration?: number
150
- severity?: Severity
112
+ severity?: InsightIoApiAlertV1alpha1Type.Severity
151
113
  notificationTemplate?: string
152
114
  annotation?: Annotation
153
115
  }
@@ -166,8 +128,8 @@ export type ListAlertsRequest = {
166
128
  name?: string
167
129
  clusterName?: string
168
130
  namespace?: string
169
- severity?: Severity
170
- targetType?: TargetType
131
+ severity?: InsightIoApiAlertV1alpha1Type.Severity
132
+ targetType?: InsightIoApiAlertV1alpha1Type.TargetType
171
133
  targetName?: string
172
134
  page?: number
173
135
  pageSize?: number
@@ -182,12 +144,12 @@ export type ListAlertsResponse = {
182
144
  export type AlertSummary = {
183
145
  alertId?: string
184
146
  ruleName?: string
185
- severity?: Severity
147
+ severity?: InsightIoApiAlertV1alpha1Type.Severity
186
148
  clusterName?: string
187
149
  namespace?: string
188
- targetType?: TargetType
150
+ targetType?: InsightIoApiAlertV1alpha1Type.TargetType
189
151
  targetName?: string
190
- status?: AlertStatus
152
+ status?: InsightIoApiAlertV1alpha1Type.AlertStatus
191
153
  description?: string
192
154
  startAt?: string
193
155
  updateAt?: string
@@ -201,15 +163,15 @@ export type AlertInfo = {
201
163
  ruleId?: string
202
164
  clusterName?: string
203
165
  namespace?: string
204
- targetType?: TargetType
166
+ targetType?: InsightIoApiAlertV1alpha1Type.TargetType
205
167
  targetName?: string
206
- severity?: Severity
168
+ severity?: InsightIoApiAlertV1alpha1Type.Severity
207
169
  labels?: {[key: string]: string}
208
170
  description?: string
209
171
  notifyResponse?: string
210
172
  annotation?: string
211
- source?: RuleSource
212
- status?: AlertStatus
173
+ source?: InsightIoApiAlertV1alpha1Type.RuleSource
174
+ status?: InsightIoApiAlertV1alpha1Type.AlertStatus
213
175
  startAt?: string
214
176
  updateAt?: string
215
177
  }
@@ -218,9 +180,9 @@ export type CountAlertRequest = {
218
180
  resolved?: boolean
219
181
  clusterName?: string
220
182
  namespace?: string
221
- targetType?: TargetType
183
+ targetType?: InsightIoApiAlertV1alpha1Type.TargetType
222
184
  targetName?: string
223
- severity?: Severity
185
+ severity?: InsightIoApiAlertV1alpha1Type.Severity
224
186
  start?: string
225
187
  end?: string
226
188
  step?: string
@@ -4,6 +4,7 @@
4
4
  * This file is a generated Typescript file for GRPC Gateway, DO NOT MODIFY
5
5
  */
6
6
 
7
+ import * as InsightIoApiAlertV1alpha1Alert from "../../alert/v1alpha1/alert.pb"
7
8
  import * as InsightIoApiFeature_gateV1alpha1Feature_gate from "../../feature_gate/v1alpha1/feature_gate.pb"
8
9
  import * as fm from "../../fetch.pb"
9
10
  import * as InsightIoApiGraphV1alpha1Graph from "../../graph/v1alpha1/graph.pb"
@@ -83,6 +84,36 @@ export class FeatureGate {
83
84
  }
84
85
  }
85
86
  export class Alert {
87
+ static ListGroups(req: InsightIoApiAlertV1alpha1Alert.ListGroupsRequest, initReq?: fm.InitReq): Promise<InsightIoApiAlertV1alpha1Alert.ListGroupsResponse> {
88
+ return fm.fetchReq<InsightIoApiAlertV1alpha1Alert.ListGroupsRequest, InsightIoApiAlertV1alpha1Alert.ListGroupsResponse>(`/apis/insight.io/v1alpha1/alert/groups?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
89
+ }
90
+ static CreateGroup(req: InsightIoApiAlertV1alpha1Alert.CreateGroupRequest, initReq?: fm.InitReq): Promise<InsightIoApiAlertV1alpha1Alert.Group> {
91
+ return fm.fetchReq<InsightIoApiAlertV1alpha1Alert.CreateGroupRequest, InsightIoApiAlertV1alpha1Alert.Group>(`/apis/insight.io/v1alpha1/alert/groups`, {...initReq, method: "POST", body: JSON.stringify(req)})
92
+ }
93
+ static GetGroup(req: InsightIoApiAlertV1alpha1Alert.ID, initReq?: fm.InitReq): Promise<InsightIoApiAlertV1alpha1Alert.Group> {
94
+ return fm.fetchReq<InsightIoApiAlertV1alpha1Alert.ID, InsightIoApiAlertV1alpha1Alert.Group>(`/apis/insight.io/v1alpha1/alert/groups/${req["id"]}?${fm.renderURLSearchParams(req, ["id"])}`, {...initReq, method: "GET"})
95
+ }
96
+ static UpdateGroup(req: InsightIoApiAlertV1alpha1Alert.UpdateGroupRequest, initReq?: fm.InitReq): Promise<InsightIoApiAlertV1alpha1Alert.Group> {
97
+ return fm.fetchReq<InsightIoApiAlertV1alpha1Alert.UpdateGroupRequest, InsightIoApiAlertV1alpha1Alert.Group>(`/apis/insight.io/v1alpha1/alert/groups/${req["id"]}`, {...initReq, method: "PUT", body: JSON.stringify(req)})
98
+ }
99
+ static DeleteGroup(req: InsightIoApiAlertV1alpha1Alert.ID, initReq?: fm.InitReq): Promise<empty> {
100
+ return fm.fetchReq<InsightIoApiAlertV1alpha1Alert.ID, empty>(`/apis/insight.io/v1alpha1/alert/groups/${req["id"]}`, {...initReq, method: "DELETE"})
101
+ }
102
+ static ListGroupRules(req: InsightIoApiAlertV1alpha1Alert.ListGroupRulesRequest, initReq?: fm.InitReq): Promise<InsightIoApiAlertV1alpha1Alert.ListRulesV2Response> {
103
+ return fm.fetchReq<InsightIoApiAlertV1alpha1Alert.ListGroupRulesRequest, InsightIoApiAlertV1alpha1Alert.ListRulesV2Response>(`/apis/insight.io/v1alpha1/alert/groups/${req["id"]}/rules?${fm.renderURLSearchParams(req, ["id"])}`, {...initReq, method: "GET"})
104
+ }
105
+ static AddGroupRule(req: InsightIoApiAlertV1alpha1Alert.AddGroupRuleRequest, initReq?: fm.InitReq): Promise<InsightIoApiAlertV1alpha1Alert.RuleV2> {
106
+ return fm.fetchReq<InsightIoApiAlertV1alpha1Alert.AddGroupRuleRequest, InsightIoApiAlertV1alpha1Alert.RuleV2>(`/apis/insight.io/v1alpha1/alert/groups/${req["groupId"]}/rules`, {...initReq, method: "POST", body: JSON.stringify(req)})
107
+ }
108
+ static GetGroupRule(req: InsightIoApiAlertV1alpha1Alert.GroupRule, initReq?: fm.InitReq): Promise<InsightIoApiAlertV1alpha1Alert.RuleV2> {
109
+ return fm.fetchReq<InsightIoApiAlertV1alpha1Alert.GroupRule, InsightIoApiAlertV1alpha1Alert.RuleV2>(`/apis/insight.io/v1alpha1/alert/groups/${req["groupId"]}/rules/${req["name"]}?${fm.renderURLSearchParams(req, ["groupId", "name"])}`, {...initReq, method: "GET"})
110
+ }
111
+ static DeleteGroupRule(req: InsightIoApiAlertV1alpha1Alert.GroupRule, initReq?: fm.InitReq): Promise<empty> {
112
+ return fm.fetchReq<InsightIoApiAlertV1alpha1Alert.GroupRule, empty>(`/apis/insight.io/v1alpha1/alert/groups/${req["groupId"]}/rules/${req["name"]}`, {...initReq, method: "DELETE"})
113
+ }
114
+ static UpdateGroupRule(req: InsightIoApiAlertV1alpha1Alert.UpdateRuleV2Request, initReq?: fm.InitReq): Promise<InsightIoApiAlertV1alpha1Alert.RuleV2> {
115
+ return fm.fetchReq<InsightIoApiAlertV1alpha1Alert.UpdateRuleV2Request, InsightIoApiAlertV1alpha1Alert.RuleV2>(`/apis/insight.io/v1alpha1/alert/groups/${req["groupId"]}/rules/${req["name"]}`, {...initReq, method: "PUT", body: JSON.stringify(req)})
116
+ }
86
117
  static ListRules(req: InsightIoApiInsightV1alpha1Alert.ListRulesRequest, initReq?: fm.InitReq): Promise<InsightIoApiInsightV1alpha1Alert.ListRulesResponse> {
87
118
  return fm.fetchReq<InsightIoApiInsightV1alpha1Alert.ListRulesRequest, InsightIoApiInsightV1alpha1Alert.ListRulesResponse>(`/apis/insight.io/v1alpha1/alert/rules?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
88
119
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name":"@daocloud-proto/insight",
3
- "version":"0.14.0-dev-e669e7d9",
3
+ "version":"0.14.0-dev-661895cf",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -1,9 +0,0 @@
1
- /* eslint-disable */
2
- // @ts-nocheck
3
- /*
4
- * This file is a generated Typescript file for GRPC Gateway, DO NOT MODIFY
5
- */
6
- export type Duration = {
7
- seconds?: string
8
- nanos?: number
9
- }