@daocloud-proto/mcamel-rabbitmq 0.4.0-13 → 0.4.0-130

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
@@ -4,7 +4,8 @@
4
4
  * This file is a generated Typescript file for GRPC Gateway, DO NOT MODIFY
5
5
  */
6
6
 
7
- import * as fm from "../../v1alpha1/ts_out/api"
7
+ import * as CommonCommon from "./common.pb"
8
+ import * as fm from "./fetch.pb"
8
9
 
9
10
  export enum GetClusterListRespGetClusterListDataClusterPhase {
10
11
  CLUSTER_PHASE_UNSPECIFIED = "CLUSTER_PHASE_UNSPECIFIED",
@@ -25,7 +26,8 @@ export type GetClusterListRespGetClusterListData = {
25
26
  }
26
27
 
27
28
  export type GetClusterListResp = {
28
- data?: GetClusterListRespGetClusterListData[]
29
+ items?: GetClusterListRespGetClusterListData[]
30
+ pagination?: CommonCommon.Pagination
29
31
  }
30
32
 
31
33
  export type GetClusterNamespaceListReq = {
@@ -33,14 +35,15 @@ export type GetClusterNamespaceListReq = {
33
35
  }
34
36
 
35
37
  export type GetClusterNamespaceListResp = {
36
- data?: string[]
38
+ items?: string[]
39
+ pagination?: CommonCommon.Pagination
37
40
  }
38
41
 
39
42
  export class Cluster {
40
43
  static GetClusterList(req: GetClusterListReq, initReq?: fm.InitReq): Promise<GetClusterListResp> {
41
- return fm.fetchReq<GetClusterListReq, GetClusterListResp>(`/apis/mcamel.io/v1alpha1/clusters?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
44
+ return fm.fetchReq<GetClusterListReq, GetClusterListResp>(`/apis/mcamel.io/rabbitmq/v1alpha1/clusters?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
42
45
  }
43
46
  static GetClusterNamespaceList(req: GetClusterNamespaceListReq, initReq?: fm.InitReq): Promise<GetClusterNamespaceListResp> {
44
- return fm.fetchReq<GetClusterNamespaceListReq, GetClusterNamespaceListResp>(`/apis/mcamel.io/v1alpha1/${req["cluster"]}/namespaces?${fm.renderURLSearchParams(req, ["cluster"])}`, {...initReq, method: "GET"})
47
+ return fm.fetchReq<GetClusterNamespaceListReq, GetClusterNamespaceListResp>(`/apis/mcamel.io/rabbitmq/v1alpha1/${req["cluster"]}/namespaces?${fm.renderURLSearchParams(req, ["cluster"])}`, {...initReq, method: "GET"})
45
48
  }
46
49
  }
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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name":"@daocloud-proto/mcamel-rabbitmq",
3
- "version":"0.4.0-13",
3
+ "version":"0.4.0-130",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/rabbitmq.pb.ts CHANGED
@@ -4,7 +4,28 @@
4
4
  * This file is a generated Typescript file for GRPC Gateway, DO NOT MODIFY
5
5
  */
6
6
 
7
- import * as fm from "../../v1alpha1/ts_out/api"
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 GetRabbitMqListReqSortDir {
26
+ ASC = "ASC",
27
+ DESC = "DESC",
28
+ }
8
29
 
9
30
  export enum CreateRabbitMqReqServiceType {
10
31
  ClusterIP = "ClusterIP",
@@ -19,7 +40,9 @@ export enum GetRabbitMqParamRespSelectSelectType {
19
40
 
20
41
  export type GetRabbitMqListReq = {
21
42
  page?: number
22
- size?: number
43
+ pageSize?: number
44
+ sortDir?: GetRabbitMqListReqSortDir
45
+ sortBy?: string
23
46
  searchKey?: string
24
47
  }
25
48
 
@@ -42,7 +65,6 @@ export type CreateRabbitMqReq = {
42
65
  describe?: string
43
66
  version?: string
44
67
  replicas?: number
45
- resource?: string
46
68
  storageClassName?: string
47
69
  storageCapacity?: string
48
70
  defaultUser?: string
@@ -50,32 +72,63 @@ export type CreateRabbitMqReq = {
50
72
  serviceType?: CreateRabbitMqReqServiceType
51
73
  serviceAnnotations?: {[key: string]: string}
52
74
  ports?: CreateRabbitMqReqPorts[]
75
+ cpuRequest?: string
76
+ cpuLimit?: string
77
+ memoryRequest?: string
78
+ memoryLimit?: string
53
79
  }
54
80
 
55
- export type UpdateRabbitMqReq = {
81
+ export type UpdateRabbitMqConfReq = {
56
82
  cluster?: string
57
83
  namespace?: string
58
84
  name?: string
59
85
  defaultUser?: string
60
86
  defaultPass?: string
61
- resource?: string
87
+ }
88
+
89
+ export type UpdateRabbitMqParamsReq = {
90
+ cluster?: string
91
+ namespace?: string
92
+ name?: string
62
93
  replicas?: number
63
94
  storageCapacity?: string
64
95
  serviceType?: CreateRabbitMqReqServiceType
65
96
  serviceAnnotations?: {[key: string]: string}
66
97
  describe?: string
67
98
  ports?: CreateRabbitMqReqPorts[]
99
+ cpuRequest?: string
100
+ cpuLimit?: string
101
+ memoryRequest?: string
102
+ memoryLimit?: string
68
103
  }
69
104
 
70
- export type UpdateRabbitMqResp = {
105
+ export type UpdateRabbitMqParamsResp = {
71
106
  message?: string
72
107
  }
73
108
 
74
- export type GetRabbitMqParamRespSelectData = {
75
- data?: {[key: string]: string}
109
+ export type UpdateRabbitMqConfResp = {
110
+ message?: string
111
+ }
112
+
113
+ export type GetRabbitMqParamRespSelectDataStringValue = {
76
114
  value?: string
77
115
  }
78
116
 
117
+ export type GetRabbitMqParamRespSelectDataResourceValue = {
118
+ cpuRequest?: number
119
+ cpuLimit?: number
120
+ memoryRequest?: number
121
+ memoryLimit?: number
122
+ }
123
+
124
+
125
+ type BaseGetRabbitMqParamRespSelectData = {
126
+ data?: {[key: string]: string}
127
+ }
128
+
129
+ export type GetRabbitMqParamRespSelectData = BaseGetRabbitMqParamRespSelectData
130
+ & OneOf<{ sValue: GetRabbitMqParamRespSelectDataStringValue; rValue: GetRabbitMqParamRespSelectDataResourceValue }>
131
+
79
132
  export type GetRabbitMqParamRespSelect = {
80
133
  selectType?: GetRabbitMqParamRespSelectSelectType
81
134
  data?: GetRabbitMqParamRespSelectData[]
@@ -103,7 +156,8 @@ export type GetRabbitMqOperatorVersionListRespGetRabbitMqOperatorVersionListData
103
156
  }
104
157
 
105
158
  export type GetRabbitMqOperatorVersionListResp = {
106
- data?: GetRabbitMqOperatorVersionListRespGetRabbitMqOperatorVersionListData[]
159
+ items?: GetRabbitMqOperatorVersionListRespGetRabbitMqOperatorVersionListData[]
160
+ pagination?: CommonCommon.Pagination
107
161
  }
108
162
 
109
163
  export type DeleteRabbitMqReq = {
@@ -132,7 +186,7 @@ export type GetRabbitMqNodeListReq = {
132
186
 
133
187
  export type GetRabbitMqNodeListRespData = {
134
188
  podName?: string
135
- status?: string
189
+ status?: Status
136
190
  nodeName?: string
137
191
  ip?: string
138
192
  restart?: number
@@ -142,13 +196,11 @@ export type GetRabbitMqNodeListRespData = {
142
196
  }
143
197
 
144
198
  export type GetRabbitMqNodeListResp = {
145
- data?: GetRabbitMqNodeListRespData[]
199
+ items?: GetRabbitMqNodeListRespData[]
200
+ pagination?: CommonCommon.Pagination
146
201
  }
147
202
 
148
203
  export type GetRabbitMqGrafanaAddrReq = {
149
- cluster?: string
150
- namespace?: string
151
- name?: string
152
204
  }
153
205
 
154
206
  export type GetRabbitMqGrafanaAddrResp = {
@@ -166,169 +218,65 @@ export type GetRabbitMqResp = {
166
218
  }
167
219
 
168
220
  export type GetRabbitMqListResp = {
169
- data?: RabbitmqClusterList
221
+ items?: RabbitmqClusterItem[]
222
+ pagination?: CommonCommon.Pagination
170
223
  }
171
224
 
172
225
  export type RabbitmqClusterItemExtend = {
173
- atLeastOneEndpointAvailable?: boolean
226
+ status?: Status
174
227
  podsAreReadyNum?: number
175
228
  webManagerAddr?: string
176
229
  clusterIPs?: string[]
177
230
  }
178
231
 
179
- export type RabbitmqClusterListMetadata = {
180
- remainingItemCount?: number
181
- }
182
-
183
- export type RabbitmqClusterList = {
184
- metadata?: RabbitmqClusterListMetadata
185
- items?: RabbitmqClusterItem[]
186
- }
187
-
188
232
  export type RabbitmqClusterItemMetadata = {
189
233
  annotations?: {[key: string]: string}
190
- creationTimestamp?: string
191
- finalizers?: string[]
192
- generation?: number
193
- name?: string
194
- namespace?: string
195
- resourceVersion?: string
196
- uid?: string
197
- }
198
-
199
- export type RabbitmqClusterItemSpecOverride = {
200
- }
201
-
202
- export type RabbitmqClusterItemSpecPersistence = {
203
- storage?: string
204
- storageClassName?: string
205
- }
206
-
207
- export type RabbitmqClusterItemSpecRabbitmq = {
208
- additionalConfig?: string
209
- additionalPlugins?: string[]
210
- }
211
-
212
- export type RabbitmqClusterItemSpecResourcesLimits = {
213
- cpu?: string
214
- memory?: string
215
- }
216
-
217
- export type RabbitmqClusterItemSpecResourcesRequests = {
218
- cpu?: string
219
- memory?: string
220
- }
221
-
222
- export type RabbitmqClusterItemSpecResources = {
223
- limits?: RabbitmqClusterItemSpecResourcesLimits
224
- requests?: RabbitmqClusterItemSpecResourcesRequests
225
- }
226
-
227
- export type RabbitmqClusterItemSpecSecretBackend = {
228
- }
229
-
230
- export type RabbitmqClusterItemSpecServiceAnnotations = {
231
- asd?: string
232
- }
233
-
234
- export type RabbitmqClusterItemSpecService = {
235
- annotations?: RabbitmqClusterItemSpecServiceAnnotations
236
- type?: string
237
- }
238
-
239
- export type RabbitmqClusterItemSpecTls = {
240
- }
241
-
242
- export type RabbitmqClusterItemSpec = {
243
- image?: string
244
- override?: RabbitmqClusterItemSpecOverride
245
- persistence?: RabbitmqClusterItemSpecPersistence
246
- rabbitmq?: RabbitmqClusterItemSpecRabbitmq
247
- replicas?: number
248
- resources?: RabbitmqClusterItemSpecResources
249
- secretBackend?: RabbitmqClusterItemSpecSecretBackend
250
- service?: RabbitmqClusterItemSpecService
251
- terminationGracePeriodSeconds?: number
252
- tls?: RabbitmqClusterItemSpecTls
253
- }
254
-
255
- export type RabbitmqClusterItemStatusBinding = {
256
- name?: string
257
- }
258
-
259
- export type RabbitmqClusterItemStatusConditions = {
260
- lastTransitionTime?: string
261
- reason?: string
262
- status?: string
263
- type?: string
264
- }
265
-
266
- export type RabbitmqClusterItemStatusDefaultUserSecretReferenceKeys = {
267
- password?: string
268
- username?: string
269
- }
270
-
271
- export type RabbitmqClusterItemStatusDefaultUserSecretReference = {
272
- keys?: RabbitmqClusterItemStatusDefaultUserSecretReferenceKeys
234
+ creationTimestamp?: number
273
235
  name?: string
274
236
  namespace?: string
275
237
  }
276
238
 
277
- export type RabbitmqClusterItemStatusDefaultUserServiceReference = {
278
- name?: string
279
- namespace?: string
280
- }
281
-
282
- export type RabbitmqClusterItemStatusDefaultUser = {
283
- secretReference?: RabbitmqClusterItemStatusDefaultUserSecretReference
284
- serviceReference?: RabbitmqClusterItemStatusDefaultUserServiceReference
285
- }
286
-
287
- export type RabbitmqClusterItemStatus = {
288
- binding?: RabbitmqClusterItemStatusBinding
289
- conditions?: RabbitmqClusterItemStatusConditions[]
290
- defaultUser?: RabbitmqClusterItemStatusDefaultUser
291
- observedGeneration?: number
292
- }
293
-
294
239
  export type RabbitmqClusterItem = {
295
240
  apiVersion?: string
296
241
  kind?: string
297
242
  metadata?: RabbitmqClusterItemMetadata
298
- spec?: RabbitmqClusterItemSpec
299
- status?: RabbitmqClusterItemStatus
243
+ spec?: CreateRabbitMqReq
244
+ status?: Status
300
245
  extend?: RabbitmqClusterItemExtend
301
246
  }
302
247
 
303
248
  export class RabbitMq {
304
249
  static GetRabbitMqList(req: GetRabbitMqListReq, initReq?: fm.InitReq): Promise<GetRabbitMqListResp> {
305
- return fm.fetchReq<GetRabbitMqListReq, GetRabbitMqListResp>(`/apis/mcamel.io/v1alpha1/rabbitmqs?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
250
+ return fm.fetchReq<GetRabbitMqListReq, GetRabbitMqListResp>(`/apis/mcamel.io/rabbitmq/v1alpha1/rabbitmqs?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
306
251
  }
307
252
  static GetRabbitMqOperatorVersionList(req: GetRabbitMqOperatorVersionListReq, initReq?: fm.InitReq): Promise<GetRabbitMqOperatorVersionListResp> {
308
- return fm.fetchReq<GetRabbitMqOperatorVersionListReq, GetRabbitMqOperatorVersionListResp>(`/apis/mcamel.io/v1alpha1/rabbitmq-operator/${req["cluster"]}/versions?${fm.renderURLSearchParams(req, ["cluster"])}`, {...initReq, method: "GET"})
253
+ return fm.fetchReq<GetRabbitMqOperatorVersionListReq, GetRabbitMqOperatorVersionListResp>(`/apis/mcamel.io/rabbitmq/v1alpha1/rabbitmq-operator/${req["cluster"]}/versions?${fm.renderURLSearchParams(req, ["cluster"])}`, {...initReq, method: "GET"})
309
254
  }
310
255
  static GetRabbitMq(req: GetRabbitMqReq, initReq?: fm.InitReq): Promise<GetRabbitMqResp> {
311
- return fm.fetchReq<GetRabbitMqReq, GetRabbitMqResp>(`/apis/mcamel.io/v1alpha1/rabbitmq/${req["cluster"]}/${req["namespace"]}/${req["name"]}?${fm.renderURLSearchParams(req, ["cluster", "namespace", "name"])}`, {...initReq, method: "GET"})
256
+ return fm.fetchReq<GetRabbitMqReq, GetRabbitMqResp>(`/apis/mcamel.io/rabbitmq/v1alpha1/rabbitmq/${req["cluster"]}/${req["namespace"]}/${req["name"]}?${fm.renderURLSearchParams(req, ["cluster", "namespace", "name"])}`, {...initReq, method: "GET"})
312
257
  }
313
258
  static GetRabbitMqParam(req: GetRabbitMqParamReq, initReq?: fm.InitReq): Promise<GetRabbitMqParamResp> {
314
- return fm.fetchReq<GetRabbitMqParamReq, GetRabbitMqParamResp>(`/apis/mcamel.io/v1alpha1/rabbitmq-params/${req["cluster"]}?${fm.renderURLSearchParams(req, ["cluster"])}`, {...initReq, method: "GET"})
259
+ return fm.fetchReq<GetRabbitMqParamReq, GetRabbitMqParamResp>(`/apis/mcamel.io/rabbitmq/v1alpha1/rabbitmq-params/${req["cluster"]}?${fm.renderURLSearchParams(req, ["cluster"])}`, {...initReq, method: "GET"})
315
260
  }
316
261
  static GetRabbitMqNodeList(req: GetRabbitMqNodeListReq, initReq?: fm.InitReq): Promise<GetRabbitMqNodeListResp> {
317
- return fm.fetchReq<GetRabbitMqNodeListReq, GetRabbitMqNodeListResp>(`/apis/mcamel.io/v1alpha1/rabbitmq/nodes/${req["cluster"]}/${req["namespace"]}/${req["name"]}?${fm.renderURLSearchParams(req, ["cluster", "namespace", "name"])}`, {...initReq, method: "GET"})
262
+ return fm.fetchReq<GetRabbitMqNodeListReq, GetRabbitMqNodeListResp>(`/apis/mcamel.io/rabbitmq/v1alpha1/rabbitmq/nodes/${req["cluster"]}/${req["namespace"]}/${req["name"]}?${fm.renderURLSearchParams(req, ["cluster", "namespace", "name"])}`, {...initReq, method: "GET"})
318
263
  }
319
264
  static GetRabbitMqGrafanaAddr(req: GetRabbitMqGrafanaAddrReq, initReq?: fm.InitReq): Promise<GetRabbitMqGrafanaAddrResp> {
320
- return fm.fetchReq<GetRabbitMqGrafanaAddrReq, GetRabbitMqGrafanaAddrResp>(`/apis/mcamel.io/v1alpha1/rabbitmq/grafana/${req["cluster"]}/${req["namespace"]}/${req["name"]}?${fm.renderURLSearchParams(req, ["cluster", "namespace", "name"])}`, {...initReq, method: "GET"})
265
+ return fm.fetchReq<GetRabbitMqGrafanaAddrReq, GetRabbitMqGrafanaAddrResp>(`/apis/mcamel.io/rabbitmq/v1alpha1/rabbitmq/grafana?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
321
266
  }
322
267
  static CreateRabbitMq(req: CreateRabbitMqReq, initReq?: fm.InitReq): Promise<CreateRabbitMqResp> {
323
- return fm.fetchReq<CreateRabbitMqReq, CreateRabbitMqResp>(`/apis/mcamel.io/v1alpha1/rabbitmq`, {...initReq, method: "POST", body: JSON.stringify(req)})
268
+ return fm.fetchReq<CreateRabbitMqReq, CreateRabbitMqResp>(`/apis/mcamel.io/rabbitmq/v1alpha1/rabbitmq`, {...initReq, method: "POST", body: JSON.stringify(req)})
269
+ }
270
+ static UpdateRabbitMqConf(req: UpdateRabbitMqConfReq, initReq?: fm.InitReq): Promise<UpdateRabbitMqConfResp> {
271
+ return fm.fetchReq<UpdateRabbitMqConfReq, UpdateRabbitMqConfResp>(`/apis/mcamel.io/rabbitmq/v1alpha1/rabbitmq/${req["cluster"]}/${req["namespace"]}/${req["name"]}/conf`, {...initReq, method: "PUT", body: JSON.stringify(req)})
324
272
  }
325
- static UpdateRabbitMq(req: UpdateRabbitMqReq, initReq?: fm.InitReq): Promise<UpdateRabbitMqResp> {
326
- return fm.fetchReq<UpdateRabbitMqReq, UpdateRabbitMqResp>(`/apis/mcamel.io/v1alpha1/rabbitmq/${req["cluster"]}/${req["namespace"]}/${req["name"]}`, {...initReq, method: "PATCH", body: JSON.stringify(req)})
273
+ static UpdateRabbitMqParams(req: UpdateRabbitMqParamsReq, initReq?: fm.InitReq): Promise<UpdateRabbitMqParamsResp> {
274
+ return fm.fetchReq<UpdateRabbitMqParamsReq, UpdateRabbitMqParamsResp>(`/apis/mcamel.io/rabbitmq/v1alpha1/rabbitmq/${req["cluster"]}/${req["namespace"]}/${req["name"]}/params`, {...initReq, method: "PUT", body: JSON.stringify(req)})
327
275
  }
328
276
  static DeleteRabbitMq(req: DeleteRabbitMqReq, initReq?: fm.InitReq): Promise<DeleteRabbitMqResp> {
329
- return fm.fetchReq<DeleteRabbitMqReq, DeleteRabbitMqResp>(`/apis/mcamel.io/v1alpha1/rabbitmq/${req["cluster"]}/${req["namespace"]}/${req["name"]}`, {...initReq, method: "DELETE"})
277
+ return fm.fetchReq<DeleteRabbitMqReq, DeleteRabbitMqResp>(`/apis/mcamel.io/rabbitmq/v1alpha1/rabbitmq/${req["cluster"]}/${req["namespace"]}/${req["name"]}`, {...initReq, method: "DELETE"})
330
278
  }
331
279
  static DeleteRabbitMqs(req: DeleteRabbitMqsReq, initReq?: fm.InitReq): Promise<DeleteRabbitMqsResp> {
332
- return fm.fetchReq<DeleteRabbitMqsReq, DeleteRabbitMqsResp>(`/apis/mcamel.io/v1alpha1/rabbitmqs`, {...initReq, method: "POST", body: JSON.stringify(req)})
280
+ return fm.fetchReq<DeleteRabbitMqsReq, DeleteRabbitMqsResp>(`/apis/mcamel.io/rabbitmq/v1alpha1/rabbitmqs`, {...initReq, method: "POST", body: JSON.stringify(req)})
333
281
  }
334
282
  }
package/version.pb.ts CHANGED
@@ -4,7 +4,7 @@
4
4
  * This file is a generated Typescript file for GRPC Gateway, DO NOT MODIFY
5
5
  */
6
6
 
7
- import * as fm from "../../v1alpha1/ts_out/api"
7
+ import * as fm from "./fetch.pb"
8
8
  export type CommonReply = {
9
9
  code?: number
10
10
  msg?: string
@@ -22,6 +22,6 @@ export type Empty = {
22
22
 
23
23
  export class Version {
24
24
  static Get(req: Empty, initReq?: fm.InitReq): Promise<GetVersionReply> {
25
- return fm.fetchReq<Empty, GetVersionReply>(`/apis/mcamel.io/v1alpha1/rabbitmq/version?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
25
+ return fm.fetchReq<Empty, GetVersionReply>(`/apis/mcamel.io/rabbitmq/v1alpha1/rabbitmq/version?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
26
26
  }
27
27
  }