@daocloud-proto/insight 0.28.0 → 0.29.0-rc1

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.
@@ -22,6 +22,8 @@ export enum ReceiverType {
22
22
  dingtalk = "dingtalk",
23
23
  wecom = "wecom",
24
24
  sms = "sms",
25
+ message = "message",
26
+ lark = "lark",
25
27
  }
26
28
 
27
29
  export enum ProviderType {
@@ -37,10 +39,11 @@ type BaseReceiver = {
37
39
  type?: ReceiverType
38
40
  createAt?: string
39
41
  updateAt?: string
42
+ description?: string
40
43
  }
41
44
 
42
45
  export type Receiver = BaseReceiver
43
- & OneOf<{ webhook: WebhookConfig; email: EmailConfig; wecom: WecomConfig; dingtalk: DingtalkConfig; sms: SmsConfig }>
46
+ & OneOf<{ webhook: WebhookConfig; email: EmailConfig; wecom: WecomConfig; dingtalk: DingtalkConfig; sms: SmsConfig; message: MessageConfig; lark: LarkConfig }>
44
47
 
45
48
  export type WebhookConfig = {
46
49
  url?: string
@@ -56,6 +59,11 @@ export type DingtalkConfig = {
56
59
  secret?: string
57
60
  }
58
61
 
62
+ export type LarkConfig = {
63
+ webhook?: string
64
+ secret?: string
65
+ }
66
+
59
67
  export type EmailConfig = {
60
68
  to?: string[]
61
69
  }
@@ -70,6 +78,15 @@ export type SmsConfigContact = {
70
78
  phone?: string
71
79
  }
72
80
 
81
+ export type MessageConfigUser = {
82
+ name?: string
83
+ userId?: string
84
+ }
85
+
86
+ export type MessageConfig = {
87
+ users?: MessageConfigUser[]
88
+ }
89
+
73
90
  export type ListReceiversRequest = {
74
91
  name?: string
75
92
  type?: ReceiverType
@@ -162,6 +179,8 @@ export type TemplateBody = {
162
179
  wecom?: string
163
180
  dingtalk?: string
164
181
  webhook?: string
182
+ message?: string
183
+ lark?: string
165
184
  }
166
185
 
167
186
  export type emailBody = {
@@ -27,6 +27,7 @@ import * as InsightIoApiResourceV1alpha1Workload from "../../resource/v1alpha1/w
27
27
  import * as InsightIoApiSpan_metricV1alpha1Span_metric from "../../span_metric/v1alpha1/span_metric.pb"
28
28
  import * as InsightIoApiTracingV1alpha1Query from "../../tracing/v1alpha1/query.pb"
29
29
  import * as InsightIoApiTracingV1alpha1Tracing from "../../tracing/v1alpha1/tracing.pb"
30
+ import * as InsightIoApiUserV1alpha1User from "../../user/v1alpha1/user.pb"
30
31
 
31
32
  export enum resourceType {
32
33
  overview = "overview",
@@ -379,8 +380,8 @@ export class Resource {
379
380
  static GetPod(req: InsightIoApiResourceV1alpha1Pod.GetPodRequest, initReq?: fm.InitReq): Promise<InsightIoApiResourceV1alpha1Pod.Pod> {
380
381
  return fm.fetchReq<InsightIoApiResourceV1alpha1Pod.GetPodRequest, InsightIoApiResourceV1alpha1Pod.Pod>(`/apis/insight.io/v1alpha1/clusters/${req["cluster"]}/namespaces/${req["namespace"]}/pods/${req["name"]}?${fm.renderURLSearchParams(req, ["cluster", "namespace", "name"])}`, {...initReq, method: "GET"})
381
382
  }
382
- static GetPodJVMInfo(req: InsightIoApiResourceV1alpha1Pod.PodJVMRequest, initReq?: fm.InitReq): Promise<InsightIoApiResourceV1alpha1Pod.PodJVMInfo> {
383
- return fm.fetchReq<InsightIoApiResourceV1alpha1Pod.PodJVMRequest, InsightIoApiResourceV1alpha1Pod.PodJVMInfo>(`/apis/insight.io/v1alpha1/pods/${req["name"]}/jvm`, {...initReq, method: "POST", body: JSON.stringify(req)})
383
+ static GetPodJVMDashboards(req: InsightIoApiResourceV1alpha1Pod.GetPodJVMDashboardsRequest, initReq?: fm.InitReq): Promise<InsightIoApiResourceV1alpha1Pod.GetPodJVMDashboardsResponse> {
384
+ return fm.fetchReq<InsightIoApiResourceV1alpha1Pod.GetPodJVMDashboardsRequest, InsightIoApiResourceV1alpha1Pod.GetPodJVMDashboardsResponse>(`/apis/insight.io/v1alpha1/clusters/${req["cluster"]}/namespaces/${req["namespace"]}/pods/${req["name"]}/dashboards/jvm?${fm.renderURLSearchParams(req, ["cluster", "namespace", "name"])}`, {...initReq, method: "GET"})
384
385
  }
385
386
  static ListPodContainers(req: InsightIoApiResourceV1alpha1Pod.ListContainersRequest, initReq?: fm.InitReq): Promise<InsightIoApiResourceV1alpha1Pod.ListContainersResponse> {
386
387
  return fm.fetchReq<InsightIoApiResourceV1alpha1Pod.ListContainersRequest, InsightIoApiResourceV1alpha1Pod.ListContainersResponse>(`/apis/insight.io/v1alpha1/clusters/${req["cluster"]}/namespaces/${req["namespace"]}/pods/${req["name"]}/containers?${fm.renderURLSearchParams(req, ["cluster", "namespace", "name"])}`, {...initReq, method: "GET"})
@@ -397,11 +398,11 @@ export class Resource {
397
398
  static GetServerComponentSummary(req: empty, initReq?: fm.InitReq): Promise<InsightIoApiResourceV1alpha1Cluster.ServerComponentSummary> {
398
399
  return fm.fetchReq<empty, InsightIoApiResourceV1alpha1Cluster.ServerComponentSummary>(`/apis/insight.io/v1alpha1/server/component?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
399
400
  }
400
- static GetNodeGPUDashboard(req: InsightIoApiResourceV1alpha1Node.GetNodeGPUDashboardRequest, initReq?: fm.InitReq): Promise<InsightIoApiResourceV1alpha1Node.GetGPUResponse> {
401
- return fm.fetchReq<InsightIoApiResourceV1alpha1Node.GetNodeGPUDashboardRequest, InsightIoApiResourceV1alpha1Node.GetGPUResponse>(`/apis/insight.io/v1alpha1/clusters/${req["cluster"]}/nodes/${req["name"]}/gpu?${fm.renderURLSearchParams(req, ["cluster", "name"])}`, {...initReq, method: "GET"})
401
+ static GetNodeGPUDashboards(req: InsightIoApiResourceV1alpha1Node.GetNodeGPUDashboardRequest, initReq?: fm.InitReq): Promise<InsightIoApiResourceV1alpha1Node.GetGPUResponse> {
402
+ return fm.fetchReq<InsightIoApiResourceV1alpha1Node.GetNodeGPUDashboardRequest, InsightIoApiResourceV1alpha1Node.GetGPUResponse>(`/apis/insight.io/v1alpha1/clusters/${req["cluster"]}/nodes/${req["name"]}/dashboards/gpu?${fm.renderURLSearchParams(req, ["cluster", "name"])}`, {...initReq, method: "GET"})
402
403
  }
403
- static GetPodGPUDashboard(req: InsightIoApiResourceV1alpha1Node.GetPodGPUDashboardRequest, initReq?: fm.InitReq): Promise<InsightIoApiResourceV1alpha1Node.GetGPUResponse> {
404
- return fm.fetchReq<InsightIoApiResourceV1alpha1Node.GetPodGPUDashboardRequest, InsightIoApiResourceV1alpha1Node.GetGPUResponse>(`/apis/insight.io/v1alpha1/pods/${req["name"]}/gpu?${fm.renderURLSearchParams(req, ["name"])}`, {...initReq, method: "GET"})
404
+ static GetPodGPUDashboards(req: InsightIoApiResourceV1alpha1Node.GetPodGPUDashboardRequest, initReq?: fm.InitReq): Promise<InsightIoApiResourceV1alpha1Node.GetGPUResponse> {
405
+ return fm.fetchReq<InsightIoApiResourceV1alpha1Node.GetPodGPUDashboardRequest, InsightIoApiResourceV1alpha1Node.GetGPUResponse>(`/apis/insight.io/v1alpha1/clusters/${req["cluster"]}/namespaces/${req["namespace"]}/pods/${req["name"]}/dashboards/gpu?${fm.renderURLSearchParams(req, ["cluster", "namespace", "name"])}`, {...initReq, method: "GET"})
405
406
  }
406
407
  }
407
408
  export class Tracing {
@@ -496,4 +497,9 @@ export class NetFlow {
496
497
  static GetNetFlow(req: empty, initReq?: fm.InitReq): Promise<InsightIoApiNet_flowV1alpha1Net_flow.GetConfigResponse> {
497
498
  return fm.fetchReq<empty, InsightIoApiNet_flowV1alpha1Net_flow.GetConfigResponse>(`/apis/insight.io/v1alpha1/net_flow/config?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
498
499
  }
500
+ }
501
+ export class User {
502
+ static ListUsers(req: InsightIoApiUserV1alpha1User.ListUsersRequest, initReq?: fm.InitReq): Promise<InsightIoApiUserV1alpha1User.ListUsersResponse> {
503
+ return fm.fetchReq<InsightIoApiUserV1alpha1User.ListUsersRequest, InsightIoApiUserV1alpha1User.ListUsersResponse>(`/apis/insight.io/v1alpha1/users?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
504
+ }
499
505
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name":"@daocloud-proto/insight",
3
- "version":"0.28.0",
3
+ "version":"0.29.0-rc1",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -14,13 +14,6 @@ export enum NodePhase {
14
14
  NODE_PHASE_UNKNOWN = "NODE_PHASE_UNKNOWN",
15
15
  }
16
16
 
17
- export enum GPUVendorType {
18
- UNSPECIFIED = "UNSPECIFIED",
19
- Nvidia = "Nvidia",
20
- Ascend = "Ascend",
21
- Iluvatar = "Iluvatar",
22
- }
23
-
24
17
  export type ListNodesRequest = {
25
18
  cluster?: string
26
19
  phase?: NodePhase
@@ -81,27 +74,23 @@ export type usage = {
81
74
  storageUsage?: number
82
75
  }
83
76
 
84
- export type dashboardURL = {
77
+ export type GPUDashboardURL = {
78
+ vendor?: string
85
79
  en?: string
86
80
  zh?: string
87
81
  }
88
82
 
89
83
  export type GetGPUResponse = {
90
- urls?: {[key: string]: dashboardURL}
84
+ urls?: GPUDashboardURL[]
91
85
  }
92
86
 
93
87
  export type GetNodeGPUDashboardRequest = {
94
88
  cluster?: string
95
89
  name?: string
96
- gpuVendors?: string[]
97
- start?: string
98
- end?: string
99
90
  }
100
91
 
101
92
  export type GetPodGPUDashboardRequest = {
102
- clusterName?: string
93
+ cluster?: string
103
94
  namespace?: string
104
95
  name?: string
105
- start?: string
106
- end?: string
107
96
  }
@@ -7,15 +7,6 @@
7
7
  import * as InsightIoApiTypeV1alpha1Page from "../../type/v1alpha1/page.pb"
8
8
  import * as InsightIoApiResourceV1alpha1Type from "./type.pb"
9
9
 
10
- type Absent<T, K extends keyof T> = { [k in Exclude<keyof T, K>]?: undefined };
11
- type OneOf<T> =
12
- | { [k in keyof T]?: undefined }
13
- | (
14
- keyof T extends infer K ?
15
- (K extends string & keyof T ? { [k in K]: T[K] } & Absent<T, K>
16
- : never)
17
- : never);
18
-
19
10
  export enum PodPhase {
20
11
  POD_PHASE_UNSPECIFIED = "POD_PHASE_UNSPECIFIED",
21
12
  POD_PHASE_UNKNOWN = "POD_PHASE_UNKNOWN",
@@ -66,8 +57,8 @@ export type GetPodRequest = {
66
57
  name?: string
67
58
  }
68
59
 
69
-
70
- type BasePodJVMRequest = {
60
+ export type GetPodJVMDashboardsRequest = {
61
+ cluster?: string
71
62
  namespace?: string
72
63
  name?: string
73
64
  start?: string
@@ -75,9 +66,6 @@ type BasePodJVMRequest = {
75
66
  step?: number
76
67
  }
77
68
 
78
- export type PodJVMRequest = BasePodJVMRequest
79
- & OneOf<{ cluster: string; clusterName: string }>
80
-
81
69
  export type Pod = {
82
70
  name?: string
83
71
  cluster?: string
@@ -90,7 +78,7 @@ export type Pod = {
90
78
  conditions?: InsightIoApiResourceV1alpha1Type.Condition[]
91
79
  }
92
80
 
93
- export type PodJVMInfo = {
81
+ export type GetPodJVMDashboardsResponse = {
94
82
  type?: JVMType
95
83
  urls?: JVMUrls
96
84
  }
@@ -0,0 +1,23 @@
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
+ export type ListUsersRequest = {
9
+ search?: string
10
+ pageSize?: number
11
+ page?: number
12
+ }
13
+
14
+ export type User = {
15
+ id?: string
16
+ name?: string
17
+ enabled?: boolean
18
+ }
19
+
20
+ export type ListUsersResponse = {
21
+ items?: User[]
22
+ pagination?: InsightIoApiTypeV1alpha1Page.Pagination
23
+ }