@daocloud-proto/mcamel-rabbitmq 0.2.0-1
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 +49 -0
- package/common.pb.ts +24 -0
- package/fetch.pb.ts +232 -0
- package/package.json +12 -0
- package/rabbitmq.pb.ts +334 -0
- package/version.pb.ts +27 -0
package/cluster.pb.ts
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
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 GetClusterListRespGetClusterListDataClusterPhase {
|
|
11
|
+
CLUSTER_PHASE_UNSPECIFIED = "CLUSTER_PHASE_UNSPECIFIED",
|
|
12
|
+
UNKNOWN = "UNKNOWN",
|
|
13
|
+
CREATING = "CREATING",
|
|
14
|
+
RUNNING = "RUNNING",
|
|
15
|
+
UPDATING = "UPDATING",
|
|
16
|
+
DELETING = "DELETING",
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export type GetClusterListReq = {
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export type GetClusterListRespGetClusterListData = {
|
|
23
|
+
name?: string
|
|
24
|
+
phase?: GetClusterListRespGetClusterListDataClusterPhase
|
|
25
|
+
kubeSystemID?: string
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export type GetClusterListResp = {
|
|
29
|
+
items?: GetClusterListRespGetClusterListData[]
|
|
30
|
+
pagination?: CommonCommon.Pagination
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export type GetClusterNamespaceListReq = {
|
|
34
|
+
cluster?: string
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export type GetClusterNamespaceListResp = {
|
|
38
|
+
items?: string[]
|
|
39
|
+
pagination?: CommonCommon.Pagination
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export class Cluster {
|
|
43
|
+
static GetClusterList(req: GetClusterListReq, initReq?: fm.InitReq): Promise<GetClusterListResp> {
|
|
44
|
+
return fm.fetchReq<GetClusterListReq, GetClusterListResp>(`/apis/mcamel.io/rabbitmq/v1alpha1/clusters?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
|
|
45
|
+
}
|
|
46
|
+
static GetClusterNamespaceList(req: GetClusterNamespaceListReq, initReq?: fm.InitReq): Promise<GetClusterNamespaceListResp> {
|
|
47
|
+
return fm.fetchReq<GetClusterNamespaceListReq, GetClusterNamespaceListResp>(`/apis/mcamel.io/rabbitmq/v1alpha1/${req["cluster"]}/namespaces?${fm.renderURLSearchParams(req, ["cluster"])}`, {...initReq, method: "GET"})
|
|
48
|
+
}
|
|
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
ADDED
package/rabbitmq.pb.ts
ADDED
|
@@ -0,0 +1,334 @@
|
|
|
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 GetRabbitMqListReqSortDir {
|
|
26
|
+
ASC = "ASC",
|
|
27
|
+
DESC = "DESC",
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export enum GetRabbitMqConfReqSortDir {
|
|
31
|
+
ASC = "ASC",
|
|
32
|
+
DESC = "DESC",
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export enum CreateRabbitMqReqServiceType {
|
|
36
|
+
ClusterIP = "ClusterIP",
|
|
37
|
+
NodePort = "NodePort",
|
|
38
|
+
LoadBalancer = "LoadBalancer",
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export enum GetRabbitMqParamRespSelectSelectType {
|
|
42
|
+
Single = "Single",
|
|
43
|
+
Multiple = "Multiple",
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export enum GetRabbitMqNodeListRespPodStatus {
|
|
47
|
+
PHASE_UNSPECIFIED = "PHASE_UNSPECIFIED",
|
|
48
|
+
Unknown = "Unknown",
|
|
49
|
+
Pending = "Pending",
|
|
50
|
+
Running = "Running",
|
|
51
|
+
Succeeded = "Succeeded",
|
|
52
|
+
Failed = "Failed",
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export enum GetRabbitMqConfRespItemsParamType {
|
|
56
|
+
defaultUser = "defaultUser",
|
|
57
|
+
defaultPass = "defaultPass",
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export type GetRabbitMqListReq = {
|
|
61
|
+
page?: number
|
|
62
|
+
pageSize?: number
|
|
63
|
+
sortDir?: GetRabbitMqListReqSortDir
|
|
64
|
+
sortBy?: string
|
|
65
|
+
searchKey?: string
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export type GetRabbitMqConfReq = {
|
|
69
|
+
page?: number
|
|
70
|
+
pageSize?: number
|
|
71
|
+
sortDir?: GetRabbitMqConfReqSortDir
|
|
72
|
+
sortBy?: string
|
|
73
|
+
searchKey?: string
|
|
74
|
+
cluster?: string
|
|
75
|
+
namespace?: string
|
|
76
|
+
name?: string
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export type GetRabbitMqParamReq = {
|
|
80
|
+
cluster?: string
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export type CreateRabbitMqReqPorts = {
|
|
84
|
+
name?: string
|
|
85
|
+
protocol?: string
|
|
86
|
+
port?: number
|
|
87
|
+
targetPort?: number
|
|
88
|
+
nodePort?: number
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export type CreateRabbitMqReq = {
|
|
92
|
+
cluster?: string
|
|
93
|
+
namespace?: string
|
|
94
|
+
name?: string
|
|
95
|
+
describe?: string
|
|
96
|
+
version?: string
|
|
97
|
+
replicas?: number
|
|
98
|
+
storageClassName?: string
|
|
99
|
+
storageCapacity?: string
|
|
100
|
+
defaultUser?: string
|
|
101
|
+
defaultPass?: string
|
|
102
|
+
serviceType?: CreateRabbitMqReqServiceType
|
|
103
|
+
serviceAnnotations?: {[key: string]: string}
|
|
104
|
+
ports?: CreateRabbitMqReqPorts[]
|
|
105
|
+
cpuRequest?: string
|
|
106
|
+
cpuLimit?: string
|
|
107
|
+
memoryRequest?: string
|
|
108
|
+
memoryLimit?: string
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export type UpdateRabbitMqConfReq = {
|
|
112
|
+
cluster?: string
|
|
113
|
+
namespace?: string
|
|
114
|
+
name?: string
|
|
115
|
+
defaultUser?: string
|
|
116
|
+
defaultPass?: string
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export type UpdateRabbitMqParamsReq = {
|
|
120
|
+
cluster?: string
|
|
121
|
+
namespace?: string
|
|
122
|
+
name?: string
|
|
123
|
+
replicas?: number
|
|
124
|
+
storageCapacity?: string
|
|
125
|
+
serviceType?: CreateRabbitMqReqServiceType
|
|
126
|
+
serviceAnnotations?: {[key: string]: string}
|
|
127
|
+
describe?: string
|
|
128
|
+
ports?: CreateRabbitMqReqPorts[]
|
|
129
|
+
cpuRequest?: string
|
|
130
|
+
cpuLimit?: string
|
|
131
|
+
memoryRequest?: string
|
|
132
|
+
memoryLimit?: string
|
|
133
|
+
version?: string
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
export type UpdateRabbitMqParamsResp = {
|
|
137
|
+
message?: string
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
export type UpdateRabbitMqConfResp = {
|
|
141
|
+
message?: string
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
export type GetRabbitMqParamRespSelectDataStringValue = {
|
|
145
|
+
value?: string
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
export type GetRabbitMqParamRespSelectDataResourceValue = {
|
|
149
|
+
cpuRequest?: string
|
|
150
|
+
cpuLimit?: string
|
|
151
|
+
memoryRequest?: string
|
|
152
|
+
memoryLimit?: string
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
export type GetRabbitMqParamRespSelectDataIntValue = {
|
|
156
|
+
value?: number
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
type BaseGetRabbitMqParamRespSelectData = {
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
export type GetRabbitMqParamRespSelectData = BaseGetRabbitMqParamRespSelectData
|
|
164
|
+
& OneOf<{ sValue: GetRabbitMqParamRespSelectDataStringValue; rValue: GetRabbitMqParamRespSelectDataResourceValue; iValue: GetRabbitMqParamRespSelectDataIntValue }>
|
|
165
|
+
|
|
166
|
+
export type GetRabbitMqParamRespSelect = {
|
|
167
|
+
selectType?: GetRabbitMqParamRespSelectSelectType
|
|
168
|
+
data?: GetRabbitMqParamRespSelectData[]
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
export type GetRabbitMqParamResp = {
|
|
172
|
+
version?: GetRabbitMqParamRespSelect
|
|
173
|
+
replicas?: GetRabbitMqParamRespSelect
|
|
174
|
+
resource?: GetRabbitMqParamRespSelect
|
|
175
|
+
storage?: GetRabbitMqParamRespSelect
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
export type CreateRabbitMqResp = {
|
|
179
|
+
message?: string
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
export type GetRabbitMqOperatorVersionListReq = {
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
export type GetRabbitMqOperatorVersionListRespGetRabbitMqOperatorVersionListData = {
|
|
186
|
+
cluster?: string
|
|
187
|
+
namespace?: string
|
|
188
|
+
version?: string
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
export type GetRabbitMqOperatorVersionListResp = {
|
|
192
|
+
items?: GetRabbitMqOperatorVersionListRespGetRabbitMqOperatorVersionListData[]
|
|
193
|
+
pagination?: CommonCommon.Pagination
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
export type DeleteRabbitMqReq = {
|
|
197
|
+
cluster?: string
|
|
198
|
+
namespace?: string
|
|
199
|
+
name?: string
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
export type DeleteRabbitMqsReq = {
|
|
203
|
+
data?: DeleteRabbitMqReq[]
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
export type DeleteRabbitMqResp = {
|
|
207
|
+
message?: string
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
export type DeleteRabbitMqsResp = {
|
|
211
|
+
message?: string
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
export type GetRabbitMqNodeListReq = {
|
|
215
|
+
cluster?: string
|
|
216
|
+
namespace?: string
|
|
217
|
+
name?: string
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
export type GetRabbitMqNodeListRespData = {
|
|
221
|
+
podName?: string
|
|
222
|
+
status?: GetRabbitMqNodeListRespPodStatus
|
|
223
|
+
ip?: string
|
|
224
|
+
restart?: number
|
|
225
|
+
cpuUsage?: number
|
|
226
|
+
cpuLimit?: number
|
|
227
|
+
memoryUsage?: number
|
|
228
|
+
memoryLimit?: number
|
|
229
|
+
createTime?: string
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
export type GetRabbitMqNodeListResp = {
|
|
233
|
+
items?: GetRabbitMqNodeListRespData[]
|
|
234
|
+
pagination?: CommonCommon.Pagination
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
export type GetRabbitMqGrafanaAddrReq = {
|
|
238
|
+
cluster?: string
|
|
239
|
+
namespace?: string
|
|
240
|
+
name?: string
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
export type GetRabbitMqGrafanaAddrResp = {
|
|
244
|
+
data?: string
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
export type GetRabbitMqReq = {
|
|
248
|
+
cluster?: string
|
|
249
|
+
namespace?: string
|
|
250
|
+
name?: string
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
export type GetRabbitMqResp = {
|
|
254
|
+
data?: RabbitmqClusterItem
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
export type GetRabbitMqConfRespItems = {
|
|
258
|
+
paramType?: GetRabbitMqConfRespItemsParamType
|
|
259
|
+
paramName?: string
|
|
260
|
+
value?: string
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
export type GetRabbitMqConfResp = {
|
|
264
|
+
items?: GetRabbitMqConfRespItems[]
|
|
265
|
+
pagination?: CommonCommon.Pagination
|
|
266
|
+
conf?: UpdateRabbitMqConfReq
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
export type GetRabbitMqListResp = {
|
|
270
|
+
items?: RabbitmqClusterItem[]
|
|
271
|
+
pagination?: CommonCommon.Pagination
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
export type RabbitmqClusterItemExtend = {
|
|
275
|
+
status?: Status
|
|
276
|
+
podsAreReadyNum?: number
|
|
277
|
+
webManagerAddr?: string
|
|
278
|
+
clusterIPs?: string[]
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
export type RabbitmqClusterItemMetadata = {
|
|
282
|
+
annotations?: {[key: string]: string}
|
|
283
|
+
creationTimestamp?: number
|
|
284
|
+
name?: string
|
|
285
|
+
namespace?: string
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
export type RabbitmqClusterItem = {
|
|
289
|
+
apiVersion?: string
|
|
290
|
+
kind?: string
|
|
291
|
+
metadata?: RabbitmqClusterItemMetadata
|
|
292
|
+
spec?: CreateRabbitMqReq
|
|
293
|
+
status?: Status
|
|
294
|
+
extend?: RabbitmqClusterItemExtend
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
export class RabbitMq {
|
|
298
|
+
static GetRabbitMqList(req: GetRabbitMqListReq, initReq?: fm.InitReq): Promise<GetRabbitMqListResp> {
|
|
299
|
+
return fm.fetchReq<GetRabbitMqListReq, GetRabbitMqListResp>(`/apis/mcamel.io/rabbitmq/v1alpha1/rabbitmqs?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
|
|
300
|
+
}
|
|
301
|
+
static GetRabbitMqOperatorVersionList(req: GetRabbitMqOperatorVersionListReq, initReq?: fm.InitReq): Promise<GetRabbitMqOperatorVersionListResp> {
|
|
302
|
+
return fm.fetchReq<GetRabbitMqOperatorVersionListReq, GetRabbitMqOperatorVersionListResp>(`/apis/mcamel.io/rabbitmq/v1alpha1/rabbitmq-operator/versions?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
|
|
303
|
+
}
|
|
304
|
+
static GetRabbitMq(req: GetRabbitMqReq, initReq?: fm.InitReq): Promise<GetRabbitMqResp> {
|
|
305
|
+
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"})
|
|
306
|
+
}
|
|
307
|
+
static GetRabbitMqParam(req: GetRabbitMqParamReq, initReq?: fm.InitReq): Promise<GetRabbitMqParamResp> {
|
|
308
|
+
return fm.fetchReq<GetRabbitMqParamReq, GetRabbitMqParamResp>(`/apis/mcamel.io/rabbitmq/v1alpha1/rabbitmq-params/${req["cluster"]}?${fm.renderURLSearchParams(req, ["cluster"])}`, {...initReq, method: "GET"})
|
|
309
|
+
}
|
|
310
|
+
static GetRabbitMqNodeList(req: GetRabbitMqNodeListReq, initReq?: fm.InitReq): Promise<GetRabbitMqNodeListResp> {
|
|
311
|
+
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"})
|
|
312
|
+
}
|
|
313
|
+
static GetRabbitMqGrafanaAddr(req: GetRabbitMqGrafanaAddrReq, initReq?: fm.InitReq): Promise<GetRabbitMqGrafanaAddrResp> {
|
|
314
|
+
return fm.fetchReq<GetRabbitMqGrafanaAddrReq, GetRabbitMqGrafanaAddrResp>(`/apis/mcamel.io/rabbitmq/v1alpha1/rabbitmq/grafana/${req["cluster"]}/${req["namespace"]}/${req["name"]}?${fm.renderURLSearchParams(req, ["cluster", "namespace", "name"])}`, {...initReq, method: "GET"})
|
|
315
|
+
}
|
|
316
|
+
static CreateRabbitMq(req: CreateRabbitMqReq, initReq?: fm.InitReq): Promise<CreateRabbitMqResp> {
|
|
317
|
+
return fm.fetchReq<CreateRabbitMqReq, CreateRabbitMqResp>(`/apis/mcamel.io/rabbitmq/v1alpha1/rabbitmq`, {...initReq, method: "POST", body: JSON.stringify(req)})
|
|
318
|
+
}
|
|
319
|
+
static GetRabbitMqConfs(req: GetRabbitMqConfReq, initReq?: fm.InitReq): Promise<GetRabbitMqConfResp> {
|
|
320
|
+
return fm.fetchReq<GetRabbitMqConfReq, GetRabbitMqConfResp>(`/apis/mcamel.io/rabbitmq/v1alpha1/rabbitmq/${req["cluster"]}/${req["namespace"]}/${req["name"]}/confs?${fm.renderURLSearchParams(req, ["cluster", "namespace", "name"])}`, {...initReq, method: "GET"})
|
|
321
|
+
}
|
|
322
|
+
static UpdateRabbitMqConf(req: UpdateRabbitMqConfReq, initReq?: fm.InitReq): Promise<UpdateRabbitMqConfResp> {
|
|
323
|
+
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
|
+
}
|
|
325
|
+
static UpdateRabbitMqParams(req: UpdateRabbitMqParamsReq, initReq?: fm.InitReq): Promise<UpdateRabbitMqParamsResp> {
|
|
326
|
+
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
|
+
}
|
|
328
|
+
static DeleteRabbitMq(req: DeleteRabbitMqReq, initReq?: fm.InitReq): Promise<DeleteRabbitMqResp> {
|
|
329
|
+
return fm.fetchReq<DeleteRabbitMqReq, DeleteRabbitMqResp>(`/apis/mcamel.io/rabbitmq/v1alpha1/rabbitmq/${req["cluster"]}/${req["namespace"]}/${req["name"]}`, {...initReq, method: "DELETE"})
|
|
330
|
+
}
|
|
331
|
+
static DeleteRabbitMqs(req: DeleteRabbitMqsReq, initReq?: fm.InitReq): Promise<DeleteRabbitMqsResp> {
|
|
332
|
+
return fm.fetchReq<DeleteRabbitMqsReq, DeleteRabbitMqsResp>(`/apis/mcamel.io/rabbitmq/v1alpha1/rabbitmqs`, {...initReq, method: "POST", body: JSON.stringify(req)})
|
|
333
|
+
}
|
|
334
|
+
}
|
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/rabbitmq/v1alpha1/rabbitmq/version?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
|
|
26
|
+
}
|
|
27
|
+
}
|