@daocloud-proto/mcamel-redis 0.4.0-71 → 0.4.0-710

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.
package/cluster.pb.ts CHANGED
@@ -7,12 +7,46 @@
7
7
  import * as CommonCommon from "./common.pb"
8
8
  import * as fm from "./fetch.pb"
9
9
 
10
+ export enum PermissionsType {
11
+ None = "None",
12
+ GetInstance = "GetInstance",
13
+ CreateInstance = "CreateInstance",
14
+ UpdateInstance = "UpdateInstance",
15
+ DeleteInstance = "DeleteInstance",
16
+ GetMetric = "GetMetric",
17
+ GetInstanceLog = "GetInstanceLog",
18
+ GetConfig = "GetConfig",
19
+ UpdateConfig = "UpdateConfig",
20
+ GetBackup = "GetBackup",
21
+ CreateBackup = "CreateBackup",
22
+ UpdateBackup = "UpdateBackup",
23
+ DeleteBackup = "DeleteBackup",
24
+ GetBackupConf = "GetBackupConf",
25
+ CreateBackupConf = "CreateBackupConf",
26
+ UpdateBackupConf = "UpdateBackupConf",
27
+ DeleteBackupConf = "DeleteBackupConf",
28
+ GetTemplate = "GetTemplate",
29
+ CreateTemplate = "CreateTemplate",
30
+ UpdateTemplate = "UpdateTemplate",
31
+ DeleteTemplate = "DeleteTemplate",
32
+ }
33
+
10
34
  export enum EventType {
11
35
  EVENT_TYPE_UNSPECIFIED = "EVENT_TYPE_UNSPECIFIED",
12
36
  Normal = "Normal",
13
37
  Warning = "Warning",
14
38
  }
15
39
 
