@daocloud-proto/insight 0.38.2 → 0.39.0-12-g75ea629

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.
@@ -322,29 +322,6 @@ export type countInfo = {
322
322
  sum?: {[key: string]: string}
323
323
  }
324
324
 
325
- export type AMHookRequest = {
326
- version?: string
327
- groupKey?: string
328
- status?: string
329
- receiver?: string
330
- groupLabels?: {[key: string]: string}
331
- commonLabels?: {[key: string]: string}
332
- commonAnnotations?: {[key: string]: string}
333
- externalURL?: string
334
- alerts?: AmAlert[]
335
- truncatedAlerts?: string
336
- }
337
-
338
- export type AmAlert = {
339
- status?: string
340
- labels?: {[key: string]: string}
341
- annotations?: {[key: string]: string}
342
- startsAt?: string
343
- endsAt?: string
344
- generatorURL?: string
345
- fingerprint?: string
346
- }
347
-
348
325
  export type AlertHistoryRetentionPeriod = {
349
326
  retentionTime?: number
350
327
  }
@@ -374,6 +351,7 @@ export type PreviewRuleRequest = {
374
351
 
375
352
  export type PreviewRuleResponse = {
376
353
  matrix?: InsightIoApiMetricV1alpha1Metric.SampleStream[]
354
+ promQL?: string
377
355
  }
378
356
 
379
357
  export type GetSMTPStatusResponse = {
@@ -5,6 +5,7 @@
5
5
  */
6
6
 
7
7
  import * as InsightIoApiTypeV1alpha1Page from "../../type/v1alpha1/page.pb"
8
+ import * as InsightIoApiAlertV1alpha1Type from "./type.pb"
8
9
 
9
10
  type Absent<T, K extends keyof T> = { [k in Exclude<keyof T, K>]?: undefined };
10
11
  type OneOf<T> =
@@ -194,6 +195,21 @@ export type emailBody = {
194
195
  body?: string
195
196
  }
196
197
 
198
+ export type PreviewTemplateRequest = {
199
+ body?: TemplateBody
200
+ data?: InsightIoApiAlertV1alpha1Type.AMHookRequest
201
+ }
202
+
203
+ export type TemplateRenderStatus = {
204
+ content?: string
205
+ status?: boolean
206
+ error?: string
207
+ }
208
+
209
+ export type PreviewTemplateResponse = {
210
+ data?: {[key: string]: TemplateRenderStatus}
211
+ }
212
+
197
213
  export type ProviderAliyunConfig = {
198
214
  signName?: string
199
215
  templateCode?: string
@@ -52,4 +52,27 @@ export enum RuleFilterCondition {
52
52
  REG = "REG",
53
53
  FUZZINESS = "FUZZINESS",
54
54
  WILD_CARD = "WILD_CARD",
55
+ }
56
+
57
+ export type AMHookRequest = {
58
+ version?: string
59
+ groupKey?: string
60
+ status?: string
61
+ receiver?: string
62
+ groupLabels?: {[key: string]: string}
63
+ commonLabels?: {[key: string]: string}
64
+ commonAnnotations?: {[key: string]: string}
65
+ externalURL?: string
66
+ alerts?: AmAlert[]
67
+ truncatedAlerts?: string
68
+ }
69
+
70
+ export type AmAlert = {
71
+ status?: string
72
+ labels?: {[key: string]: string}
73
+ annotations?: {[key: string]: string}
74
+ startsAt?: string
75
+ endsAt?: string
76
+ generatorURL?: string
77
+ fingerprint?: string
55
78
  }
@@ -8,6 +8,7 @@ import * as InsightIoApiAlertV1alpha1Alert from "../../alert/v1alpha1/alert.pb"
8
8
  import * as InsightIoApiAlertV1alpha1Inhibition from "../../alert/v1alpha1/inhibition.pb"
9
9
  import * as InsightIoApiAlertV1alpha1Notify from "../../alert/v1alpha1/notify.pb"
10
10
  import * as InsightIoApiAlertV1alpha1Silence from "../../alert/v1alpha1/silence.pb"
11
+ import * as InsightIoApiAlertV1alpha1Type from "../../alert/v1alpha1/type.pb"
11
12
  import * as InsightIoApiEventV1alpha1Event from "../../event/v1alpha1/event.pb"
12
13
  import * as InsightIoApiFeature_gateV1alpha1Feature_gate from "../../feature_gate/v1alpha1/feature_gate.pb"
13
14
  import * as fm from "../../fetch.pb"
@@ -164,8 +165,8 @@ export class Alert {
164
165
  static CountAlert(req: InsightIoApiAlertV1alpha1Alert.CountAlertRequest, initReq?: fm.InitReq): Promise<InsightIoApiAlertV1alpha1Alert.CountAlertResponse> {
165
166
  return fm.fetchReq<InsightIoApiAlertV1alpha1Alert.CountAlertRequest, InsightIoApiAlertV1alpha1Alert.CountAlertResponse>(`/apis/insight.io/v1alpha1/alert/alertcount?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
166
167
  }
167
- static AlertHook(req: InsightIoApiAlertV1alpha1Alert.AMHookRequest, initReq?: fm.InitReq): Promise<empty> {
168
- return fm.fetchReq<InsightIoApiAlertV1alpha1Alert.AMHookRequest, empty>(`/apis/insight.io/v1alpha1/alert/hook`, {...initReq, method: "POST", body: JSON.stringify(req)})
168
+ static AlertHook(req: InsightIoApiAlertV1alpha1Type.AMHookRequest, initReq?: fm.InitReq): Promise<empty> {
169
+ return fm.fetchReq<InsightIoApiAlertV1alpha1Type.AMHookRequest, empty>(`/apis/insight.io/v1alpha1/alert/hook`, {...initReq, method: "POST", body: JSON.stringify(req)})
169
170
  }
170
171
  static CleanAlertHistory(req: empty, initReq?: fm.InitReq): Promise<InsightIoApiAlertV1alpha1Alert.CleanAlertHistoryResponse> {
171
172
  return fm.fetchReq<empty, InsightIoApiAlertV1alpha1Alert.CleanAlertHistoryResponse>(`/apis/insight.io/v1alpha1/alert/history/clean`, {...initReq, method: "PUT"})
@@ -224,6 +225,9 @@ export class Alert {
224
225
  static DeleteTemplate(req: InsightIoApiAlertV1alpha1Notify.TemplateName, initReq?: fm.InitReq): Promise<empty> {
225
226
  return fm.fetchReq<InsightIoApiAlertV1alpha1Notify.TemplateName, empty>(`/apis/insight.io/v1alpha1/alert/templates/${req["name"]}`, {...initReq, method: "DELETE"})
226
227
  }
228
+ static PreviewTemplate(req: InsightIoApiAlertV1alpha1Notify.PreviewTemplateRequest, initReq?: fm.InitReq): Promise<InsightIoApiAlertV1alpha1Notify.PreviewTemplateResponse> {
229
+ return fm.fetchReq<InsightIoApiAlertV1alpha1Notify.PreviewTemplateRequest, InsightIoApiAlertV1alpha1Notify.PreviewTemplateResponse>(`/apis/insight.io/v1alpha1/alert/templates/preview`, {...initReq, method: "POST", body: JSON.stringify(req)})
230
+ }
227
231
  static ListSilences(req: InsightIoApiAlertV1alpha1Silence.ListSilencesRequest, initReq?: fm.InitReq): Promise<InsightIoApiAlertV1alpha1Silence.ListSilencesResponse> {
228
232
  return fm.fetchReq<InsightIoApiAlertV1alpha1Silence.ListSilencesRequest, InsightIoApiAlertV1alpha1Silence.ListSilencesResponse>(`/apis/insight.io/v1alpha1/alert/silences?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
229
233
  }
@@ -309,6 +313,9 @@ export class Metric {
309
313
  static BatchQueryRangeMetric(req: InsightIoApiMetricV1alpha1Metric.BatchQueryRangeRequest, initReq?: fm.InitReq): Promise<InsightIoApiMetricV1alpha1Metric.BatchQueryRangeResponse> {
310
314
  return fm.fetchReq<InsightIoApiMetricV1alpha1Metric.BatchQueryRangeRequest, InsightIoApiMetricV1alpha1Metric.BatchQueryRangeResponse>(`/apis/insight.io/v1alpha1/metric/queryrange`, {...initReq, method: "POST", body: JSON.stringify(req)})
311
315
  }
316
+ static FormatQuery(req: InsightIoApiMetricV1alpha1Metric.FormatQueryRequest, initReq?: fm.InitReq): Promise<InsightIoApiMetricV1alpha1Metric.FormatQueryResponse> {
317
+ return fm.fetchReq<InsightIoApiMetricV1alpha1Metric.FormatQueryRequest, InsightIoApiMetricV1alpha1Metric.FormatQueryResponse>(`/apis/insight.io/v1alpha1/metric/format_query`, {...initReq, method: "POST", body: JSON.stringify(req)})
318
+ }
312
319
  }
313
320
  export class Resource {
314
321
  static ListClusters(req: InsightIoApiResourceV1alpha1Cluster.ListClusterRequest, initReq?: fm.InitReq): Promise<InsightIoApiResourceV1alpha1Cluster.ListClustersResponse> {
@@ -113,4 +113,12 @@ export type BatchQueryRangeResult = {
113
113
  data?: PrometheusQueryRangeResult
114
114
  status?: requestStatus
115
115
  errorMessage?: string
116
+ }
117
+
118
+ export type FormatQueryRequest = {
119
+ query?: string
120
+ }
121
+
122
+ export type FormatQueryResponse = {
123
+ query?: string
116
124
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name":"@daocloud-proto/insight",
3
- "version":"0.38.2",
3
+ "version":"0.39.0-12-g75ea629",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {