@daocloud-proto/mcamel-rocketmq 0.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.
@@ -0,0 +1,78 @@
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 GoogleProtobufEmpty from "../../../google/protobuf/empty.pb"
8
+ import * as CommonCommon from "./common.pb"
9
+ import * as fm from "./fetch.pb"
10
+
11
+ export enum CreateCloudShellRequestType {
12
+ TYPE_UNSPECIFIED = "TYPE_UNSPECIFIED",
13
+ bash = "bash",
14
+ exec = "exec",
15
+ logs = "logs",
16
+ upload = "upload",
17
+ download = "download",
18
+ }
19
+
20
+ export type ObjectMeta = {
21
+ name?: string
22
+ namespace?: string
23
+ uid?: string
24
+ resourceVersion?: string
25
+ creationTimestamp?: string
26
+ deletionTimestamp?: string
27
+ labels?: {[key: string]: string}
28
+ annotations?: {[key: string]: string}
29
+ ownerReferences?: CommonCommon.OwnerReference[]
30
+ cluster?: string
31
+ workspaceAlias?: string
32
+ }
33
+
34
+ export type CloudShell = {
35
+ metadata?: ObjectMeta
36
+ spec?: CloudShellSpec
37
+ status?: CloudShellStatus
38
+ }
39
+
40
+ export type CloudShellSpec = {
41
+ configMapName?: string
42
+ once?: boolean
43
+ commandAction?: string
44
+ ttl?: number
45
+ cleanup?: boolean
46
+ }
47
+
48
+ export type CloudShellStatus = {
49
+ phase?: string
50
+ accessUrl?: string
51
+ }
52
+
53
+ export type CreateCloudShellRequest = {
54
+ type?: CreateCloudShellRequestType
55
+ cluster?: string
56
+ namespace?: string
57
+ podName?: string
58
+ filePath?: string
59
+ container?: string
60
+ logCount?: number
61
+ data?: CloudShell
62
+ }
63
+
64
+ export type GetorDeleteCloudShellRequest = {
65
+ name?: string
66
+ }
67
+
68
+ export class CloudShellService {
69
+ static CreateCloudShell(req: CreateCloudShellRequest, initReq?: fm.InitReq): Promise<CloudShell> {
70
+ return fm.fetchReq<CreateCloudShellRequest, CloudShell>(`/apis/mcamel.io/rocketmq/v1alpha1/cloudshells`, {...initReq, method: "POST", body: JSON.stringify(req)})
71
+ }
72
+ static GetCloudShell(req: GetorDeleteCloudShellRequest, initReq?: fm.InitReq): Promise<CloudShell> {
73
+ return fm.fetchReq<GetorDeleteCloudShellRequest, CloudShell>(`/apis/mcamel.io/rocketmq/v1alpha1/cloudshells/${req["name"]}?${fm.renderURLSearchParams(req, ["name"])}`, {...initReq, method: "GET"})
74
+ }
75
+ static DeleteCloudShell(req: GetorDeleteCloudShellRequest, initReq?: fm.InitReq): Promise<GoogleProtobufEmpty.Empty> {
76
+ return fm.fetchReq<GetorDeleteCloudShellRequest, GoogleProtobufEmpty.Empty>(`/apis/mcamel.io/rocketmq/v1alpha1/cloudshells/${req["name"]}`, {...initReq, method: "DELETE"})
77
+ }
78
+ }
package/cluster.pb.ts ADDED
@@ -0,0 +1,323 @@
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 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
+ }
29
+
30
+ export enum EventType {
31
+ EVENT_TYPE_UNSPECIFIED = "EVENT_TYPE_UNSPECIFIED",
32
+ Normal = "Normal",
33
+ Warning = "Warning",
34
+ }
35
+
36
+ export enum GetAllEventListReqSortDir {
37
+ ASC = "ASC",
38
+ DESC = "DESC",
39
+ }
40
+
41
+ export enum GetEventListReqKind {
42
+ KIND_UNSPECIFIED = "KIND_UNSPECIFIED",
43
+ Pod = "Pod",
44
+ }
45
+
46
+ export enum GetWorkspaceListReqSortDir {
47
+ ASC = "ASC",
48
+ DESC = "DESC",
49
+ }
50
+
51
+ export enum GetInsightAgentStatusRespInsightAgentStatus {
52
+ NotInstall = "NotInstall",
53
+ Install = "Install",
54
+ }
55
+
56
+ export type GetPermissionsListReq = {
57
+ workspaceId?: number
58
+ }
59
+
60
+ export type GetPermissionsListRespPermissions = {
61
+ getInstance?: boolean
62
+ createInstance?: boolean
63
+ updateInstance?: boolean
64
+ deleteInstance?: boolean
65
+ getMetric?: boolean
66
+ getInstanceLog?: boolean
67
+ getConfig?: boolean
68
+ updateConfig?: boolean
69
+ getBackup?: boolean
70
+ createBackup?: boolean
71
+ updateBackup?: boolean
72
+ deleteBackup?: boolean
73
+ getBackupConf?: boolean
74
+ createBackupConf?: boolean
75
+ updateBackupConf?: boolean
76
+ deleteBackupConf?: boolean
77
+ }
78
+
79
+ export type GetPermissionsListResp = {
80
+ permissionsBool?: GetPermissionsListRespPermissions
81
+ permissions?: PermissionsType[]
82
+ }
83
+
84
+ export type GetAllEventKindsListResp = {
85
+ data?: string[]
86
+ }
87
+
88
+ export type GetAllEventKindsListReq = {
89
+ cluster?: string
90
+ }
91
+
92
+ export type GetAllEventListReq = {
93
+ page?: number
94
+ pageSize?: number
95
+ sortDir?: GetAllEventListReqSortDir
96
+ sortBy?: string
97
+ searchKey?: string
98
+ cluster?: string
99
+ namespace?: string
100
+ name?: string
101
+ eventType?: EventType
102
+ kindName?: string
103
+ }
104
+
105
+ export type GetAllEventListRespItemsSource = {
106
+ component?: string
107
+ }
108
+
109
+ export type GetAllEventListRespItemsMetadata = {
110
+ uid?: string
111
+ name?: string
112
+ namespace?: string
113
+ annotations?: {[key: string]: string}
114
+ resourceVersion?: string
115
+ creationTimestamp?: string
116
+ }
117
+
118
+ export type GetAllEventListRespItemsInvolvedObject = {
119
+ uid?: string
120
+ kind?: string
121
+ name?: string
122
+ namespace?: string
123
+ apiVersion?: string
124
+ resourceVersion?: string
125
+ }
126
+
127
+ export type GetAllEventListRespItems = {
128
+ kind?: string
129
+ type?: string
130
+ count?: number
131
+ reason?: string
132
+ source?: GetAllEventListRespItemsSource
133
+ message?: string
134
+ metadata?: GetAllEventListRespItemsMetadata
135
+ apiVersion?: string
136
+ lastTimestamp?: string
137
+ firstTimestamp?: string
138
+ involvedObject?: GetAllEventListRespItemsInvolvedObject
139
+ reportingInstance?: string
140
+ reportingComponent?: string
141
+ }
142
+
143
+ export type GetAllEventListResp = {
144
+ items?: GetAllEventListRespItems[]
145
+ pagination?: CommonCommon.Pagination
146
+ }
147
+
148
+ export type GetClusterNodeLabelListReq = {
149
+ cluster?: string
150
+ }
151
+
152
+ export type GetClusterNodeLabelListRespLabel = {
153
+ key?: string
154
+ value?: string[]
155
+ }
156
+
157
+ export type GetClusterNodeLabelListResp = {
158
+ items?: GetClusterNodeLabelListRespLabel[]
159
+ pagination?: CommonCommon.Pagination
160
+ }
161
+
162
+ export type GetClusterPodLabelListReq = {
163
+ page?: number
164
+ pageSize?: number
165
+ searchKey?: string
166
+ filterNamespace?: string
167
+ cluster?: string
168
+ }
169
+
170
+ export type GetClusterPodLabelListRespLabel = {
171
+ key?: string
172
+ value?: string[]
173
+ }
174
+
175
+ export type GetClusterPodLabelListResp = {
176
+ items?: GetClusterPodLabelListRespLabel[]
177
+ pagination?: CommonCommon.Pagination
178
+ }
179
+
180
+ export type GetClusterNodePortListReq = {
181
+ cluster?: string
182
+ }
183
+
184
+ export type GetClusterNodePortListResp = {
185
+ items?: string[]
186
+ pagination?: CommonCommon.Pagination
187
+ }
188
+
189
+ export type EventSource = {
190
+ component?: string
191
+ host?: string
192
+ }
193
+
194
+ export type GetMetallbIPAddressPoolsListReq = {
195
+ cluster?: string
196
+ }
197
+
198
+ export type GetMetallbIPAddressPoolsListRespItem = {
199
+ name?: string
200
+ addresses?: string[]
201
+ autoAssign?: boolean
202
+ avoidBuggyIPs?: boolean
203
+ }
204
+
205
+ export type GetMetallbIPAddressPoolsListResp = {
206
+ items?: GetMetallbIPAddressPoolsListRespItem[]
207
+ isSupportLb?: boolean
208
+ externalTrafficPolicy?: CommonCommon.ExternalTrafficPolicy[]
209
+ lbTyp?: CommonCommon.LBTyp[]
210
+ }
211
+
212
+ export type GetEventListReq = {
213
+ cluster?: string
214
+ namespace?: string
215
+ kind?: GetEventListReqKind
216
+ kindName?: string
217
+ page?: number
218
+ pageSize?: number
219
+ type?: EventType[]
220
+ }
221
+
222
+ export type ObjectReference = {
223
+ kind?: string
224
+ name?: string
225
+ }
226
+
227
+ export type GetEventListRespItem = {
228
+ involvedObject?: ObjectReference
229
+ reason?: string
230
+ message?: string
231
+ source?: EventSource
232
+ lastTimestamp?: string
233
+ type?: EventType
234
+ }
235
+
236
+ export type GetEventListResp = {
237
+ items?: GetEventListRespItem[]
238
+ pagination?: CommonCommon.Pagination
239
+ }
240
+
241
+ export type GetWorkspaceListReq = {
242
+ page?: number
243
+ pageSize?: number
244
+ sortDir?: GetWorkspaceListReqSortDir
245
+ sortBy?: string
246
+ searchKey?: string
247
+ }
248
+
249
+ export type GetWorkspaceListRespItem = {
250
+ workspaceId?: number
251
+ alias?: string
252
+ }
253
+
254
+ export type GetWorkspaceListResp = {
255
+ items?: GetWorkspaceListRespItem[]
256
+ pagination?: CommonCommon.Pagination
257
+ }
258
+
259
+ export type GetClusterListReq = {
260
+ workspaceId?: number
261
+ }
262
+
263
+ export type GetClusterListResp = {
264
+ items?: string[]
265
+ pagination?: CommonCommon.Pagination
266
+ }
267
+
268
+ export type GetClusterNamespaceListReq = {
269
+ workspaceId?: number
270
+ cluster?: string
271
+ }
272
+
273
+ export type GetClusterNamespaceListResp = {
274
+ items?: string[]
275
+ pagination?: CommonCommon.Pagination
276
+ }
277
+
278
+ export type GetInsightAgentStatusReq = {
279
+ cluster?: string
280
+ }
281
+
282
+ export type GetInsightAgentStatusResp = {
283
+ status?: GetInsightAgentStatusRespInsightAgentStatus
284
+ }
285
+
286
+ export class Cluster {
287
+ static GetClusterList(req: GetClusterListReq, initReq?: fm.InitReq): Promise<GetClusterListResp> {
288
+ return fm.fetchReq<GetClusterListReq, GetClusterListResp>(`/apis/mcamel.io/rocketmq/v1alpha1/${req["workspaceId"]}/clusters?${fm.renderURLSearchParams(req, ["workspaceId"])}`, {...initReq, method: "GET"})
289
+ }
290
+ static GetClusterNamespaceList(req: GetClusterNamespaceListReq, initReq?: fm.InitReq): Promise<GetClusterNamespaceListResp> {
291
+ return fm.fetchReq<GetClusterNamespaceListReq, GetClusterNamespaceListResp>(`/apis/mcamel.io/rocketmq/v1alpha1/${req["workspaceId"]}/${req["cluster"]}/namespaces?${fm.renderURLSearchParams(req, ["workspaceId", "cluster"])}`, {...initReq, method: "GET"})
292
+ }
293
+ static GetClusterNodePortList(req: GetClusterNodePortListReq, initReq?: fm.InitReq): Promise<GetClusterNodePortListResp> {
294
+ return fm.fetchReq<GetClusterNodePortListReq, GetClusterNodePortListResp>(`/apis/mcamel.io/rocketmq/v1alpha1/${req["cluster"]}/nodeports?${fm.renderURLSearchParams(req, ["cluster"])}`, {...initReq, method: "GET"})
295
+ }
296
+ static GetClusterNodeLabelList(req: GetClusterNodeLabelListReq, initReq?: fm.InitReq): Promise<GetClusterNodeLabelListResp> {
297
+ return fm.fetchReq<GetClusterNodeLabelListReq, GetClusterNodeLabelListResp>(`/apis/mcamel.io/rocketmq/v1alpha1/${req["cluster"]}/nodelabels?${fm.renderURLSearchParams(req, ["cluster"])}`, {...initReq, method: "GET"})
298
+ }
299
+ static GetClusterPodLabelList(req: GetClusterPodLabelListReq, initReq?: fm.InitReq): Promise<GetClusterPodLabelListResp> {
300
+ return fm.fetchReq<GetClusterPodLabelListReq, GetClusterPodLabelListResp>(`/apis/mcamel.io/rocketmq/v1alpha1/${req["cluster"]}/podlabels?${fm.renderURLSearchParams(req, ["cluster"])}`, {...initReq, method: "GET"})
301
+ }
302
+ static GetWorkspaceList(req: GetWorkspaceListReq, initReq?: fm.InitReq): Promise<GetWorkspaceListResp> {
303
+ return fm.fetchReq<GetWorkspaceListReq, GetWorkspaceListResp>(`/apis/mcamel.io/rocketmq/v1alpha1/workspaces?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
304
+ }
305
+ static GetInsightAgentStatus(req: GetInsightAgentStatusReq, initReq?: fm.InitReq): Promise<GetInsightAgentStatusResp> {
306
+ return fm.fetchReq<GetInsightAgentStatusReq, GetInsightAgentStatusResp>(`/apis/mcamel.io/rocketmq/v1alpha1/${req["cluster"]}/insight/status?${fm.renderURLSearchParams(req, ["cluster"])}`, {...initReq, method: "GET"})
307
+ }
308
+ static GetEventList(req: GetEventListReq, initReq?: fm.InitReq): Promise<GetEventListResp> {
309
+ return fm.fetchReq<GetEventListReq, GetEventListResp>(`/apis/mcamel.io/rocketmq/v1alpha1/${req["cluster"]}/${req["namespace"]}/events?${fm.renderURLSearchParams(req, ["cluster", "namespace"])}`, {...initReq, method: "GET"})
310
+ }
311
+ static GetAllEventList(req: GetAllEventListReq, initReq?: fm.InitReq): Promise<GetAllEventListResp> {
312
+ return fm.fetchReq<GetAllEventListReq, GetAllEventListResp>(`/apis/mcamel.io/rocketmq/v1alpha1/${req["cluster"]}/${req["namespace"]}/${req["name"]}/all-events?${fm.renderURLSearchParams(req, ["cluster", "namespace", "name"])}`, {...initReq, method: "GET"})
313
+ }
314
+ static GetAllEventKindsList(req: GetAllEventKindsListReq, initReq?: fm.InitReq): Promise<GetAllEventKindsListResp> {
315
+ return fm.fetchReq<GetAllEventKindsListReq, GetAllEventKindsListResp>(`/apis/mcamel.io/rocketmq/v1alpha1/${req["cluster"]}/all-events-kinds?${fm.renderURLSearchParams(req, ["cluster"])}`, {...initReq, method: "GET"})
316
+ }
317
+ static GetMetallbIPAddressPoolsList(req: GetMetallbIPAddressPoolsListReq, initReq?: fm.InitReq): Promise<GetMetallbIPAddressPoolsListResp> {
318
+ return fm.fetchReq<GetMetallbIPAddressPoolsListReq, GetMetallbIPAddressPoolsListResp>(`/apis/mcamel.io/rocketmq/v1alpha1/${req["cluster"]}/lbaddress/pools?${fm.renderURLSearchParams(req, ["cluster"])}`, {...initReq, method: "GET"})
319
+ }
320
+ static GetPermissionsList(req: GetPermissionsListReq, initReq?: fm.InitReq): Promise<GetPermissionsListResp> {
321
+ return fm.fetchReq<GetPermissionsListReq, GetPermissionsListResp>(`/apis/mcamel.io/rocketmq/v1alpha1/${req["workspaceId"]}/permissions?${fm.renderURLSearchParams(req, ["workspaceId"])}`, {...initReq, method: "GET"})
322
+ }
323
+ }
package/common.pb.ts ADDED
@@ -0,0 +1,214 @@
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 ExternalTrafficPolicy {
8
+ Cluster = "Cluster",
9
+ Local = "Local",
10
+ }
11
+
12
+ export enum LBTyp {
13
+ MetalLB = "MetalLB",
14
+ Others = "Others",
15
+ }
16
+
17
+ export enum ServiceType {
18
+ ClusterIP = "ClusterIP",
19
+ NodePort = "NodePort",
20
+ LoadBalancer = "LoadBalancer",
21
+ }
22
+
23
+ export enum PageInfoReqSortDir {
24
+ ASC = "ASC",
25
+ DESC = "DESC",
26
+ }
27
+
28
+ export enum PodCommonPodPhase {
29
+ PHASE_UNSPECIFIED = "PHASE_UNSPECIFIED",
30
+ Unknown = "Unknown",
31
+ Pending = "Pending",
32
+ Running = "Running",
33
+ Succeeded = "Succeeded",
34
+ Failed = "Failed",
35
+ }
36
+
37
+ export enum PodCommonConditionStatus {
38
+ PodConditionStatusUnknown = "PodConditionStatusUnknown",
39
+ PodConditionStatusTrue = "PodConditionStatusTrue",
40
+ PodConditionStatusFalse = "PodConditionStatusFalse",
41
+ }
42
+
43
+ export type Affinity = {
44
+ nodeAffinity?: NodeAffinity
45
+ podAffinity?: PodAffinity
46
+ podAntiAffinity?: PodAntiAffinity
47
+ }
48
+
49
+ export type PodAntiAffinity = {
50
+ requiredDuringSchedulingIgnoredDuringExecution?: PodAffinityTerm[]
51
+ preferredDuringSchedulingIgnoredDuringExecution?: WeightedPodAffinityTerm[]
52
+ }
53
+
54
+ export type NodeAffinity = {
55
+ requiredDuringSchedulingIgnoredDuringExecution?: NodeSelector
56
+ preferredDuringSchedulingIgnoredDuringExecution?: PreferredSchedulingTerm[]
57
+ }
58
+
59
+ export type NodeSelector = {
60
+ nodeSelectorTerms?: NodeSelectorTerm[]
61
+ }
62
+
63
+ export type NodeSelectorTerm = {
64
+ matchExpressions?: NodeSelectorRequirement[]
65
+ matchFields?: NodeSelectorRequirement[]
66
+ }
67
+
68
+ export type NodeSelectorRequirement = {
69
+ key?: string
70
+ values?: string[]
71
+ operator?: string
72
+ }
73
+
74
+ export type PreferredSchedulingTerm = {
75
+ weight?: number
76
+ preference?: NodeSelectorTerm
77
+ }
78
+
79
+ export type PodAffinity = {
80
+ requiredDuringSchedulingIgnoredDuringExecution?: PodAffinityTerm[]
81
+ preferredDuringSchedulingIgnoredDuringExecution?: WeightedPodAffinityTerm[]
82
+ }
83
+
84
+ export type WeightedPodAffinityTerm = {
85
+ weight?: number
86
+ podAffinityTerm?: PodAffinityTerm
87
+ }
88
+
89
+ export type PodAffinityTerm = {
90
+ labelSelector?: LabelSelector
91
+ namespaces?: string[]
92
+ topologyKey?: string
93
+ namespaceSelector?: LabelSelector
94
+ }
95
+
96
+ export type LabelSelector = {
97
+ matchLabels?: {[key: string]: string}
98
+ matchExpressions?: LabelSelectorRequirement[]
99
+ }
100
+
101
+ export type LabelSelectorRequirement = {
102
+ key?: string
103
+ values?: string[]
104
+ operator?: string
105
+ }
106
+
107
+ export type Toleration = {
108
+ key?: string
109
+ operator?: string
110
+ value?: string
111
+ effect?: string
112
+ tolerationSeconds?: string
113
+ }
114
+
115
+ export type Pagination = {
116
+ total?: number
117
+ page?: number
118
+ pageSize?: number
119
+ pages?: number
120
+ }
121
+
122
+ export type PageInfoReq = {
123
+ page?: number
124
+ pageSize?: number
125
+ sortDir?: PageInfoReqSortDir
126
+ sortBy?: string
127
+ }
128
+
129
+ export type PodCommonCondition = {
130
+ lastTransitionTime?: string
131
+ lastUpdateTime?: string
132
+ message?: string
133
+ reason?: string
134
+ status?: PodCommonConditionStatus
135
+ type?: string
136
+ }
137
+
138
+ export type PodCommon = {
139
+ name?: string
140
+ phase?: PodCommonPodPhase
141
+ ip?: string
142
+ restartCount?: number
143
+ createTimestamp?: string
144
+ cpuUsage?: number
145
+ cpuLimit?: number
146
+ memoryUsage?: number
147
+ memoryLimit?: number
148
+ pvUsedInGb?: number
149
+ pvAllocatedInGb?: number
150
+ conditions?: PodCommonCondition[]
151
+ containersName?: string[]
152
+ ownerReference?: OwnerReference[]
153
+ initContainersName?: string[]
154
+ initContainersStatuses?: ContainerStatus[]
155
+ }
156
+
157
+ export type OwnerReference = {
158
+ uid?: string
159
+ controller?: boolean
160
+ name?: string
161
+ kind?: string
162
+ }
163
+
164
+ export type CommonItemStatus = {
165
+ serviceAddresses?: string[]
166
+ webManagerAddress?: string
167
+ webLogAddress?: string
168
+ avgPvAllocatedInGb?: number
169
+ avgPvUsedInGb?: number
170
+ }
171
+
172
+ export type AccessWhitelistInternal = {
173
+ namespace?: string
174
+ podSelector?: {[key: string]: string}
175
+ }
176
+
177
+ export type AccessWhitelistExternal = {
178
+ cidr?: string
179
+ ip?: string
180
+ }
181
+
182
+ export type AccessWhitelist = {
183
+ internals?: AccessWhitelistInternal[]
184
+ externals?: AccessWhitelistExternal[]
185
+ }
186
+
187
+ export type ContainerStatus = {
188
+ name?: string
189
+ state?: ContainerState
190
+ }
191
+
192
+ export type ContainerState = {
193
+ waiting?: ContainerStateWaiting
194
+ running?: ContainerStateRunning
195
+ terminated?: ContainerStateTerminated
196
+ }
197
+
198
+ export type ContainerStateWaiting = {
199
+ reason?: string
200
+ message?: string
201
+ }
202
+
203
+ export type ContainerStateRunning = {
204
+ startedAt?: string
205
+ }
206
+
207
+ export type ContainerStateTerminated = {
208
+ exitCode?: number
209
+ signal?: number
210
+ reason?: string
211
+ message?: string
212
+ startedAt?: string
213
+ finishedAt?: string
214
+ }
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/insight.pb.ts ADDED
@@ -0,0 +1,42 @@
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 Severity {
8
+ SEVERITY_UNSPECIFIED = "SEVERITY_UNSPECIFIED",
9
+ CRITICAL = "CRITICAL",
10
+ WARNING = "WARNING",
11
+ INFO = "INFO",
12
+ }
13
+
14
+ export enum TargetType {
15
+ TARGET_TYPE_UNSPECIFIED = "TARGET_TYPE_UNSPECIFIED",
16
+ GLOBAL = "GLOBAL",
17
+ CLUSTER = "CLUSTER",
18
+ NAMESPACE = "NAMESPACE",
19
+ NODE = "NODE",
20
+ DEPLOYMENT = "DEPLOYMENT",
21
+ STATEFULSET = "STATEFULSET",
22
+ DAEMONSET = "DAEMONSET",
23
+ POD = "POD",
24
+ }
25
+
26
+ export type AlertSummary = {
27
+ id?: string
28
+ groupName?: string
29
+ groupId?: string
30
+ ruleName?: string
31
+ ruleId?: string
32
+ clusterName?: string
33
+ namespace?: string
34
+ targetType?: TargetType
35
+ target?: string
36
+ severity?: Severity
37
+ value?: string
38
+ notifyResponse?: string
39
+ description?: string
40
+ startAt?: string
41
+ updateAt?: string
42
+ }
package/metric.pb.ts ADDED
@@ -0,0 +1,25 @@
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
+ import * as InsightIoApiInsightV1alpha1Insight from "./insight.pb"
10
+ export type GetAlertsListReq = {
11
+ cluster?: string
12
+ namespace?: string
13
+ name?: string
14
+ }
15
+
16
+ export type GetAlertsListResp = {
17
+ items?: InsightIoApiInsightV1alpha1Insight.AlertSummary[]
18
+ pagination?: CommonCommon.Pagination
19
+ }
20
+
21
+ export class Metric {
22
+ static GetAlertsList(req: GetAlertsListReq, initReq?: fm.InitReq): Promise<GetAlertsListResp> {
23
+ return fm.fetchReq<GetAlertsListReq, GetAlertsListResp>(`/apis/mcamel.io/rocketmq/v1alpha1/${req["cluster"]}/${req["namespace"]}/${req["name"]}/alerts?${fm.renderURLSearchParams(req, ["cluster", "namespace", "name"])}`, {...initReq, method: "GET"})
24
+ }
25
+ }
package/package.json ADDED
@@ -0,0 +1,12 @@
1
+ {
2
+ "name":"@daocloud-proto/mcamel-rocketmq",
3
+ "version":"0.0.1",
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/rocketmq.pb.ts ADDED
@@ -0,0 +1,389 @@
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 GetRocketMqListReqSortDir {
26
+ ASC = "ASC",
27
+ DESC = "DESC",
28
+ }
29
+
30
+ export enum GetRocketMqConfReqSortDir {
31
+ ASC = "ASC",
32
+ DESC = "DESC",
33
+ }
34
+
35
+ export enum GetRocketMqParamRespSelectSelectType {
36
+ Single = "Single",
37
+ Multiple = "Multiple",
38
+ }
39
+
40
+ export enum GetRocketMqPodListReqSortDir {
41
+ ASC = "ASC",
42
+ DESC = "DESC",
43
+ }
44
+
45
+ export enum GetRocketMqPodListRespPodStatus {
46
+ PHASE_UNSPECIFIED = "PHASE_UNSPECIFIED",
47
+ Unknown = "Unknown",
48
+ Pending = "Pending",
49
+ Running = "Running",
50
+ Succeeded = "Succeeded",
51
+ Failed = "Failed",
52
+ }
53
+
54
+ export enum GetRocketMqPodListRespPodType {
55
+ PodTypeUnknown = "PodTypeUnknown",
56
+ PodTypePrimary = "PodTypePrimary",
57
+ PodTypeSecondary = "PodTypeSecondary",
58
+ }
59
+
60
+ export enum GetRocketMqConfRespItemsParamType {
61
+ conf = "conf",
62
+ }
63
+
64
+ export type GetRocketMqUsersReq = {
65
+ cluster?: string
66
+ namespace?: string
67
+ name?: string
68
+ }
69
+
70
+ export type GetRocketMqUsersRespUserItem = {
71
+ username?: string
72
+ password?: string
73
+ }
74
+
75
+ export type GetRocketMqUsersResp = {
76
+ users?: GetRocketMqUsersRespUserItem[]
77
+ }
78
+
79
+ export type GetRocketMqListReq = {
80
+ page?: number
81
+ pageSize?: number
82
+ sortDir?: GetRocketMqListReqSortDir
83
+ sortBy?: string
84
+ searchKey?: string
85
+ workspaceId?: number
86
+ filterCluster?: string
87
+ filterNamespace?: string
88
+ }
89
+
90
+ export type GetRocketMqConfReq = {
91
+ page?: number
92
+ pageSize?: number
93
+ sortDir?: GetRocketMqConfReqSortDir
94
+ sortBy?: string
95
+ searchKey?: string
96
+ cluster?: string
97
+ namespace?: string
98
+ name?: string
99
+ }
100
+
101
+ export type GetRocketMqParamReq = {
102
+ cluster?: string
103
+ }
104
+
105
+ export type CreateRocketMqReqPorts = {
106
+ name?: string
107
+ protocol?: string
108
+ port?: number
109
+ targetPort?: number
110
+ nodePort?: number
111
+ }
112
+
113
+ export type CreateRocketMqReq = {
114
+ workspaceId?: number
115
+ cluster?: string
116
+ namespace?: string
117
+ name?: string
118
+ describe?: string
119
+ version?: string
120
+ groupSize?: number
121
+ replicaPerGroup?: number
122
+ brokerSyncMode?: string
123
+ rootName?: string
124
+ rootPassword?: string
125
+ storageClassName?: string
126
+ storageCapacity?: string
127
+ serviceType?: CommonCommon.ServiceType
128
+ serviceAnnotations?: {[key: string]: string}
129
+ ports?: CreateRocketMqReqPorts[]
130
+ cpuRequest?: string
131
+ cpuLimit?: string
132
+ memoryRequest?: string
133
+ memoryLimit?: string
134
+ externalTrafficPolicy?: CommonCommon.ExternalTrafficPolicy
135
+ lbTyp?: CommonCommon.LBTyp
136
+ lbPoolName?: string
137
+ lbAddress?: string
138
+ conf?: string
139
+ nameServiceCpuRequest?: string
140
+ nameServiceCpuLimit?: string
141
+ nameServiceMemoryRequest?: string
142
+ nameServiceMemoryLimit?: string
143
+ nameServiceStorageClassName?: string
144
+ nameServiceStorageCapacity?: string
145
+ isOpenConsole?: boolean
146
+ consoleServiceType?: CommonCommon.ServiceType
147
+ consoleNodePort?: number
148
+ consoleCpuRequest?: string
149
+ consoleCpuLimit?: string
150
+ consoleMemoryRequest?: string
151
+ consoleMemoryLimit?: string
152
+ consoleExternalTrafficPolicy?: CommonCommon.ExternalTrafficPolicy
153
+ consoleLbTyp?: CommonCommon.LBTyp
154
+ consoleLbPoolName?: string
155
+ consoleLbAddress?: string
156
+ serviceMonitorInterval?: string
157
+ affinity?: CommonCommon.Affinity
158
+ }
159
+
160
+ export type UpdateRocketMqConfReq = {
161
+ cluster?: string
162
+ namespace?: string
163
+ name?: string
164
+ conf?: string
165
+ }
166
+
167
+ export type UpdateRocketMqParamsResp = {
168
+ message?: string
169
+ }
170
+
171
+ export type UpdateRocketMqConfResp = {
172
+ message?: string
173
+ }
174
+
175
+ export type GetRocketMqParamRespSelectDataStringValue = {
176
+ value?: string
177
+ }
178
+
179
+ export type GetRocketMqParamRespSelectDataResourceValue = {
180
+ cpuRequest?: string
181
+ cpuLimit?: string
182
+ memoryRequest?: string
183
+ memoryLimit?: string
184
+ }
185
+
186
+ export type GetRocketMqParamRespSelectDataIntValue = {
187
+ value?: number
188
+ }
189
+
190
+ export type GetRocketMqParamRespSelectDataStorageClassValue = {
191
+ name?: string
192
+ allowVolumeExpansion?: boolean
193
+ }
194
+
195
+
196
+ type BaseGetRocketMqParamRespSelectData = {
197
+ }
198
+
199
+ export type GetRocketMqParamRespSelectData = BaseGetRocketMqParamRespSelectData
200
+ & OneOf<{ sValue: GetRocketMqParamRespSelectDataStringValue; rValue: GetRocketMqParamRespSelectDataResourceValue; iValue: GetRocketMqParamRespSelectDataIntValue; scValue: GetRocketMqParamRespSelectDataStorageClassValue }>
201
+
202
+ export type GetRocketMqParamRespSelect = {
203
+ selectType?: GetRocketMqParamRespSelectSelectType
204
+ data?: GetRocketMqParamRespSelectData[]
205
+ }
206
+
207
+ export type GetRocketMqParamResp = {
208
+ version?: GetRocketMqParamRespSelect
209
+ conf?: GetRocketMqParamRespSelect
210
+ replicas?: GetRocketMqParamRespSelect
211
+ resource?: GetRocketMqParamRespSelect
212
+ storage?: GetRocketMqParamRespSelect
213
+ }
214
+
215
+ export type GetRocketMqBackupProviderListResp = {
216
+ provider?: GetRocketMqParamRespSelect
217
+ }
218
+
219
+ export type CreateRocketMqResp = {
220
+ message?: string
221
+ }
222
+
223
+ export type GetRocketMqOperatorVersionListReq = {
224
+ }
225
+
226
+ export type GetRocketMqOperatorVersionListRespGetRocketMqOperatorVersionListData = {
227
+ cluster?: string
228
+ namespace?: string
229
+ version?: string
230
+ }
231
+
232
+ export type GetRocketMqOperatorVersionListResp = {
233
+ items?: GetRocketMqOperatorVersionListRespGetRocketMqOperatorVersionListData[]
234
+ pagination?: CommonCommon.Pagination
235
+ }
236
+
237
+ export type DeleteRocketMqReq = {
238
+ cluster?: string
239
+ namespace?: string
240
+ name?: string
241
+ }
242
+
243
+ export type DeleteRocketMqsReq = {
244
+ data?: DeleteRocketMqReq[]
245
+ }
246
+
247
+ export type DeleteRocketMqResp = {
248
+ message?: string
249
+ }
250
+
251
+ export type DeleteRocketMqsResp = {
252
+ message?: string
253
+ }
254
+
255
+ export type GetRocketMqPodListReq = {
256
+ cluster?: string
257
+ namespace?: string
258
+ name?: string
259
+ page?: number
260
+ pageSize?: number
261
+ sortDir?: GetRocketMqPodListReqSortDir
262
+ sortBy?: string
263
+ searchKey?: string
264
+ }
265
+
266
+ export type GetRocketMqPodListRespData = {
267
+ podName?: string
268
+ status?: GetRocketMqPodListRespPodStatus
269
+ ip?: string
270
+ restart?: number
271
+ cpuUsage?: number
272
+ cpuLimit?: number
273
+ memoryUsage?: number
274
+ memoryLimit?: number
275
+ createTimestamp?: string
276
+ podType?: GetRocketMqPodListRespPodType
277
+ common?: CommonCommon.PodCommon
278
+ }
279
+
280
+ export type GetRocketMqPodListResp = {
281
+ items?: GetRocketMqPodListRespData[]
282
+ pagination?: CommonCommon.Pagination
283
+ }
284
+
285
+ export type GetRocketMqGrafanaAddrReq = {
286
+ cluster?: string
287
+ namespace?: string
288
+ name?: string
289
+ from?: string
290
+ to?: string
291
+ }
292
+
293
+ export type GetRocketMqGrafanaAddrResp = {
294
+ data?: string
295
+ }
296
+
297
+ export type GetRocketMqReq = {
298
+ cluster?: string
299
+ namespace?: string
300
+ name?: string
301
+ }
302
+
303
+ export type GetRocketMqResp = {
304
+ data?: RocketMqItem
305
+ }
306
+
307
+ export type GetRocketMqConfRespItems = {
308
+ paramType?: GetRocketMqConfRespItemsParamType
309
+ paramName?: string
310
+ value?: string
311
+ }
312
+
313
+ export type GetRocketMqConfResp = {
314
+ items?: GetRocketMqConfRespItems[]
315
+ pagination?: CommonCommon.Pagination
316
+ conf?: UpdateRocketMqConfReq
317
+ }
318
+
319
+ export type GetRocketMqListResp = {
320
+ items?: RocketMqItem[]
321
+ pagination?: CommonCommon.Pagination
322
+ }
323
+
324
+ export type RocketMqItemStatus = {
325
+ status?: Status
326
+ podsAreReadyNum?: number
327
+ clusterIPs?: string[]
328
+ common?: CommonCommon.CommonItemStatus
329
+ cpuUtilization?: number
330
+ memoryUtilization?: number
331
+ avgReplicationLagInSecond?: number
332
+ }
333
+
334
+ export type RocketMqItemMetadata = {
335
+ annotations?: {[key: string]: string}
336
+ creationTimestamp?: string
337
+ name?: string
338
+ namespace?: string
339
+ }
340
+
341
+ export type RocketMqItem = {
342
+ apiVersion?: string
343
+ kind?: string
344
+ metadata?: RocketMqItemMetadata
345
+ spec?: CreateRocketMqReq
346
+ status?: RocketMqItemStatus
347
+ }
348
+
349
+ export class RocketMq {
350
+ static GetRocketMqList(req: GetRocketMqListReq, initReq?: fm.InitReq): Promise<GetRocketMqListResp> {
351
+ return fm.fetchReq<GetRocketMqListReq, GetRocketMqListResp>(`/apis/mcamel.io/rocketmq/v1alpha1/${req["workspaceId"]}/rocketmqs?${fm.renderURLSearchParams(req, ["workspaceId"])}`, {...initReq, method: "GET"})
352
+ }
353
+ static GetRocketMqOperatorVersionList(req: GetRocketMqOperatorVersionListReq, initReq?: fm.InitReq): Promise<GetRocketMqOperatorVersionListResp> {
354
+ return fm.fetchReq<GetRocketMqOperatorVersionListReq, GetRocketMqOperatorVersionListResp>(`/apis/mcamel.io/rocketmq/v1alpha1/rocketmq-operator/versions?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
355
+ }
356
+ static GetRocketMq(req: GetRocketMqReq, initReq?: fm.InitReq): Promise<GetRocketMqResp> {
357
+ return fm.fetchReq<GetRocketMqReq, GetRocketMqResp>(`/apis/mcamel.io/rocketmq/v1alpha1/rocketmq/${req["cluster"]}/${req["namespace"]}/${req["name"]}?${fm.renderURLSearchParams(req, ["cluster", "namespace", "name"])}`, {...initReq, method: "GET"})
358
+ }
359
+ static GetRocketMqParam(req: GetRocketMqParamReq, initReq?: fm.InitReq): Promise<GetRocketMqParamResp> {
360
+ return fm.fetchReq<GetRocketMqParamReq, GetRocketMqParamResp>(`/apis/mcamel.io/rocketmq/v1alpha1/rocketmq-params/${req["cluster"]}?${fm.renderURLSearchParams(req, ["cluster"])}`, {...initReq, method: "GET"})
361
+ }
362
+ static GetRocketMqPodList(req: GetRocketMqPodListReq, initReq?: fm.InitReq): Promise<GetRocketMqPodListResp> {
363
+ return fm.fetchReq<GetRocketMqPodListReq, GetRocketMqPodListResp>(`/apis/mcamel.io/rocketmq/v1alpha1/rocketmq/${req["cluster"]}/${req["namespace"]}/${req["name"]}/pods?${fm.renderURLSearchParams(req, ["cluster", "namespace", "name"])}`, {...initReq, method: "GET"})
364
+ }
365
+ static GetRocketMqGrafanaAddr(req: GetRocketMqGrafanaAddrReq, initReq?: fm.InitReq): Promise<GetRocketMqGrafanaAddrResp> {
366
+ return fm.fetchReq<GetRocketMqGrafanaAddrReq, GetRocketMqGrafanaAddrResp>(`/apis/mcamel.io/rocketmq/v1alpha1/rocketmq/${req["cluster"]}/${req["namespace"]}/${req["name"]}/grafana?${fm.renderURLSearchParams(req, ["cluster", "namespace", "name"])}`, {...initReq, method: "GET"})
367
+ }
368
+ static CreateRocketMq(req: CreateRocketMqReq, initReq?: fm.InitReq): Promise<CreateRocketMqResp> {
369
+ return fm.fetchReq<CreateRocketMqReq, CreateRocketMqResp>(`/apis/mcamel.io/rocketmq/v1alpha1/rocketmq`, {...initReq, method: "POST", body: JSON.stringify(req)})
370
+ }
371
+ static GetRocketMqConfs(req: GetRocketMqConfReq, initReq?: fm.InitReq): Promise<GetRocketMqConfResp> {
372
+ return fm.fetchReq<GetRocketMqConfReq, GetRocketMqConfResp>(`/apis/mcamel.io/rocketmq/v1alpha1/rocketmq/${req["cluster"]}/${req["namespace"]}/${req["name"]}/confs?${fm.renderURLSearchParams(req, ["cluster", "namespace", "name"])}`, {...initReq, method: "GET"})
373
+ }
374
+ static UpdateRocketMqConf(req: UpdateRocketMqConfReq, initReq?: fm.InitReq): Promise<UpdateRocketMqConfResp> {
375
+ return fm.fetchReq<UpdateRocketMqConfReq, UpdateRocketMqConfResp>(`/apis/mcamel.io/rocketmq/v1alpha1/rocketmq/${req["cluster"]}/${req["namespace"]}/${req["name"]}/conf`, {...initReq, method: "PUT", body: JSON.stringify(req)})
376
+ }
377
+ static UpdateRocketMqParams(req: CreateRocketMqReq, initReq?: fm.InitReq): Promise<UpdateRocketMqParamsResp> {
378
+ return fm.fetchReq<CreateRocketMqReq, UpdateRocketMqParamsResp>(`/apis/mcamel.io/rocketmq/v1alpha1/rocketmq/${req["cluster"]}/${req["namespace"]}/${req["name"]}/params`, {...initReq, method: "PUT", body: JSON.stringify(req)})
379
+ }
380
+ static DeleteRocketMq(req: DeleteRocketMqReq, initReq?: fm.InitReq): Promise<DeleteRocketMqResp> {
381
+ return fm.fetchReq<DeleteRocketMqReq, DeleteRocketMqResp>(`/apis/mcamel.io/rocketmq/v1alpha1/rocketmq/${req["cluster"]}/${req["namespace"]}/${req["name"]}`, {...initReq, method: "DELETE"})
382
+ }
383
+ static DeleteRocketMqs(req: DeleteRocketMqsReq, initReq?: fm.InitReq): Promise<DeleteRocketMqsResp> {
384
+ return fm.fetchReq<DeleteRocketMqsReq, DeleteRocketMqsResp>(`/apis/mcamel.io/rocketmq/v1alpha1/rocketmqs`, {...initReq, method: "POST", body: JSON.stringify(req)})
385
+ }
386
+ static GetRocketMqUsers(req: GetRocketMqUsersReq, initReq?: fm.InitReq): Promise<GetRocketMqUsersResp> {
387
+ return fm.fetchReq<GetRocketMqUsersReq, GetRocketMqUsersResp>(`/apis/mcamel.io/rocketmq/v1alpha1/rocketmq/${req["cluster"]}/${req["namespace"]}/${req["name"]}/users?${fm.renderURLSearchParams(req, ["cluster", "namespace", "name"])}`, {...initReq, method: "GET"})
388
+ }
389
+ }
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/rocketmq/v1alpha1/rocketmq/version?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
26
+ }
27
+ }