@daocloud-proto/mcamel-mysql 0.1.1-10

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 ADDED
@@ -0,0 +1,51 @@
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
+ export type GetWorkspaceListReq = {
10
+ }
11
+
12
+ export type GetWorkspaceListRespItem = {
13
+ workspaceId?: number
14
+ alias?: string
15
+ }
16
+
17
+ export type GetWorkspaceListResp = {
18
+ items?: GetWorkspaceListRespItem[]
19
+ pagination?: CommonCommon.Pagination
20
+ }
21
+
22
+ export type GetClusterListReq = {
23
+ workspaceId?: number
24
+ }
25
+
26
+ export type GetClusterListResp = {
27
+ items?: string[]
28
+ pagination?: CommonCommon.Pagination
29
+ }
30
+
31
+ export type GetClusterNamespaceListReq = {
32
+ workspaceId?: number
33
+ cluster?: string
34
+ }
35
+
36
+ export type GetClusterNamespaceListResp = {
37
+ items?: string[]
38
+ pagination?: CommonCommon.Pagination
39
+ }
40
+
41
+ export class Cluster {
42
+ static GetClusterList(req: GetClusterListReq, initReq?: fm.InitReq): Promise<GetClusterListResp> {
43
+ return fm.fetchReq<GetClusterListReq, GetClusterListResp>(`/apis/mcamel.io/mysql/v1alpha1/${req["workspaceId"]}/clusters?${fm.renderURLSearchParams(req, ["workspaceId"])}`, {...initReq, method: "GET"})
44
+ }
45
+ static GetClusterNamespaceList(req: GetClusterNamespaceListReq, initReq?: fm.InitReq): Promise<GetClusterNamespaceListResp> {
46
+ return fm.fetchReq<GetClusterNamespaceListReq, GetClusterNamespaceListResp>(`/apis/mcamel.io/mysql/v1alpha1/${req["workspaceId"]}/${req["cluster"]}/namespaces?${fm.renderURLSearchParams(req, ["workspaceId", "cluster"])}`, {...initReq, method: "GET"})
47
+ }
48
+ static GetWorkspaceList(req: GetWorkspaceListReq, initReq?: fm.InitReq): Promise<GetWorkspaceListResp> {
49
+ return fm.fetchReq<GetWorkspaceListReq, GetWorkspaceListResp>(`/apis/mcamel.io/mysql/v1alpha1/workspaces?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
50
+ }
51
+ }
package/common.pb.ts ADDED
@@ -0,0 +1,24 @@
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 PageInfoReqSortDir {
8
+ ASC = "ASC",
9
+ DESC = "DESC",
10
+ }
11
+
12
+ export type Pagination = {
13
+ total?: number
14
+ page?: number
15
+ pageSize?: number
16
+ pages?: number
17
+ }
18
+
19
+ export type PageInfoReq = {
20
+ page?: number
21
+ pageSize?: number
22
+ sortDir?: PageInfoReqSortDir
23
+ sortBy?: string
24
+ }
package/fetch.pb.ts ADDED
@@ -0,0 +1,232 @@
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 interface InitReq extends RequestInit {
8
+ pathPrefix?: string
9
+ }
10
+
11
+ export function fetchReq<I, O>(path: string, init?: InitReq): Promise<O> {
12
+ const {pathPrefix, ...req} = init || {}
13
+
14
+ const url = pathPrefix ? `${pathPrefix}${path}` : path
15
+
16
+ return fetch(url, req).then(r => r.json().then((body: O) => {
17
+ if (!r.ok) { throw body; }
18
+ return body;
19
+ })) as Promise<O>
20
+ }
21
+
22
+ // NotifyStreamEntityArrival is a callback that will be called on streaming entity arrival
23
+ export type NotifyStreamEntityArrival<T> = (resp: T) => void
24
+
25
+ /**
26
+ * fetchStreamingRequest is able to handle grpc-gateway server side streaming call
27
+ * it takes NotifyStreamEntityArrival that lets users respond to entity arrival during the call
28
+ * all entities will be returned as an array after the call finishes.
29
+ **/
30
+ export async function fetchStreamingRequest<S, R>(path: string, callback?: NotifyStreamEntityArrival<R>, init?: InitReq) {
31
+ const {pathPrefix, ...req} = init || {}
32
+ const url = pathPrefix ?`${pathPrefix}${path}` : path
33
+ const result = await fetch(url, req)
34
+ // needs to use the .ok to check the status of HTTP status code
35
+ // http other than 200 will not throw an error, instead the .ok will become false.
36
+ // see https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch#
37
+ if (!result.ok) {
38
+ const resp = await result.json()
39
+ const errMsg = resp.error && resp.error.message ? resp.error.message : ""
40
+ throw new Error(errMsg)
41
+ }
42
+
43
+ if (!result.body) {
44
+ throw new Error("response doesnt have a body")
45
+ }
46
+
47
+ await result.body
48
+ .pipeThrough(new TextDecoderStream())
49
+ .pipeThrough<R>(getNewLineDelimitedJSONDecodingStream<R>())
50
+ .pipeTo(getNotifyEntityArrivalSink((e: R) => {
51
+ if (callback) {
52
+ callback(e)
53
+ }
54
+ }))
55
+
56
+ // wait for the streaming to finish and return the success respond
57
+ return
58
+ }
59
+
60
+ /**
61
+ * JSONStringStreamController represents the transform controller that's able to transform the incoming
62
+ * new line delimited json content stream into entities and able to push the entity to the down stream
63
+ */
64
+ interface JSONStringStreamController<T> extends TransformStreamDefaultController {
65
+ buf?: string
66
+ pos?: number
67
+ enqueue: (s: T) => void
68
+ }
69
+
70
+ /**
71
+ * getNewLineDelimitedJSONDecodingStream returns a TransformStream that's able to handle new line delimited json stream content into parsed entities
72
+ */
73
+ function getNewLineDelimitedJSONDecodingStream<T>(): TransformStream<string, T> {
74
+ return new TransformStream({
75
+ start(controller: JSONStringStreamController<T>) {
76
+ controller.buf = ''
77
+ controller.pos = 0
78
+ },
79
+
80
+ transform(chunk: string, controller: JSONStringStreamController<T>) {
81
+ if (controller.buf === undefined) {
82
+ controller.buf = ''
83
+ }
84
+ if (controller.pos === undefined) {
85
+ controller.pos = 0
86
+ }
87
+ controller.buf += chunk
88
+ while (controller.pos < controller.buf.length) {
89
+ if (controller.buf[controller.pos] === '\n') {
90
+ const line = controller.buf.substring(0, controller.pos)
91
+ const response = JSON.parse(line)
92
+ controller.enqueue(response.result)
93
+ controller.buf = controller.buf.substring(controller.pos + 1)
94
+ controller.pos = 0
95
+ } else {
96
+ ++controller.pos
97
+ }
98
+ }
99
+ }
100
+ })
101
+
102
+ }
103
+
104
+ /**
105
+ * getNotifyEntityArrivalSink takes the NotifyStreamEntityArrival callback and return
106
+ * a sink that will call the callback on entity arrival
107
+ * @param notifyCallback
108
+ */
109
+ function getNotifyEntityArrivalSink<T>(notifyCallback: NotifyStreamEntityArrival<T>) {
110
+ return new WritableStream<T>({
111
+ write(entity: T) {
112
+ notifyCallback(entity)
113
+ }
114
+ })
115
+ }
116
+
117
+ type Primitive = string | boolean | number;
118
+ type RequestPayload = Record<string, unknown>;
119
+ type FlattenedRequestPayload = Record<string, Primitive | Array<Primitive>>;
120
+
121
+ /**
122
+ * Checks if given value is a plain object
123
+ * Logic copied and adapted from below source:
124
+ * https://github.com/char0n/ramda-adjunct/blob/master/src/isPlainObj.js
125
+ * @param {unknown} value
126
+ * @return {boolean}
127
+ */
128
+ function isPlainObject(value: unknown): boolean {
129
+ const isObject =
130
+ Object.prototype.toString.call(value).slice(8, -1) === "Object";
131
+ const isObjLike = value !== null && isObject;
132
+
133
+ if (!isObjLike || !isObject) {
134
+ return false;
135
+ }
136
+
137
+ const proto = Object.getPrototypeOf(value);
138
+
139
+ const hasObjectConstructor =
140
+ typeof proto === "object" &&
141
+ proto.constructor === Object.prototype.constructor;
142
+
143
+ return hasObjectConstructor;
144
+ }
145
+
146
+ /**
147
+ * Checks if given value is of a primitive type
148
+ * @param {unknown} value
149
+ * @return {boolean}
150
+ */
151
+ function isPrimitive(value: unknown): boolean {
152
+ return ["string", "number", "boolean"].some(t => typeof value === t);
153
+ }
154
+
155
+ /**
156
+ * Checks if given primitive is zero-value
157
+ * @param {Primitive} value
158
+ * @return {boolean}
159
+ */
160
+ function isZeroValuePrimitive(value: Primitive): boolean {
161
+ return value === false || value === 0 || value === "";
162
+ }
163
+
164
+ /**
165
+ * Flattens a deeply nested request payload and returns an object
166
+ * with only primitive values and non-empty array of primitive values
167
+ * as per https://github.com/googleapis/googleapis/blob/master/google/api/http.proto
168
+ * @param {RequestPayload} requestPayload
169
+ * @param {String} path
170
+ * @return {FlattenedRequestPayload>}
171
+ */
172
+ function flattenRequestPayload<T extends RequestPayload>(
173
+ requestPayload: T,
174
+ path: string = ""
175
+ ): FlattenedRequestPayload {
176
+ return Object.keys(requestPayload).reduce(
177
+ (acc: T, key: string): T => {
178
+ const value = requestPayload[key];
179
+ const newPath = path ? [path, key].join(".") : key;
180
+
181
+ const isNonEmptyPrimitiveArray =
182
+ Array.isArray(value) &&
183
+ value.every(v => isPrimitive(v)) &&
184
+ value.length > 0;
185
+
186
+ const isNonZeroValuePrimitive =
187
+ isPrimitive(value) && !isZeroValuePrimitive(value as Primitive);
188
+
189
+ let objectToMerge = {};
190
+
191
+ if (isPlainObject(value)) {
192
+ objectToMerge = flattenRequestPayload(value as RequestPayload, newPath);
193
+ } else if (isNonZeroValuePrimitive || isNonEmptyPrimitiveArray) {
194
+ objectToMerge = { [newPath]: value };
195
+ }
196
+
197
+ return { ...acc, ...objectToMerge };
198
+ },
199
+ {} as T
200
+ ) as FlattenedRequestPayload;
201
+ }
202
+
203
+ /**
204
+ * Renders a deeply nested request payload into a string of URL search
205
+ * parameters by first flattening the request payload and then removing keys
206
+ * which are already present in the URL path.
207
+ * @param {RequestPayload} requestPayload
208
+ * @param {string[]} urlPathParams
209
+ * @return {string}
210
+ */
211
+ export function renderURLSearchParams<T extends RequestPayload>(
212
+ requestPayload: T,
213
+ urlPathParams: string[] = []
214
+ ): string {
215
+ const flattenedRequestPayload = flattenRequestPayload(requestPayload);
216
+
217
+ const urlSearchParams = Object.keys(flattenedRequestPayload).reduce(
218
+ (acc: string[][], key: string): string[][] => {
219
+ // key should not be present in the url path as a parameter
220
+ const value = flattenedRequestPayload[key];
221
+ if (urlPathParams.find(f => f === key)) {
222
+ return acc;
223
+ }
224
+ return Array.isArray(value)
225
+ ? [...acc, ...value.map(m => [key, m.toString()])]
226
+ : (acc = [...acc, [key, value.toString()]]);
227
+ },
228
+ [] as string[][]
229
+ );
230
+
231
+ return new URLSearchParams(urlSearchParams).toString();
232
+ }
package/mysql.pb.ts ADDED
@@ -0,0 +1,533 @@
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 Status {
20
+ Failed = "Failed",
21
+ Running = "Running",
22
+ Creating = "Creating",
23
+ }
24
+
25
+ export enum GetMysqlBackupListReqSortDir {
26
+ ASC = "ASC",
27
+ DESC = "DESC",
28
+ }
29
+
30
+ export enum GetMysqlBackupJobListReqSortDir {
31
+ ASC = "ASC",
32
+ DESC = "DESC",
33
+ }
34
+
35
+ export enum GetMysqlBackupListRespGetMysqlBackupItemStatusStatus {
36
+ Failed = "Failed",
37
+ Running = "Running",
38
+ Complete = "Complete",
39
+ }
40
+
41
+ export enum GetMysqlBackupJobListRespGetMysqlBackupJobItemStatusStatus {
42
+ Failed = "Failed",
43
+ Running = "Running",
44
+ Complete = "Complete",
45
+ }
46
+
47
+ export enum GetMysqlListReqSortDir {
48
+ ASC = "ASC",
49
+ DESC = "DESC",
50
+ }
51
+
52
+ export enum GetMysqlConfReqSortDir {
53
+ ASC = "ASC",
54
+ DESC = "DESC",
55
+ }
56
+
57
+ export enum CreateMysqlReqServiceType {
58
+ ClusterIP = "ClusterIP",
59
+ NodePort = "NodePort",
60
+ LoadBalancer = "LoadBalancer",
61
+ }
62
+
63
+ export enum GetMysqlParamRespSelectSelectType {
64
+ Single = "Single",
65
+ Multiple = "Multiple",
66
+ }
67
+
68
+ export enum GetMysqlNodeListRespPodStatus {
69
+ PHASE_UNSPECIFIED = "PHASE_UNSPECIFIED",
70
+ Unknown = "Unknown",
71
+ Pending = "Pending",
72
+ Running = "Running",
73
+ Succeeded = "Succeeded",
74
+ Failed = "Failed",
75
+ }
76
+
77
+ export enum GetMysqlConfRespItemsParamType {
78
+ conf = "conf",
79
+ }
80
+
81
+ export type GetMysqlBackupListReq = {
82
+ page?: number
83
+ pageSize?: number
84
+ sortDir?: GetMysqlBackupListReqSortDir
85
+ sortBy?: string
86
+ searchKey?: string
87
+ cluster?: string
88
+ namespace?: string
89
+ name?: string
90
+ }
91
+
92
+ export type GetMysqlBackupJobListReq = {
93
+ page?: number
94
+ pageSize?: number
95
+ sortDir?: GetMysqlBackupJobListReqSortDir
96
+ sortBy?: string
97
+ searchKey?: string
98
+ cluster?: string
99
+ namespace?: string
100
+ name?: string
101
+ backupName?: string
102
+ }
103
+
104
+ export type GetMysqlBackupSecretReq = {
105
+ workspaceId?: number
106
+ }
107
+
108
+ export type GetMysqlBackupProviderListReq = {
109
+ workspaceId?: number
110
+ }
111
+
112
+ export type GetMysqlBackupListRespGetMysqlBackupItemStatus = {
113
+ status?: GetMysqlBackupListRespGetMysqlBackupItemStatusStatus
114
+ message?: string
115
+ }
116
+
117
+ export type GetMysqlBackupListRespGetMysqlBackupItem = {
118
+ spec?: CreateMysqlBackupReq
119
+ status?: GetMysqlBackupListRespGetMysqlBackupItemStatus
120
+ }
121
+
122
+ export type GetMysqlBackupListResp = {
123
+ items?: GetMysqlBackupListRespGetMysqlBackupItem[]
124
+ pagination?: CommonCommon.Pagination
125
+ }
126
+
127
+ export type GetMysqlBackupJobListRespGetMysqlBackupJobItemGetMysqlBackupJobItemSpec = {
128
+ name?: string
129
+ namespace?: string
130
+ creationTimestamp?: number
131
+ parallelism?: number
132
+ completions?: number
133
+ }
134
+
135
+ export type GetMysqlBackupJobListRespGetMysqlBackupJobItemStatus = {
136
+ status?: GetMysqlBackupJobListRespGetMysqlBackupJobItemStatusStatus
137
+ message?: string
138
+ }
139
+
140
+ export type GetMysqlBackupJobListRespGetMysqlBackupJobItem = {
141
+ spec?: GetMysqlBackupJobListRespGetMysqlBackupJobItemGetMysqlBackupJobItemSpec
142
+ status?: GetMysqlBackupJobListRespGetMysqlBackupJobItemStatus
143
+ }
144
+
145
+ export type GetMysqlBackupJobListResp = {
146
+ items?: GetMysqlBackupJobListRespGetMysqlBackupJobItem[]
147
+ pagination?: CommonCommon.Pagination
148
+ }
149
+
150
+ export type GetMysqlBackupSecretResp = {
151
+ data?: SetMysqlBackupSecretReq
152
+ }
153
+
154
+ export type SetMysqlBackupSecretReq = {
155
+ workspaceId?: number
156
+ cluster?: string
157
+ namespace?: string
158
+ name?: string
159
+ accessKey?: string
160
+ secretKey?: string
161
+ endpoint?: string
162
+ provider?: string
163
+ }
164
+
165
+ export type CreateMysqlBackupReq = {
166
+ workspaceId?: number
167
+ cluster?: string
168
+ namespace?: string
169
+ name?: string
170
+ backupName?: string
171
+ backupUrl?: string
172
+ }
173
+
174
+ export type CreateMysqlBackupResp = {
175
+ message?: string
176
+ }
177
+
178
+ export type SetMysqlBackupSecretResp = {
179
+ message?: string
180
+ }
181
+
182
+ export type DeleteMysqlBackupReq = {
183
+ cluster?: string
184
+ namespace?: string
185
+ name?: string
186
+ }
187
+
188
+ export type DeleteMysqlBackupResp = {
189
+ message?: string
190
+ }
191
+
192
+ export type GetMysqlListReq = {
193
+ page?: number
194
+ pageSize?: number
195
+ sortDir?: GetMysqlListReqSortDir
196
+ sortBy?: string
197
+ searchKey?: string
198
+ workspaceId?: number
199
+ }
200
+
201
+ export type GetMysqlConfReq = {
202
+ page?: number
203
+ pageSize?: number
204
+ sortDir?: GetMysqlConfReqSortDir
205
+ sortBy?: string
206
+ searchKey?: string
207
+ cluster?: string
208
+ namespace?: string
209
+ name?: string
210
+ }
211
+
212
+ export type GetMysqlParamReq = {
213
+ cluster?: string
214
+ }
215
+
216
+ export type CreateMysqlReqPorts = {
217
+ name?: string
218
+ protocol?: string
219
+ port?: number
220
+ targetPort?: number
221
+ nodePort?: number
222
+ }
223
+
224
+ export type CreateMysqlReq = {
225
+ workspaceId?: number
226
+ cluster?: string
227
+ namespace?: string
228
+ name?: string
229
+ describe?: string
230
+ version?: string
231
+ replicas?: number
232
+ storageClassName?: string
233
+ storageCapacity?: string
234
+ rootPassword?: string
235
+ serviceType?: CreateMysqlReqServiceType
236
+ serviceAnnotations?: {[key: string]: string}
237
+ ports?: CreateMysqlReqPorts[]
238
+ cpuRequest?: string
239
+ cpuLimit?: string
240
+ memoryRequest?: string
241
+ memoryLimit?: string
242
+ conf?: string
243
+ backupSchedule?: string
244
+ backupSecretName?: string
245
+ backupUrl?: string
246
+ isOpenPhpAdmin?: boolean
247
+ phpAdminServiceType?: CreateMysqlReqServiceType
248
+ phpAdminNodePort?: number
249
+ phpAdminCpuRequest?: string
250
+ phpAdminCpuLimit?: string
251
+ phpAdminMemoryRequest?: string
252
+ phpAdminMemoryLimit?: string
253
+ }
254
+
255
+ export type UpdateMysqlConfReq = {
256
+ cluster?: string
257
+ namespace?: string
258
+ name?: string
259
+ conf?: string
260
+ }
261
+
262
+ export type UpdateMysqlParamsReq = {
263
+ cluster?: string
264
+ namespace?: string
265
+ name?: string
266
+ replicas?: number
267
+ storageCapacity?: string
268
+ serviceType?: CreateMysqlReqServiceType
269
+ serviceAnnotations?: {[key: string]: string}
270
+ describe?: string
271
+ ports?: CreateMysqlReqPorts[]
272
+ cpuRequest?: string
273
+ cpuLimit?: string
274
+ memoryRequest?: string
275
+ memoryLimit?: string
276
+ version?: string
277
+ }
278
+
279
+ export type UpdateMysqlParamsResp = {
280
+ message?: string
281
+ }
282
+
283
+ export type UpdateMysqlConfResp = {
284
+ message?: string
285
+ }
286
+
287
+ export type GetMysqlParamRespSelectDataStringValue = {
288
+ value?: string
289
+ }
290
+
291
+ export type GetMysqlParamRespSelectDataResourceValue = {
292
+ cpuRequest?: string
293
+ cpuLimit?: string
294
+ memoryRequest?: string
295
+ memoryLimit?: string
296
+ }
297
+
298
+ export type GetMysqlParamRespSelectDataIntValue = {
299
+ value?: number
300
+ }
301
+
302
+
303
+ type BaseGetMysqlParamRespSelectData = {
304
+ }
305
+
306
+ export type GetMysqlParamRespSelectData = BaseGetMysqlParamRespSelectData
307
+ & OneOf<{ sValue: GetMysqlParamRespSelectDataStringValue; rValue: GetMysqlParamRespSelectDataResourceValue; iValue: GetMysqlParamRespSelectDataIntValue }>
308
+
309
+ export type GetMysqlParamRespSelect = {
310
+ selectType?: GetMysqlParamRespSelectSelectType
311
+ data?: GetMysqlParamRespSelectData[]
312
+ }
313
+
314
+ export type GetMysqlParamResp = {
315
+ version?: GetMysqlParamRespSelect
316
+ replicas?: GetMysqlParamRespSelect
317
+ resource?: GetMysqlParamRespSelect
318
+ storage?: GetMysqlParamRespSelect
319
+ cnf?: GetMysqlParamRespSelect
320
+ }
321
+
322
+ export type GetMysqlBackupProviderListResp = {
323
+ provider?: GetMysqlParamRespSelect
324
+ }
325
+
326
+ export type CreateMysqlResp = {
327
+ message?: string
328
+ }
329
+
330
+ export type GetMysqlOperatorVersionListReq = {
331
+ }
332
+
333
+ export type GetMysqlOperatorVersionListRespGetMysqlOperatorVersionListData = {
334
+ cluster?: string
335
+ namespace?: string
336
+ version?: string
337
+ }
338
+
339
+ export type GetMysqlOperatorVersionListResp = {
340
+ items?: GetMysqlOperatorVersionListRespGetMysqlOperatorVersionListData[]
341
+ pagination?: CommonCommon.Pagination
342
+ }
343
+
344
+ export type DeleteMysqlReq = {
345
+ cluster?: string
346
+ namespace?: string
347
+ name?: string
348
+ }
349
+
350
+ export type DeleteMysqlsReq = {
351
+ data?: DeleteMysqlReq[]
352
+ }
353
+
354
+ export type DeleteMysqlResp = {
355
+ message?: string
356
+ }
357
+
358
+ export type DeleteMysqlsResp = {
359
+ message?: string
360
+ }
361
+
362
+ export type GetMysqlNodeListReq = {
363
+ cluster?: string
364
+ namespace?: string
365
+ name?: string
366
+ }
367
+
368
+ export type GetMysqlNodeListRespData = {
369
+ podName?: string
370
+ status?: GetMysqlNodeListRespPodStatus
371
+ ip?: string
372
+ restart?: number
373
+ cpuUsage?: number
374
+ cpuLimit?: number
375
+ memoryUsage?: number
376
+ memoryLimit?: number
377
+ createTime?: string
378
+ nodeType?: string
379
+ }
380
+
381
+ export type GetMysqlNodeListResp = {
382
+ items?: GetMysqlNodeListRespData[]
383
+ pagination?: CommonCommon.Pagination
384
+ }
385
+
386
+ export type GetMysqlGrafanaAddrReq = {
387
+ cluster?: string
388
+ namespace?: string
389
+ name?: string
390
+ }
391
+
392
+ export type GetMysqlGrafanaAddrResp = {
393
+ data?: string
394
+ }
395
+
396
+ export type GetMysqlReq = {
397
+ cluster?: string
398
+ namespace?: string
399
+ name?: string
400
+ }
401
+
402
+ export type DeleteMysqlAutoBackupReq = {
403
+ workspaceId?: number
404
+ cluster?: string
405
+ namespace?: string
406
+ name?: string
407
+ }
408
+
409
+ export type CreateMysqlAutoBackupReq = {
410
+ workspaceId?: number
411
+ cluster?: string
412
+ namespace?: string
413
+ name?: string
414
+ backupSchedule?: string
415
+ backupUrl?: string
416
+ }
417
+
418
+ export type CreateMysqlAutoBackupResp = {
419
+ message?: string
420
+ }
421
+
422
+ export type DeleteMysqlAutoBackupResp = {
423
+ message?: string
424
+ }
425
+
426
+ export type GetMysqlResp = {
427
+ data?: MysqlClusterItem
428
+ }
429
+
430
+ export type GetMysqlConfRespItems = {
431
+ paramType?: GetMysqlConfRespItemsParamType
432
+ paramName?: string
433
+ value?: string
434
+ }
435
+
436
+ export type GetMysqlConfResp = {
437
+ items?: GetMysqlConfRespItems[]
438
+ pagination?: CommonCommon.Pagination
439
+ conf?: UpdateMysqlConfReq
440
+ }
441
+
442
+ export type GetMysqlListResp = {
443
+ items?: MysqlClusterItem[]
444
+ pagination?: CommonCommon.Pagination
445
+ }
446
+
447
+ export type MysqlClusterItemStatus = {
448
+ status?: Status
449
+ podsAreReadyNum?: number
450
+ webManagerAddr?: string
451
+ clusterIPs?: string[]
452
+ }
453
+
454
+ export type MysqlClusterItemMetadata = {
455
+ annotations?: {[key: string]: string}
456
+ creationTimestamp?: number
457
+ name?: string
458
+ namespace?: string
459
+ }
460
+
461
+ export type MysqlClusterItem = {
462
+ apiVersion?: string
463
+ kind?: string
464
+ metadata?: MysqlClusterItemMetadata
465
+ spec?: CreateMysqlReq
466
+ status?: MysqlClusterItemStatus
467
+ }
468
+
469
+ export class Mysql {
470
+ static GetMysqlList(req: GetMysqlListReq, initReq?: fm.InitReq): Promise<GetMysqlListResp> {
471
+ return fm.fetchReq<GetMysqlListReq, GetMysqlListResp>(`/apis/mcamel.io/mysql/v1alpha1/${req["workspaceId"]}/mysqls?${fm.renderURLSearchParams(req, ["workspaceId"])}`, {...initReq, method: "GET"})
472
+ }
473
+ static GetMysqlOperatorVersionList(req: GetMysqlOperatorVersionListReq, initReq?: fm.InitReq): Promise<GetMysqlOperatorVersionListResp> {
474
+ return fm.fetchReq<GetMysqlOperatorVersionListReq, GetMysqlOperatorVersionListResp>(`/apis/mcamel.io/mysql/v1alpha1/mysql-operator/versions?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
475
+ }
476
+ static GetMysql(req: GetMysqlReq, initReq?: fm.InitReq): Promise<GetMysqlResp> {
477
+ return fm.fetchReq<GetMysqlReq, GetMysqlResp>(`/apis/mcamel.io/mysql/v1alpha1/mysql/${req["cluster"]}/${req["namespace"]}/${req["name"]}?${fm.renderURLSearchParams(req, ["cluster", "namespace", "name"])}`, {...initReq, method: "GET"})
478
+ }
479
+ static GetMysqlParam(req: GetMysqlParamReq, initReq?: fm.InitReq): Promise<GetMysqlParamResp> {
480
+ return fm.fetchReq<GetMysqlParamReq, GetMysqlParamResp>(`/apis/mcamel.io/mysql/v1alpha1/mysql-params/${req["cluster"]}?${fm.renderURLSearchParams(req, ["cluster"])}`, {...initReq, method: "GET"})
481
+ }
482
+ static GetMysqlNodeList(req: GetMysqlNodeListReq, initReq?: fm.InitReq): Promise<GetMysqlNodeListResp> {
483
+ return fm.fetchReq<GetMysqlNodeListReq, GetMysqlNodeListResp>(`/apis/mcamel.io/mysql/v1alpha1/mysql/${req["cluster"]}/${req["namespace"]}/${req["name"]}/nodes?${fm.renderURLSearchParams(req, ["cluster", "namespace", "name"])}`, {...initReq, method: "GET"})
484
+ }
485
+ static GetMysqlGrafanaAddr(req: GetMysqlGrafanaAddrReq, initReq?: fm.InitReq): Promise<GetMysqlGrafanaAddrResp> {
486
+ return fm.fetchReq<GetMysqlGrafanaAddrReq, GetMysqlGrafanaAddrResp>(`/apis/mcamel.io/mysql/v1alpha1/mysql/${req["cluster"]}/${req["namespace"]}/${req["name"]}/grafana?${fm.renderURLSearchParams(req, ["cluster", "namespace", "name"])}`, {...initReq, method: "GET"})
487
+ }
488
+ static CreateMysql(req: CreateMysqlReq, initReq?: fm.InitReq): Promise<CreateMysqlResp> {
489
+ return fm.fetchReq<CreateMysqlReq, CreateMysqlResp>(`/apis/mcamel.io/mysql/v1alpha1/mysql`, {...initReq, method: "POST", body: JSON.stringify(req)})
490
+ }
491
+ static CreateMysqlAutoBackup(req: CreateMysqlAutoBackupReq, initReq?: fm.InitReq): Promise<CreateMysqlAutoBackupResp> {
492
+ return fm.fetchReq<CreateMysqlAutoBackupReq, CreateMysqlAutoBackupResp>(`/apis/mcamel.io/mysql/v1alpha1/mysql/${req["cluster"]}/${req["namespace"]}/${req["name"]}/autobackup`, {...initReq, method: "POST", body: JSON.stringify(req)})
493
+ }
494
+ static DeleteMysqlAutoBackup(req: DeleteMysqlAutoBackupReq, initReq?: fm.InitReq): Promise<DeleteMysqlAutoBackupResp> {
495
+ return fm.fetchReq<DeleteMysqlAutoBackupReq, DeleteMysqlAutoBackupResp>(`/apis/mcamel.io/mysql/v1alpha1/mysql/${req["workspaceId"]}/${req["cluster"]}/${req["namespace"]}/${req["name"]}/autobackup`, {...initReq, method: "DELETE"})
496
+ }
497
+ static GetMysqlConfs(req: GetMysqlConfReq, initReq?: fm.InitReq): Promise<GetMysqlConfResp> {
498
+ return fm.fetchReq<GetMysqlConfReq, GetMysqlConfResp>(`/apis/mcamel.io/mysql/v1alpha1/mysql/${req["cluster"]}/${req["namespace"]}/${req["name"]}/confs?${fm.renderURLSearchParams(req, ["cluster", "namespace", "name"])}`, {...initReq, method: "GET"})
499
+ }
500
+ static UpdateMysqlConf(req: UpdateMysqlConfReq, initReq?: fm.InitReq): Promise<UpdateMysqlConfResp> {
501
+ return fm.fetchReq<UpdateMysqlConfReq, UpdateMysqlConfResp>(`/apis/mcamel.io/mysql/v1alpha1/mysql/${req["cluster"]}/${req["namespace"]}/${req["name"]}/conf`, {...initReq, method: "PUT", body: JSON.stringify(req)})
502
+ }
503
+ static UpdateMysqlParams(req: UpdateMysqlParamsReq, initReq?: fm.InitReq): Promise<UpdateMysqlParamsResp> {
504
+ return fm.fetchReq<UpdateMysqlParamsReq, UpdateMysqlParamsResp>(`/apis/mcamel.io/mysql/v1alpha1/mysql/${req["cluster"]}/${req["namespace"]}/${req["name"]}/params`, {...initReq, method: "PUT", body: JSON.stringify(req)})
505
+ }
506
+ static DeleteMysql(req: DeleteMysqlReq, initReq?: fm.InitReq): Promise<DeleteMysqlResp> {
507
+ return fm.fetchReq<DeleteMysqlReq, DeleteMysqlResp>(`/apis/mcamel.io/mysql/v1alpha1/mysql/${req["cluster"]}/${req["namespace"]}/${req["name"]}`, {...initReq, method: "DELETE"})
508
+ }
509
+ static DeleteMysqls(req: DeleteMysqlsReq, initReq?: fm.InitReq): Promise<DeleteMysqlsResp> {
510
+ return fm.fetchReq<DeleteMysqlsReq, DeleteMysqlsResp>(`/apis/mcamel.io/mysql/v1alpha1/mysqls`, {...initReq, method: "POST", body: JSON.stringify(req)})
511
+ }
512
+ static GetMysqlBackupList(req: GetMysqlBackupListReq, initReq?: fm.InitReq): Promise<GetMysqlBackupListResp> {
513
+ return fm.fetchReq<GetMysqlBackupListReq, GetMysqlBackupListResp>(`/apis/mcamel.io/mysql/v1alpha1/mysql/${req["cluster"]}/${req["namespace"]}/${req["name"]}/backups?${fm.renderURLSearchParams(req, ["cluster", "namespace", "name"])}`, {...initReq, method: "GET"})
514
+ }
515
+ static GetMysqlBackupJobList(req: GetMysqlBackupJobListReq, initReq?: fm.InitReq): Promise<GetMysqlBackupJobListResp> {
516
+ return fm.fetchReq<GetMysqlBackupJobListReq, GetMysqlBackupJobListResp>(`/apis/mcamel.io/mysql/v1alpha1/mysql/${req["cluster"]}/${req["namespace"]}/${req["name"]}/backup/jobs?${fm.renderURLSearchParams(req, ["cluster", "namespace", "name"])}`, {...initReq, method: "GET"})
517
+ }
518
+ static CreateMysqlBackup(req: CreateMysqlBackupReq, initReq?: fm.InitReq): Promise<CreateMysqlBackupResp> {
519
+ return fm.fetchReq<CreateMysqlBackupReq, CreateMysqlBackupResp>(`/apis/mcamel.io/mysql/v1alpha1/mysql/${req["cluster"]}/${req["namespace"]}/${req["name"]}/backup`, {...initReq, method: "POST", body: JSON.stringify(req)})
520
+ }
521
+ static DeleteMysqlBackup(req: DeleteMysqlBackupReq, initReq?: fm.InitReq): Promise<DeleteMysqlBackupResp> {
522
+ return fm.fetchReq<DeleteMysqlBackupReq, DeleteMysqlBackupResp>(`/apis/mcamel.io/mysql/v1alpha1/mysql/${req["cluster"]}/${req["namespace"]}/${req["name"]}/backup`, {...initReq, method: "DELETE"})
523
+ }
524
+ static GetMysqlBackupSecret(req: GetMysqlBackupSecretReq, initReq?: fm.InitReq): Promise<GetMysqlBackupSecretResp> {
525
+ return fm.fetchReq<GetMysqlBackupSecretReq, GetMysqlBackupSecretResp>(`/apis/mcamel.io/mysql/v1alpha1/mysql/${req["workspaceId"]}/secret?${fm.renderURLSearchParams(req, ["workspaceId"])}`, {...initReq, method: "GET"})
526
+ }
527
+ static GetMysqlBackupProviderList(req: GetMysqlBackupProviderListReq, initReq?: fm.InitReq): Promise<GetMysqlBackupProviderListResp> {
528
+ return fm.fetchReq<GetMysqlBackupProviderListReq, GetMysqlBackupProviderListResp>(`/apis/mcamel.io/mysql/v1alpha1/mysql/${req["workspaceId"]}/providers?${fm.renderURLSearchParams(req, ["workspaceId"])}`, {...initReq, method: "GET"})
529
+ }
530
+ static SetMysqlBackupSecret(req: SetMysqlBackupSecretReq, initReq?: fm.InitReq): Promise<SetMysqlBackupSecretResp> {
531
+ return fm.fetchReq<SetMysqlBackupSecretReq, SetMysqlBackupSecretResp>(`/apis/mcamel.io/mysql/v1alpha1/mysql/${req["workspaceId"]}/secret`, {...initReq, method: "PUT", body: JSON.stringify(req)})
532
+ }
533
+ }
package/package.json ADDED
@@ -0,0 +1,12 @@
1
+ {
2
+ "name":"@daocloud-proto/mcamel-mysql",
3
+ "version":"0.1.1-10",
4
+ "description": "",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "test": "echo \"Error: no test specified\" && exit 1"
8
+ },
9
+ "keywords": [],
10
+ "author": "",
11
+ "license": "ISC"
12
+ }
package/version.pb.ts ADDED
@@ -0,0 +1,27 @@
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 fm from "./fetch.pb"
8
+ export type CommonReply = {
9
+ code?: number
10
+ msg?: string
11
+ }
12
+
13
+ export type GetVersionReply = {
14
+ commonReply?: CommonReply
15
+ gitCommit?: string
16
+ gitVersion?: string
17
+ buildTime?: string
18
+ }
19
+
20
+ export type Empty = {
21
+ }
22
+
23
+ export class Version {
24
+ static Get(req: Empty, initReq?: fm.InitReq): Promise<GetVersionReply> {
25
+ return fm.fetchReq<Empty, GetVersionReply>(`/apis/mcamel.io/mysql/v1alpha1/mysql/version?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
26
+ }
27
+ }