40
+ export enum InstallFileReqGVR {
41
+ None = "None",
42
+ CustomResourceDefinition = "CustomResourceDefinition",
43
+ }
44
+
45
+ export enum GetAllEventListReqSortDir {
46
+ ASC = "ASC",
47
+ DESC = "DESC",
48
+ }
49
+
16
50
  export enum GetEventListReqKind {
17
51
  KIND_UNSPECIFIED = "KIND_UNSPECIFIED",
18
52
  Pod = "Pod",
@@ -23,11 +57,154 @@ export enum GetWorkspaceListReqSortDir {
23
57
  DESC = "DESC",
24
58
  }
25
59
 
60
+ export enum ClusterItemNetworkMode {
61
+ Unknown = "Unknown",
62
+ Flannel = "Flannel",
63
+ Calico = "Calico",
64
+ }
65
+
26
66
  export enum GetInsightAgentStatusRespInsightAgentStatus {
27
67
  NotInstall = "NotInstall",
28
68
  Install = "Install",
29
69
  }
30
70
 
71
+ export type InstallFileReq = {
72
+ cluster?: string
73
+ path?: string
74
+ gvr?: InstallFileReqGVR
75
+ }
76
+
77
+ export type InstallFileResp = {
78
+ message?: string
79
+ }
80
+
81
+ export type GetInstallVersionReq = {
82
+ cluster?: string
83
+ }
84
+
85
+ export type GetInstallVersionRespSupportVersion = {
86
+ minVersion?: string
87
+ maxVersion?: string
88
+ }
89
+
90
+ export type GetInstallVersionRespStatus = {
91
+ inRange?: boolean
92
+ }
93
+
94
+ export type GetInstallVersionResp = {
95
+ clusterVersion?: string
96
+ supportVersion?: GetInstallVersionRespSupportVersion
97
+ status?: GetInstallVersionRespStatus
98
+ }
99
+
100
+ export type RestartInstanceReq = {
101
+ workspaceId?: number
102
+ cluster?: string
103
+ namespace?: string
104
+ name?: string
105
+ extra?: string
106
+ }
107
+
108
+ export type RestartInstanceResp = {
109
+ message?: string
110
+ }
111
+
112
+ export type GetPermissionsListReq = {
113
+ workspaceId?: number
114
+ }
115
+
116
+ export type GetPermissionsListRespPermissions = {
117
+ getInstance?: boolean
118
+ createInstance?: boolean
119
+ updateInstance?: boolean
120
+ deleteInstance?: boolean
121
+ getMetric?: boolean
122
+ getInstanceLog?: boolean
123
+ getConfig?: boolean
124
+ updateConfig?: boolean
125
+ getBackup?: boolean
126
+ createBackup?: boolean
127
+ updateBackup?: boolean
128
+ deleteBackup?: boolean
129
+ getBackupConf?: boolean
130
+ createBackupConf?: boolean
131
+ updateBackupConf?: boolean
132
+ deleteBackupConf?: boolean
133
+ getTemplate?: boolean
134
+ createTemplate?: boolean
135
+ updateTemplate?: boolean
136
+ deleteTemplate?: boolean
137
+ }
138
+
139
+ export type GetPermissionsListResp = {
140
+ permissionsBool?: GetPermissionsListRespPermissions
141
+ permissions?: PermissionsType[]
142
+ }
143
+
144
+ export type GetAllEventKindsListResp = {
145
+ data?: string[]
146
+ }
147
+
148
+ export type GetAllEventKindsListReq = {
149
+ cluster?: string
150
+ }
151
+
152
+ export type GetAllEventListReq = {
153
+ page?: number
154
+ pageSize?: number
155
+ sortDir?: GetAllEventListReqSortDir
156
+ sortBy?: string
157
+ searchKey?: string
158
+ cluster?: string
159
+ namespace?: string
160
+ name?: string
161
+ eventType?: EventType
162
+ kindName?: string
163
+ }
164
+
165
+ export type GetAllEventListRespItemsSource = {
166
+ component?: string
167
+ }
168
+
169
+ export type GetAllEventListRespItemsMetadata = {
170
+ uid?: string
171
+ name?: string
172
+ namespace?: string
173
+ annotations?: {[key: string]: string}
174
+ resourceVersion?: string
175
+ creationTimestamp?: string
176
+ }
177
+
178
+ export type GetAllEventListRespItemsInvolvedObject = {
179
+ uid?: string
180
+ kind?: string
181
+ name?: string
182
+ namespace?: string
183
+ apiVersion?: string
184
+ resourceVersion?: string
185
+ }
186
+
187
+ export type GetAllEventListRespItems = {
188
+ kind?: string
189
+ type?: string
190
+ count?: number
191
+ reason?: string
192
+ source?: GetAllEventListRespItemsSource
193
+ message?: string
194
+ metadata?: GetAllEventListRespItemsMetadata
195
+ apiVersion?: string
196
+ lastTimestamp?: string
197
+ firstTimestamp?: string
198
+ involvedObject?: GetAllEventListRespItemsInvolvedObject
199
+ reportingInstance?: string
200
+ reportingComponent?: string
201
+ }
202
+
203
+ export type GetAllEventListResp = {
204
+ items?: GetAllEventListRespItems[]
205
+ pagination?: CommonCommon.Pagination
206
+ }
207
+
31
208
  export type GetClusterNodeLabelListReq = {
32
209
  cluster?: string
33
210
  }
@@ -42,6 +219,24 @@ export type GetClusterNodeLabelListResp = {
42
219
  pagination?: CommonCommon.Pagination
43
220
  }
44
221
 
222
+ export type GetClusterPodLabelListReq = {
223
+ page?: number
224
+ pageSize?: number
225
+ searchKey?: string
226
+ filterNamespace?: string
227
+ cluster?: string
228
+ }
229
+
230
+ export type GetClusterPodLabelListRespLabel = {
231
+ key?: string
232
+ value?: string[]
233
+ }
234
+
235
+ export type GetClusterPodLabelListResp = {
236
+ items?: GetClusterPodLabelListRespLabel[]
237
+ pagination?: CommonCommon.Pagination
238
+ }
239
+
45
240
  export type GetClusterNodePortListReq = {
46
241
  cluster?: string
47
242
  }
@@ -114,6 +309,7 @@ export type GetWorkspaceListReq = {
114
309
  export type GetWorkspaceListRespItem = {
115
310
  workspaceId?: number
116
311
  alias?: string
312
+ visible?: boolean
117
313
  }
118
314
 
119
315
  export type GetWorkspaceListResp = {
@@ -121,15 +317,39 @@ export type GetWorkspaceListResp = {
121
317
  pagination?: CommonCommon.Pagination
122
318
  }
123
319
 
320
+ export type GetClusterHostnetworkPortsReq = {
321
+ workspaceId?: number
322
+ cluster?: string
323
+ }
324
+
124
325
  export type GetClusterListReq = {
125
326
  workspaceId?: number
327
+ searchKey?: string
328
+ }
329
+
330
+ export type GetClusterHostnetworkPortsResp = {
331
+ items?: string[]
126
332
  }
127
333
 
128
334
  export type GetClusterListResp = {
129
335
  items?: string[]
336
+ clusters?: ClusterItem[]
130
337
  pagination?: CommonCommon.Pagination
131
338
  }
132
339
 
340
+ export type ClusterItemMetadata = {
341
+ name?: string
342
+ }
343
+
344
+ export type ClusterItemStatus = {
345
+ networkMode?: ClusterItemNetworkMode[]
346
+ }
347
+
348
+ export type ClusterItem = {
349
+ metadata?: ClusterItemMetadata
350
+ status?: ClusterItemStatus
351
+ }
352
+
133
353
  export type GetClusterNamespaceListReq = {
134
354
  workspaceId?: number
135
355
  cluster?: string
@@ -152,6 +372,9 @@ export class Cluster {
152
372
  static GetClusterList(req: GetClusterListReq, initReq?: fm.InitReq): Promise<GetClusterListResp> {
153
373
  return fm.fetchReq<GetClusterListReq, GetClusterListResp>(`/apis/mcamel.io/redis/v1alpha1/${req["workspaceId"]}/clusters?${fm.renderURLSearchParams(req, ["workspaceId"])}`, {...initReq, method: "GET"})
154
374
  }
375
+ static GetClusterHostnetworkPorts(req: GetClusterHostnetworkPortsReq, initReq?: fm.InitReq): Promise<GetClusterHostnetworkPortsResp> {
376
+ return fm.fetchReq<GetClusterHostnetworkPortsReq, GetClusterHostnetworkPortsResp>(`/apis/mcamel.io/redis/v1alpha1/${req["workspaceId"]}/hostnetwork_ports?${fm.renderURLSearchParams(req, ["workspaceId"])}`, {...initReq, method: "GET"})
377
+ }
155
378
  static GetClusterNamespaceList(req: GetClusterNamespaceListReq, initReq?: fm.InitReq): Promise<GetClusterNamespaceListResp> {
156
379
  return fm.fetchReq<GetClusterNamespaceListReq, GetClusterNamespaceListResp>(`/apis/mcamel.io/redis/v1alpha1/${req["workspaceId"]}/${req["cluster"]}/namespaces?${fm.renderURLSearchParams(req, ["workspaceId", "cluster"])}`, {...initReq, method: "GET"})
157
380
  }
@@ -161,6 +384,9 @@ export class Cluster {
161
384
  static GetClusterNodeLabelList(req: GetClusterNodeLabelListReq, initReq?: fm.InitReq): Promise<GetClusterNodeLabelListResp> {
162
385
  return fm.fetchReq<GetClusterNodeLabelListReq, GetClusterNodeLabelListResp>(`/apis/mcamel.io/redis/v1alpha1/${req["cluster"]}/nodelabels?${fm.renderURLSearchParams(req, ["cluster"])}`, {...initReq, method: "GET"})
163
386
  }
387
+ static GetClusterPodLabelList(req: GetClusterPodLabelListReq, initReq?: fm.InitReq): Promise<GetClusterPodLabelListResp> {
388
+ return fm.fetchReq<GetClusterPodLabelListReq, GetClusterPodLabelListResp>(`/apis/mcamel.io/redis/v1alpha1/${req["cluster"]}/podlabels?${fm.renderURLSearchParams(req, ["cluster"])}`, {...initReq, method: "GET"})
389
+ }
164
390
  static GetWorkspaceList(req: GetWorkspaceListReq, initReq?: fm.InitReq): Promise<GetWorkspaceListResp> {
165
391
  return fm.fetchReq<GetWorkspaceListReq, GetWorkspaceListResp>(`/apis/mcamel.io/redis/v1alpha1/workspaces?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
166
392
  }
@@ -170,7 +396,25 @@ export class Cluster {
170
396
  static GetEventList(req: GetEventListReq, initReq?: fm.InitReq): Promise<GetEventListResp> {
171
397
  return fm.fetchReq<GetEventListReq, GetEventListResp>(`/apis/mcamel.io/redis/v1alpha1/${req["cluster"]}/${req["namespace"]}/events?${fm.renderURLSearchParams(req, ["cluster", "namespace"])}`, {...initReq, method: "GET"})
172
398
  }
399
+ static GetAllEventList(req: GetAllEventListReq, initReq?: fm.InitReq): Promise<GetAllEventListResp> {
400
+ return fm.fetchReq<GetAllEventListReq, GetAllEventListResp>(`/apis/mcamel.io/redis/v1alpha1/${req["cluster"]}/${req["namespace"]}/${req["name"]}/all-events?${fm.renderURLSearchParams(req, ["cluster", "namespace", "name"])}`, {...initReq, method: "GET"})
401
+ }
402
+ static GetAllEventKindsList(req: GetAllEventKindsListReq, initReq?: fm.InitReq): Promise<GetAllEventKindsListResp> {
403
+ return fm.fetchReq<GetAllEventKindsListReq, GetAllEventKindsListResp>(`/apis/mcamel.io/redis/v1alpha1/${req["cluster"]}/all-events-kinds?${fm.renderURLSearchParams(req, ["cluster"])}`, {...initReq, method: "GET"})
404
+ }
173
405
  static GetMetallbIPAddressPoolsList(req: GetMetallbIPAddressPoolsListReq, initReq?: fm.InitReq): Promise<GetMetallbIPAddressPoolsListResp> {
174
406
  return fm.fetchReq<GetMetallbIPAddressPoolsListReq, GetMetallbIPAddressPoolsListResp>(`/apis/mcamel.io/redis/v1alpha1/${req["cluster"]}/lbaddress/pools?${fm.renderURLSearchParams(req, ["cluster"])}`, {...initReq, method: "GET"})
175
407
  }
408
+ static GetPermissionsList(req: GetPermissionsListReq, initReq?: fm.InitReq): Promise<GetPermissionsListResp> {
409
+ return fm.fetchReq<GetPermissionsListReq, GetPermissionsListResp>(`/apis/mcamel.io/redis/v1alpha1/${req["workspaceId"]}/permissions?${fm.renderURLSearchParams(req, ["workspaceId"])}`, {...initReq, method: "GET"})
410
+ }
411
+ static RestartInstance(req: RestartInstanceReq, initReq?: fm.InitReq): Promise<RestartInstanceResp> {
412
+ return fm.fetchReq<RestartInstanceReq, RestartInstanceResp>(`/apis/mcamel.io/redis/v1alpha1/${req["workspaceId"]}/restart`, {...initReq, method: "POST", body: JSON.stringify(req)})
413
+ }
414
+ static InstallFile(req: InstallFileReq, initReq?: fm.InitReq): Promise<InstallFileResp> {
415
+ return fm.fetchReq<InstallFileReq, InstallFileResp>(`/apis/mcamel.io/redis/v1alpha1/${req["cluster"]}/install-file`, {...initReq, method: "POST", body: JSON.stringify(req)})
416
+ }
417
+ static GetInstallVersion(req: GetInstallVersionReq, initReq?: fm.InitReq): Promise<GetInstallVersionResp> {
418
+ return fm.fetchReq<GetInstallVersionReq, GetInstallVersionResp>(`/apis/mcamel.io/redis/v1alpha1/${req["cluster"]}/install-version?${fm.renderURLSearchParams(req, ["cluster"])}`, {...initReq, method: "GET"})
419
+ }
176
420
  }
package/common.pb.ts CHANGED
@@ -10,7 +10,7 @@ export enum ExternalTrafficPolicy {
10
10
  }
11
11
 
12
12
  export enum LBTyp {
13
- MetlLB = "MetlLB",
13
+ MetalLB = "MetalLB",
14
14
  Others = "Others",
15
15
  }
16
16
 
@@ -145,9 +145,14 @@ export type PodCommon = {
145
145
  cpuLimit?: number
146
146
  memoryUsage?: number
147
147
  memoryLimit?: number
148
+ pvUsedInGb?: number
149
+ pvAllocatedInGb?: number
148
150
  conditions?: PodCommonCondition[]
149
151
  containersName?: string[]
150
152
  ownerReference?: OwnerReference[]
153
+ initContainersName?: string[]
154
+ initContainersStatuses?: ContainerStatus[]
155
+ containersStatuses?: ContainerStatus[]
151
156
  }
152
157
 
153
158
  export type OwnerReference = {
@@ -161,4 +166,53 @@ export type CommonItemStatus = {
161
166
  serviceAddresses?: string[]
162
167
  webManagerAddress?: string
163
168
  webLogAddress?: string
169
+ avgPvAllocatedInGb?: number
170
+ avgPvUsedInGb?: number
171
+ cpuUtilization?: number
172
+ memoryUtilization?: number
173
+ isClusterUnknown?: boolean
174
+ }
175
+
176
+ export type AccessWhitelistInternal = {
177
+ namespace?: string
178
+ podSelector?: {[key: string]: string}
179
+ }
180
+
181
+ export type AccessWhitelistExternal = {
182
+ cidr?: string
183
+ ip?: string
184
+ }
185
+
186
+ export type AccessWhitelist = {
187
+ internals?: AccessWhitelistInternal[]
188
+ externals?: AccessWhitelistExternal[]
189
+ }
190
+
191
+ export type ContainerStatus = {
192
+ name?: string
193
+ state?: ContainerState
194
+ }
195
+
196
+ export type ContainerState = {
197
+ waiting?: ContainerStateWaiting
198
+ running?: ContainerStateRunning
199
+ terminated?: ContainerStateTerminated
200
+ }
201
+
202
+ export type ContainerStateWaiting = {
203
+ reason?: string
204
+ message?: string
205
+ }
206
+
207
+ export type ContainerStateRunning = {
208
+ startedAt?: string
209
+ }
210
+
211
+ export type ContainerStateTerminated = {
212
+ exitCode?: number
213
+ signal?: number
214
+ reason?: string
215
+ message?: string
216
+ startedAt?: string
217
+ finishedAt?: string
164
218
  }
package/insight.pb.ts CHANGED
@@ -20,27 +20,23 @@ export enum TargetType {
20
20
  DEPLOYMENT = "DEPLOYMENT",
21
21
  STATEFULSET = "STATEFULSET",
22
22
  DAEMONSET = "DAEMONSET",
23
- CRONJOB = "CRONJOB",
24
23
  POD = "POD",
25
24
  }
26
25
 
27
- export enum AlertStatus {
28
- ALERT_STATUS_UNSPECIFIED = "ALERT_STATUS_UNSPECIFIED",
29
- ALERT_STATUS_FIRING = "ALERT_STATUS_FIRING",
30
- ALERT_STATUS_RESOLVED = "ALERT_STATUS_RESOLVED",
31
- }
32
-
33
26
  export type AlertSummary = {
34
- alertId?: string
27
+ id?: string
28
+ groupName?: string
29
+ groupId?: string
35
30
  ruleName?: string
36
- severity?: Severity
31
+ ruleId?: string
37
32
  clusterName?: string
38
33
  namespace?: string
39
34
  targetType?: TargetType
40
- targetName?: string
41
- status?: AlertStatus
35
+ target?: string
36
+ severity?: Severity
37
+ value?: string
38
+ notifyResponse?: string
42
39
  description?: string
43
40
  startAt?: string
44
41
  updateAt?: string
45
- notifyResponse?: string
46
42
  }
package/metric.pb.ts CHANGED
@@ -7,7 +7,18 @@
7
7
  import * as CommonCommon from "./common.pb"
8
8
  import * as fm from "./fetch.pb"
9
9
  import * as InsightIoApiInsightV1alpha1Insight from "./insight.pb"
10
+
11
+ export enum GetAlertsListReqSortDir {
12
+ ASC = "ASC",
13
+ DESC = "DESC",
14
+ }
15
+
10
16
  export type GetAlertsListReq = {
17
+ page?: number
18
+ pageSize?: number
19
+ sortDir?: GetAlertsListReqSortDir
20
+ sortBy?: string
21
+ searchKey?: string
11
22
  cluster?: string
12
23
  namespace?: string
13
24
  name?: string
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name":"@daocloud-proto/mcamel-redis",
3
- "version":"0.4.0-71",
3
+ "version":"0.4.0-710",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/redis.pb.ts CHANGED
@@ -6,6 +6,7 @@
6
6
 
7
7
  import * as CommonCommon from "./common.pb"
8
8
  import * as fm from "./fetch.pb"
9
+ import * as TemplateTemplate from "./template.pb"
9
10
 
10
11
  type Absent<T, K extends keyof T> = { [k in Exclude<keyof T, K>]?: undefined };
11
12
  type OneOf<T> =
@@ -34,6 +35,39 @@ export enum RedisPodType {
34
35
  Sentinel = "Sentinel",
35
36
  LeaderRedis = "LeaderRedis",
36
37
  FollowerRedis = "FollowerRedis",
38
+ SentinelRedisMaster = "SentinelRedisMaster",
39
+ SentinelRedisReplica = "SentinelRedisReplica",
40
+ }
41
+
42
+ export enum GetRedisBackupListReqSortDir {
43
+ ASC = "ASC",
44
+ DESC = "DESC",
45
+ }
46
+
47
+ export enum GetMinioListReqSortDir {
48
+ ASC = "ASC",
49
+ DESC = "DESC",
50
+ }
51
+
52
+ export enum GetRedisBackupListRespRedisBackupItemStatusStatus {
53
+ Running = "Running",
54
+ Failed = "Failed",
55
+ Succeeded = "Succeeded",
56
+ }
57
+
58
+ export enum CreateRedisBackupReqProvider {
59
+ Minio = "Minio",
60
+ Other = "Other",
61
+ }
62
+
63
+ export enum UpdateRedisAutoBackupReqProvider {
64
+ Minio = "Minio",
65
+ Other = "Other",
66
+ }
67
+
68
+ export enum GetRedisSlowLogListReqSortDir {
69
+ ASC = "ASC",
70
+ DESC = "DESC",
37
71
  }
38
72
 
39
73
  export enum GetRedisListReqSortDir {
@@ -46,10 +80,9 @@ export enum GetRedisConfReqSortDir {
46
80
  DESC = "DESC",
47
81
  }
48
82
 
49
- export enum CreateRedisReqServiceType {
50
- ClusterIP = "ClusterIP",
51
- NodePort = "NodePort",
52
- LoadBalancer = "LoadBalancer",
83
+ export enum CreateRedisReqRestoreProvider {
84
+ Minio = "Minio",
85
+ Other = "Other",
53
86
  }
54
87
 
55
88
  export enum GetRedisParamRespSelectSelectType {
@@ -76,6 +109,161 @@ export enum GetRedisConfRespItemsParamType {
76
109
  conf = "conf",
77
110
  }
78
111
 
112
+ export enum RedisItemStatusRestoreInitialStatus {
113
+ Unknown = "Unknown",
114
+ Running = "Running",
115
+ Failed = "Failed",
116
+ Succeeded = "Succeeded",
117
+ }
118
+
119
+ export type CreateRedisRecoverReq = {
120
+ workspaceId?: number
121
+ cluster?: string
122
+ namespace?: string
123
+ name?: string
124
+ backupName?: string
125
+ targetRedisName?: string
126
+ targetRedisNamespace?: string
127
+ targetRedisCluster?: string
128
+ instanceType?: InstanceType
129
+ }
130
+
131
+ export type CreateRedisRecoverResp = {
132
+ message?: string
133
+ }
134
+
135
+ export type DeleteRedisBackupReq = {
136
+ cluster?: string
137
+ namespace?: string
138
+ backupName?: string
139
+ isOpenAutoBackup?: boolean
140
+ instanceType?: InstanceType
141
+ }
142
+
143
+ export type DeleteRedisBackupResp = {
144
+ message?: string
145
+ }
146
+
147
+ export type GetRedisBackupListReq = {
148
+ page?: number
149
+ pageSize?: number
150
+ sortDir?: GetRedisBackupListReqSortDir
151
+ sortBy?: string
152
+ searchKey?: string
153
+ cluster?: string
154
+ namespace?: string
155
+ name?: string
156
+ }
157
+
158
+ export type GetMinioListReq = {
159
+ page?: number
160
+ pageSize?: number
161
+ sortDir?: GetMinioListReqSortDir
162
+ sortBy?: string
163
+ searchKey?: string
164
+ workspaceId?: number
165
+ }
166
+
167
+ export type GetMinioListResp = {
168
+ items?: TenantItem[]
169
+ pagination?: CommonCommon.Pagination
170
+ }
171
+
172
+ export type TenantItemCreateMinioReq = {
173
+ name?: string
174
+ namespace?: string
175
+ cluster?: string
176
+ }
177
+
178
+ export type TenantItem = {
179
+ apiVersion?: string
180
+ kind?: string
181
+ spec?: TenantItemCreateMinioReq
182
+ status?: TenantItemStatus
183
+ }
184
+
185
+ export type TenantItemStatus = {
186
+ common?: CommonCommon.CommonItemStatus
187
+ }
188
+
189
+ export type GetRedisBackupListRespRedisBackupItemMetadata = {
190
+ creationTimestamp?: string
191
+ name?: string
192
+ namespace?: string
193
+ }
194
+
195
+ export type GetRedisBackupListRespRedisBackupItemStatusJobCondition = {
196
+ type?: string
197
+ status?: string
198
+ reason?: string
199
+ message?: string
200
+ }
201
+
202
+ export type GetRedisBackupListRespRedisBackupItemStatus = {
203
+ completionTime?: string
204
+ startTime?: string
205
+ active?: number
206
+ succeeded?: number
207
+ failed?: number
208
+ conditions?: GetRedisBackupListRespRedisBackupItemStatusJobCondition[]
209
+ isAutoBackup?: boolean
210
+ status?: GetRedisBackupListRespRedisBackupItemStatusStatus
211
+ }
212
+
213
+ export type GetRedisBackupListRespRedisBackupItem = {
214
+ metadata?: GetRedisBackupListRespRedisBackupItemMetadata
215
+ spec?: CreateRedisBackupReq
216
+ status?: GetRedisBackupListRespRedisBackupItemStatus
217
+ }
218
+
219
+ export type GetRedisBackupListResp = {
220
+ items?: GetRedisBackupListRespRedisBackupItem[]
221
+ pagination?: CommonCommon.Pagination
222
+ }
223
+
224
+ export type CreateRedisBackupReq = {
225
+ cluster?: string
226
+ namespace?: string
227
+ name?: string
228
+ instanceType?: InstanceType
229
+ backupName?: string
230
+ accessKeyId?: string
231
+ accessKeySecret?: string
232
+ endpoint?: string
233
+ provider?: CreateRedisBackupReqProvider
234
+ storePath?: string
235
+ genCreateTime?: string
236
+ genBucket?: string
237
+ }
238
+
239
+ export type UpdateRedisAutoBackupReq = {
240
+ workspaceId?: number
241
+ cluster?: string
242
+ namespace?: string
243
+ name?: string
244
+ instanceType?: InstanceType
245
+ accessKeyId?: string
246
+ accessKeySecret?: string
247
+ endpoint?: string
248
+ provider?: UpdateRedisAutoBackupReqProvider
249
+ storePath?: string
250
+ isOpenAutoBackup?: boolean
251
+ backupSchedule?: string
252
+ backupHistoryLimit?: number
253
+ storageConfigName?: string
254
+ storageConfigNamespace?: string
255
+ storageConfigCluster?: string
256
+ bucket?: string
257
+ }
258
+
259
+ export type UpdateRedisAutoBackupResp = {
260
+ message?: string
261
+ }
262
+
263
+ export type CreateRedisBackupResp = {
264
+ message?: string
265
+ }
266
+
79
267
  export type GetRedisUsersReq = {
80
268
  cluster?: string
81
269
  namespace?: string
@@ -92,6 +280,20 @@ export type GetRedisUsersResp = {
92
280
  users?: GetRedisUsersRespUserItem[]
93
281
  }
94
282
 
283
+ export type GetRedisSlowLogListReq = {
284
+ page?: number
285
+ pageSize?: number
286
+ sortDir?: GetRedisSlowLogListReqSortDir
287
+ sortBy?: string
288
+ searchKey?: string
289
+ cluster?: string
290
+ namespace?: string
291
+ name?: string
292
+ date?: string
293
+ instanceType?: InstanceType
294
+ refresh?: boolean
295
+ }
296
+
95
297
  export type GetRedisListReq = {
96
298
  page?: number
97
299
  pageSize?: number
@@ -99,6 +301,8 @@ export type GetRedisListReq = {
99
301
  sortBy?: string
100
302
  searchKey?: string
101
303
  workspaceId?: number
304
+ filterCluster?: string
305
+ filterNamespace?: string
102
306
  }
103
307
 
104
308
  export type GetRedisConfReq = {
@@ -126,6 +330,20 @@ export type CreateRedisReqPorts = {
126
330
  nodePort?: number
127
331
  }
128
332
 
333
+ export type CreateRedisReqRestore = {
334
+ enable?: boolean
335
+ accessKeyId?: string
336
+ accessKeySecret?: string
337
+ endpoint?: string
338
+ provider?: CreateRedisReqRestoreProvider
339
+ storePath?: string
340
+ backupName?: string
341
+ targetRedisName?: string
342
+ targetRedisNamespace?: string
343
+ targetRedisCluster?: string
344
+ instanceType?: InstanceType
345
+ }
346
+
129
347
  export type CreateRedisReq = {
130
348
  cluster?: string
131
349
  namespace?: string
@@ -136,7 +354,7 @@ export type CreateRedisReq = {
136
354
  storageCapacity?: string
137
355
  instanceType?: InstanceType
138
356
  authPass?: string
139
- serviceType?: CreateRedisReqServiceType
357
+ serviceType?: CommonCommon.ServiceType
140
358
  serviceAnnotations?: {[key: string]: string}
141
359
  ports?: CreateRedisReqPorts[]
142
360
  cpuRequest?: string
@@ -144,9 +362,22 @@ export type CreateRedisReq = {
144
362
  memoryRequest?: string
145
363
  memoryLimit?: string
146
364
  conf?: string
365
+ confTemplateName?: string
147
366
  version?: string
148
367
  followerReplicas?: number
149
368
  affinity?: CommonCommon.Affinity
369
+ externalTrafficPolicy?: CommonCommon.ExternalTrafficPolicy
370
+ lbTyp?: CommonCommon.LBTyp
371
+ lbPoolName?: string
372
+ lbAddress?: string
373
+ restore?: CreateRedisReqRestore
374
+ autoBackupConfig?: UpdateRedisAutoBackupReq
375
+ serviceMonitorInterval?: string
376
+ accessWhitelist?: CommonCommon.AccessWhitelist
377
+ isExtraSvc?: boolean
378
+ hostNetwork?: boolean
379
+ hostNetworkPort?: number
380
+ hostNetworkExporterPort?: number
150
381
  }
151
382
 
152
383
  export type UpdateRedisConfReq = {
@@ -154,8 +385,9 @@ export type UpdateRedisConfReq = {
154
385
  namespace?: string
155
386
  name?: string
156
387
  authPass?: string
157
- conf?: string
158
388
  instanceType?: InstanceType
389
+ reloadFromConfTemplateName?: string
390
+ confItems?: TemplateTemplate.TemplateConfigItem[]
159
391
  }
160
392
 
161
393
  export type UpdateRedisParamsResp = {
@@ -283,6 +515,8 @@ export type GetRedisGrafanaAddrReq = {
283
515
  namespace?: string
284
516
  name?: string
285
517
  instanceType?: InstanceType
518
+ from?: string
519
+ to?: string
286
520
  }
287
521
 
288
522
  export type GetRedisGrafanaAddrResp = {
@@ -317,6 +551,19 @@ export type GetRedisListResp = {
317
551
  pagination?: CommonCommon.Pagination
318
552
  }
319
553
 
554
+ export type GetRedisSlowLogListRespItems = {
555
+ id?: string
556
+ timestamp?: string
557
+ spent?: string
558
+ command?: string[]
559
+ ip?: string
560
+ }
561
+
562
+ export type GetRedisSlowLogListResp = {
563
+ items?: GetRedisSlowLogListRespItems[]
564
+ pagination?: CommonCommon.Pagination
565
+ }
566
+
320
567
  export type RedisItemStatus = {
321
568
  status?: Status
322
569
  podsAreReadyNum?: number
@@ -325,6 +572,8 @@ export type RedisItemStatus = {
325
572
  serviceAddr?: string
326
573
  common?: CommonCommon.CommonItemStatus
327
574
  isControl?: boolean
575
+ restoreInitialStatus?: RedisItemStatusRestoreInitialStatus
576
+ extraSvcIpList?: string[]
328
577
  }
329
578
 
330
579
  export type RedisItemMetadata = {
@@ -342,6 +591,21 @@ export type RedisItem = {
342
591
  status?: RedisItemStatus
343
592
  }
344
593
 
594
+ export type CreateRedisShakeSyncReq = {
595
+ fromCluster?: string
596
+ fromNamespace?: string
597
+ fromName?: string
598
+ fromInstanceType?: InstanceType
599
+ targetCluster?: string
600
+ targetNamespace?: string
601
+ targetName?: string
602
+ targetInstanceType?: InstanceType
603
+ }
604
+
605
+ export type CreateRedisShakeSyncResp = {
606
+ message?: string
607
+ }
608
+
345
609
  export class Redis {
346
610
  static GetRedisList(req: GetRedisListReq, initReq?: fm.InitReq): Promise<GetRedisListResp> {
347
611
  return fm.fetchReq<GetRedisListReq, GetRedisListResp>(`/apis/mcamel.io/redis/v1alpha1/${req["workspaceId"]}/rediss?${fm.renderURLSearchParams(req, ["workspaceId"])}`, {...initReq, method: "GET"})
@@ -364,6 +628,9 @@ export class Redis {
364
628
  static CreateRedis(req: CreateRedisReq, initReq?: fm.InitReq): Promise<CreateRedisResp> {
365
629
  return fm.fetchReq<CreateRedisReq, CreateRedisResp>(`/apis/mcamel.io/redis/v1alpha1/redis`, {...initReq, method: "POST", body: JSON.stringify(req)})
366
630
  }
631
+ static CreateRedisShakeSync(req: CreateRedisShakeSyncReq, initReq?: fm.InitReq): Promise<CreateRedisShakeSyncResp> {
632
+ return fm.fetchReq<CreateRedisShakeSyncReq, CreateRedisShakeSyncResp>(`/apis/mcamel.io/redis/v1alpha1/redis-shake`, {...initReq, method: "POST", body: JSON.stringify(req)})
633
+ }
367
634
  static GetRedisConfs(req: GetRedisConfReq, initReq?: fm.InitReq): Promise<GetRedisConfResp> {
368
635
  return fm.fetchReq<GetRedisConfReq, GetRedisConfResp>(`/apis/mcamel.io/redis/v1alpha1/redis/${req["instanceType"]}/${req["cluster"]}/${req["namespace"]}/${req["name"]}/confs?${fm.renderURLSearchParams(req, ["instanceType", "cluster", "namespace", "name"])}`, {...initReq, method: "GET"})
369
636
  }
@@ -382,4 +649,25 @@ export class Redis {
382
649
  static GetRedisUsers(req: GetRedisUsersReq, initReq?: fm.InitReq): Promise<GetRedisUsersResp> {
383
650
  return fm.fetchReq<GetRedisUsersReq, GetRedisUsersResp>(`/apis/mcamel.io/redis/v1alpha1/redis/${req["instanceType"]}/${req["cluster"]}/${req["namespace"]}/${req["name"]}/users?${fm.renderURLSearchParams(req, ["instanceType", "cluster", "namespace", "name"])}`, {...initReq, method: "GET"})
384
651
  }
652
+ static CreateRedisBackup(req: CreateRedisBackupReq, initReq?: fm.InitReq): Promise<CreateRedisBackupResp> {
653
+ return fm.fetchReq<CreateRedisBackupReq, CreateRedisBackupResp>(`/apis/mcamel.io/redis/v1alpha1/redis/backup`, {...initReq, method: "POST", body: JSON.stringify(req)})
654
+ }
655
+ static UpdateRedisAutoBackup(req: UpdateRedisAutoBackupReq, initReq?: fm.InitReq): Promise<UpdateRedisAutoBackupResp> {
656
+ return fm.fetchReq<UpdateRedisAutoBackupReq, UpdateRedisAutoBackupResp>(`/apis/mcamel.io/redis/v1alpha1/redis/${req["cluster"]}/${req["namespace"]}/${req["name"]}/auto-backup`, {...initReq, method: "PUT", body: JSON.stringify(req)})
657
+ }
658
+ static GetRedisBackupList(req: GetRedisBackupListReq, initReq?: fm.InitReq): Promise<GetRedisBackupListResp> {
659
+ return fm.fetchReq<GetRedisBackupListReq, GetRedisBackupListResp>(`/apis/mcamel.io/redis/v1alpha1/redis/backups?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
660
+ }
661
+ static DeleteRedisBackup(req: DeleteRedisBackupReq, initReq?: fm.InitReq): Promise<DeleteRedisBackupResp> {
662
+ return fm.fetchReq<DeleteRedisBackupReq, DeleteRedisBackupResp>(`/apis/mcamel.io/redis/v1alpha1/redis/backups/${req["cluster"]}/${req["namespace"]}/${req["backupName"]}`, {...initReq, method: "DELETE"})
663
+ }
664
+ static GetMinioList(req: GetMinioListReq, initReq?: fm.InitReq): Promise<GetMinioListResp> {
665
+ return fm.fetchReq<GetMinioListReq, GetMinioListResp>(`/apis/mcamel.io/redis/v1alpha1/${req["workspaceId"]}/minios?${fm.renderURLSearchParams(req, ["workspaceId"])}`, {...initReq, method: "GET"})
666
+ }
667
+ static CreateRedisRecover(req: CreateRedisRecoverReq, initReq?: fm.InitReq): Promise<CreateRedisRecoverResp> {
668
+ return fm.fetchReq<CreateRedisRecoverReq, CreateRedisRecoverResp>(`/apis/mcamel.io/redis/v1alpha1/redis/${req["cluster"]}/${req["namespace"]}/${req["name"]}/recover`, {...initReq, method: "POST", body: JSON.stringify(req)})
669
+ }
670
+ static GetRedisSlowLogList(req: GetRedisSlowLogListReq, initReq?: fm.InitReq): Promise<GetRedisSlowLogListResp> {
671
+ return fm.fetchReq<GetRedisSlowLogListReq, GetRedisSlowLogListResp>(`/apis/mcamel.io/redis/v1alpha1/redis/${req["instanceType"]}/${req["cluster"]}/${req["namespace"]}/${req["name"]}/slowlogs?${fm.renderURLSearchParams(req, ["instanceType", "cluster", "namespace", "name"])}`, {...initReq, method: "GET"})
672
+ }
385
673
  }
@@ -0,0 +1,188 @@
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 CommonCommon from "./common.pb"
8
+ import * as fm from "./fetch.pb"
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
+ export enum GetStorageConfigParamRespSelectSelectType {
20
+ Single = "Single",
21
+ Multiple = "Multiple",
22
+ }
23
+
24
+ export enum GetStorageConfigConsumersRespStorageConfigConsumerType {
25
+ STORAGE_CONFIG_CONSUMER_TYPE_UNSPECIFIED = "STORAGE_CONFIG_CONSUMER_TYPE_UNSPECIFIED",
26
+ STORAGE_CONFIG_CONSUMER_TYPE_MYSQL = "STORAGE_CONFIG_CONSUMER_TYPE_MYSQL",
27
+ STORAGE_CONFIG_CONSUMER_TYPE_REDIS = "STORAGE_CONFIG_CONSUMER_TYPE_REDIS",
28
+ }
29
+
30
+ export enum GetStorageConfigListReqSortDir {
31
+ ASC = "ASC",
32
+ DESC = "DESC",
33
+ }
34
+
35
+ export type GetStorageConfigParamReq = {
36
+ }
37
+
38
+ export type GetStorageConfigParamRespSelectDataStringValue = {
39
+ value?: string
40
+ }
41
+
42
+ export type GetStorageConfigParamRespSelectDataIntValue = {
43
+ value?: number
44
+ }
45
+
46
+
47
+ type BaseGetStorageConfigParamRespSelectData = {
48
+ }
49
+
50
+ export type GetStorageConfigParamRespSelectData = BaseGetStorageConfigParamRespSelectData
51
+ & OneOf<{ sValue: GetStorageConfigParamRespSelectDataStringValue; iValue: GetStorageConfigParamRespSelectDataIntValue }>
52
+
53
+ export type GetStorageConfigParamRespSelect = {
54
+ selectType?: GetStorageConfigParamRespSelectSelectType
55
+ data?: GetStorageConfigParamRespSelectData[]
56
+ }
57
+
58
+ export type GetStorageConfigParamResp = {
59
+ storageType?: GetStorageConfigParamRespSelect
60
+ }
61
+
62
+ export type CreateStorageConfigBucketCheckJobReq = {
63
+ storageType?: string
64
+ endpoint?: string
65
+ accessKey?: string
66
+ secretKey?: string
67
+ bucket?: string
68
+ cluster?: string
69
+ namespace?: string
70
+ name?: string
71
+ }
72
+
73
+ export type CreateStorageConfigBucketCheckJobResp = {
74
+ message?: string
75
+ }
76
+
77
+ export type CreateStorageConfigReq = {
78
+ workspaceId?: number
79
+ cluster?: string
80
+ namespace?: string
81
+ name?: string
82
+ storageType?: string
83
+ accessKey?: string
84
+ secretKey?: string
85
+ bucket?: string
86
+ endpoint?: string
87
+ minioCluster?: string
88
+ minioNamespace?: string
89
+ minioName?: string
90
+ description?: string
91
+ }
92
+
93
+ export type CreateStorageConfigResp = {
94
+ message?: string
95
+ }
96
+
97
+ export type GetStorageConfigConsumersReq = {
98
+ workspaceId?: number
99
+ name?: string
100
+ }
101
+
102
+ export type GetStorageConfigConsumersRespConsumer = {
103
+ type?: GetStorageConfigConsumersRespStorageConfigConsumerType
104
+ cluster?: string
105
+ namespace?: string
106
+ name?: string
107
+ }
108
+
109
+ export type GetStorageConfigConsumersResp = {
110
+ consumers?: GetStorageConfigConsumersRespConsumer[]
111
+ }
112
+
113
+ export type DeleteStorageConfigReq = {
114
+ workspaceId?: number
115
+ name?: string
116
+ cluster?: string
117
+ namespace?: string
118
+ }
119
+
120
+ export type DeleteStorageConfigResp = {
121
+ message?: string
122
+ }
123
+
124
+ export type UpdateStorageConfigResp = {
125
+ message?: string
126
+ }
127
+
128
+ export type StorageConfigItemStorageConfigStatus = {
129
+ lastUpdateTimestamp?: string
130
+ createTimestamp?: string
131
+ }
132
+
133
+ export type StorageConfigItem = {
134
+ spec?: CreateStorageConfigReq
135
+ status?: StorageConfigItemStorageConfigStatus
136
+ }
137
+
138
+ export type GetStorageConfigReq = {
139
+ workspaceId?: number
140
+ name?: string
141
+ namespace?: string
142
+ cluster?: string
143
+ }
144
+
145
+ export type GetStorageConfigResp = {
146
+ item?: StorageConfigItem
147
+ }
148
+
149
+ export type GetStorageConfigListReq = {
150
+ page?: number
151
+ pageSize?: number
152
+ sortDir?: GetStorageConfigListReqSortDir
153
+ sortBy?: string
154
+ searchKey?: string
155
+ workspaceId?: number
156
+ }
157
+
158
+ export type GetStorageConfigListResp = {
159
+ items?: StorageConfigItem[]
160
+ pagination?: CommonCommon.Pagination
161
+ }
162
+
163
+ export class StorageConfig {
164
+ static GetStorageConfigParam(req: GetStorageConfigParamReq, initReq?: fm.InitReq): Promise<GetStorageConfigParamResp> {
165
+ return fm.fetchReq<GetStorageConfigParamReq, GetStorageConfigParamResp>(`/apis/mcamel.io/redis/v1alpha1/storage-config/param?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
166
+ }
167
+ static CreateStorageConfigBucketCheckJob(req: CreateStorageConfigBucketCheckJobReq, initReq?: fm.InitReq): Promise<CreateStorageConfigBucketCheckJobResp> {
168
+ return fm.fetchReq<CreateStorageConfigBucketCheckJobReq, CreateStorageConfigBucketCheckJobResp>(`/apis/mcamel.io/redis/v1alpha1/storage-config/bucket/check-job`, {...initReq, method: "POST", body: JSON.stringify(req)})
169
+ }
170
+ static CreateStorageConfig(req: CreateStorageConfigReq, initReq?: fm.InitReq): Promise<CreateStorageConfigResp> {
171
+ return fm.fetchReq<CreateStorageConfigReq, CreateStorageConfigResp>(`/apis/mcamel.io/redis/v1alpha1/${req["workspaceId"]}/storage-config`, {...initReq, method: "POST", body: JSON.stringify(req)})
172
+ }
173
+ static GetStorageConfigConsumers(req: GetStorageConfigConsumersReq, initReq?: fm.InitReq): Promise<GetStorageConfigConsumersResp> {
174
+ return fm.fetchReq<GetStorageConfigConsumersReq, GetStorageConfigConsumersResp>(`/apis/mcamel.io/redis/v1alpha1/${req["workspaceId"]}/storage-config/${req["name"]}/consumers?${fm.renderURLSearchParams(req, ["workspaceId", "name"])}`, {...initReq, method: "GET"})
175
+ }
176
+ static DeleteStorageConfig(req: DeleteStorageConfigReq, initReq?: fm.InitReq): Promise<DeleteStorageConfigResp> {
177
+ return fm.fetchReq<DeleteStorageConfigReq, DeleteStorageConfigResp>(`/apis/mcamel.io/redis/v1alpha1/${req["workspaceId"]}/storage-config/${req["cluster"]}/${req["namespace"]}/${req["name"]}`, {...initReq, method: "DELETE"})
178
+ }
179
+ static UpdateStorageConfig(req: CreateStorageConfigReq, initReq?: fm.InitReq): Promise<UpdateStorageConfigResp> {
180
+ return fm.fetchReq<CreateStorageConfigReq, UpdateStorageConfigResp>(`/apis/mcamel.io/redis/v1alpha1/${req["workspaceId"]}/storage-config/${req["name"]}`, {...initReq, method: "PUT", body: JSON.stringify(req)})
181
+ }
182
+ static GetStorageConfig(req: GetStorageConfigReq, initReq?: fm.InitReq): Promise<GetStorageConfigResp> {
183
+ return fm.fetchReq<GetStorageConfigReq, GetStorageConfigResp>(`/apis/mcamel.io/redis/v1alpha1/${req["workspaceId"]}/storage-config/${req["name"]}?${fm.renderURLSearchParams(req, ["workspaceId", "name"])}`, {...initReq, method: "GET"})
184
+ }
185
+ static GetStorageConfigList(req: GetStorageConfigListReq, initReq?: fm.InitReq): Promise<GetStorageConfigListResp> {
186
+ return fm.fetchReq<GetStorageConfigListReq, GetStorageConfigListResp>(`/apis/mcamel.io/redis/v1alpha1/${req["workspaceId"]}/storage-configs?${fm.renderURLSearchParams(req, ["workspaceId"])}`, {...initReq, method: "GET"})
187
+ }
188
+ }
package/template.pb.ts ADDED
@@ -0,0 +1,171 @@
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 CommonCommon from "./common.pb"
8
+ import * as fm from "./fetch.pb"
9
+
10
+ export enum TemplateInstanceType {
11
+ MysqlMasterReplica = "MysqlMasterReplica",
12
+ RedisStandalone = "RedisStandalone",
13
+ RedisFailover = "RedisFailover",
14
+ RedisCluster = "RedisCluster",
15
+ KafkaConfig = "KafkaConfig",
16
+ MysqlMgrConfig = "MysqlMgrConfig",
17
+ MongodbConfig = "MongodbConfig",
18
+ }
19
+
20
+ export enum GetTemplateConfigReqSortDir {
21
+ ASC = "ASC",
22
+ DESC = "DESC",
23
+ }
24
+
25
+ export enum GetTemplateConfigListReqSortDir {
26
+ ASC = "ASC",
27
+ DESC = "DESC",
28
+ }
29
+
30
+ export enum TemplateConfigItemValueType {
31
+ String = "String",
32
+ SingleSelection = "SingleSelection",
33
+ MultiString = "MultiString",
34
+ }
35
+
36
+ export type GetTemplateConfigVersionsReq = {
37
+ workspaceId?: number
38
+ }
39
+
40
+ export type GetTemplateConfigVersionsResp = {
41
+ versions?: string[]
42
+ }
43
+
44
+ export type GetTemplateConfigStringResp = {
45
+ conf?: string
46
+ }
47
+
48
+ export type DeleteTemplateReq = {
49
+ workspaceId?: number
50
+ name?: string
51
+ version?: string
52
+ }
53
+
54
+ export type DeleteTemplateConfigResp = {
55
+ message?: string
56
+ }
57
+
58
+ export type CreateOrUpdateTemplateConfigResp = {
59
+ message?: string
60
+ }
61
+
62
+ export type GetTemplateConfigReq = {
63
+ page?: number
64
+ pageSize?: number
65
+ sortDir?: GetTemplateConfigReqSortDir
66
+ sortBy?: string
67
+ searchKey?: string
68
+ workspaceId?: number
69
+ name?: string
70
+ version?: string
71
+ templateType?: string
72
+ type?: string
73
+ createTimestamp?: string
74
+ templateInstanceType?: TemplateInstanceType
75
+ }
76
+
77
+ export type CreateTemplateConfigResp = {
78
+ message?: string
79
+ }
80
+
81
+ export type UpdateTemplateConfigResp = {
82
+ message?: string
83
+ }
84
+
85
+ export type CreateTemplateConfigReq = {
86
+ workspaceId?: number
87
+ targetName?: string
88
+ targetVersion?: string
89
+ targetType?: string
90
+ targetTemplateType?: string
91
+ targetConf?: string
92
+ fromTemplateName?: string
93
+ }
94
+
95
+ export type UpdateTemplateConfigReq = {
96
+ workspaceId?: number
97
+ name?: string
98
+ version?: string
99
+ type?: string
100
+ templateType?: string
101
+ items?: TemplateConfigItem[]
102
+ conf?: string
103
+ }
104
+
105
+ export type GetTemplateConfigResp = {
106
+ data?: UpdateTemplateConfigReq
107
+ pagination?: CommonCommon.Pagination
108
+ }
109
+
110
+ export type GetTemplateConfigListReq = {
111
+ page?: number
112
+ pageSize?: number
113
+ sortDir?: GetTemplateConfigListReqSortDir
114
+ sortBy?: string
115
+ searchKey?: string
116
+ workspaceId?: number
117
+ version?: string
118
+ templateInstanceType?: TemplateInstanceType
119
+ }
120
+
121
+ export type TemplateConfigItem = {
122
+ name?: string
123
+ default?: string
124
+ current?: string
125
+ value?: string
126
+ isNeedRestart?: boolean
127
+ valueType?: TemplateConfigItemValueType
128
+ valueRemarksZh?: string
129
+ valueRemarksEn?: string
130
+ updateTimestamp?: string
131
+ }
132
+
133
+ export type GetTemplateConfigListResp = {
134
+ items?: GetTemplateConfigReq[]
135
+ pagination?: CommonCommon.Pagination
136
+ }
137
+
138
+ export type GetTemplateInstanceTypeListReq = {
139
+ workspaceId?: number
140
+ }
141
+
142
+ export type GetTemplateInstanceTypeListResp = {
143
+ type?: TemplateInstanceType[]
144
+ }
145
+
146
+ export class Template {
147
+ static GetTemplateConfigList(req: GetTemplateConfigListReq, initReq?: fm.InitReq): Promise<GetTemplateConfigListResp> {
148
+ return fm.fetchReq<GetTemplateConfigListReq, GetTemplateConfigListResp>(`/apis/mcamel.io/redis/v1alpha1/${req["workspaceId"]}/template_config?${fm.renderURLSearchParams(req, ["workspaceId"])}`, {...initReq, method: "GET"})
149
+ }
150
+ static GetTemplateInstanceTypeList(req: GetTemplateInstanceTypeListReq, initReq?: fm.InitReq): Promise<GetTemplateInstanceTypeListResp> {
151
+ return fm.fetchReq<GetTemplateInstanceTypeListReq, GetTemplateInstanceTypeListResp>(`/apis/mcamel.io/redis/v1alpha1/${req["workspaceId"]}/template_instance_type?${fm.renderURLSearchParams(req, ["workspaceId"])}`, {...initReq, method: "GET"})
152
+ }
153
+ static GetTemplateConfig(req: GetTemplateConfigReq, initReq?: fm.InitReq): Promise<GetTemplateConfigResp> {
154
+ return fm.fetchReq<GetTemplateConfigReq, GetTemplateConfigResp>(`/apis/mcamel.io/redis/v1alpha1/${req["workspaceId"]}/template_config/${req["name"]}?${fm.renderURLSearchParams(req, ["workspaceId", "name"])}`, {...initReq, method: "GET"})
155
+ }
156
+ static DeleteTemplateConfig(req: DeleteTemplateReq, initReq?: fm.InitReq): Promise<DeleteTemplateConfigResp> {
157
+ return fm.fetchReq<DeleteTemplateReq, DeleteTemplateConfigResp>(`/apis/mcamel.io/redis/v1alpha1/${req["workspaceId"]}/template_config/${req["name"]}/${req["version"]}`, {...initReq, method: "DELETE"})
158
+ }
159
+ static CreateTemplateConfig(req: CreateTemplateConfigReq, initReq?: fm.InitReq): Promise<CreateTemplateConfigResp> {
160
+ return fm.fetchReq<CreateTemplateConfigReq, CreateTemplateConfigResp>(`/apis/mcamel.io/redis/v1alpha1/${req["workspaceId"]}/template_config`, {...initReq, method: "POST", body: JSON.stringify(req)})
161
+ }
162
+ static UpdateTemplateConfig(req: UpdateTemplateConfigReq, initReq?: fm.InitReq): Promise<UpdateTemplateConfigResp> {
163
+ return fm.fetchReq<UpdateTemplateConfigReq, UpdateTemplateConfigResp>(`/apis/mcamel.io/redis/v1alpha1/${req["workspaceId"]}/template_config`, {...initReq, method: "PUT", body: JSON.stringify(req)})
164
+ }
165
+ static GetTemplateConfigString(req: GetTemplateConfigReq, initReq?: fm.InitReq): Promise<GetTemplateConfigStringResp> {
166
+ return fm.fetchReq<GetTemplateConfigReq, GetTemplateConfigStringResp>(`/apis/mcamel.io/redis/v1alpha1/${req["workspaceId"]}/template_config/${req["name"]}/to_string?${fm.renderURLSearchParams(req, ["workspaceId", "name"])}`, {...initReq, method: "GET"})
167
+ }
168
+ static GetTemplateConfigVersions(req: GetTemplateConfigVersionsReq, initReq?: fm.InitReq): Promise<GetTemplateConfigVersionsResp> {
169
+ return fm.fetchReq<GetTemplateConfigVersionsReq, GetTemplateConfigVersionsResp>(`/apis/mcamel.io/redis/v1alpha1/${req["workspaceId"]}/template_config/versions?${fm.renderURLSearchParams(req, ["workspaceId"])}`, {...initReq, method: "GET"})
170
+ }
171
+ }