@daocloud-proto/mcamel-minio 0.0.1-2
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 +126 -0
- package/common.pb.ts +61 -0
- package/fetch.pb.ts +232 -0
- package/minio.pb.ts +341 -0
- package/package.json +12 -0
- package/version.pb.ts +27 -0
package/cluster.pb.ts
ADDED
|
@@ -0,0 +1,126 @@
|
|
|
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 EventType {
|
|
11
|
+
EVENT_TYPE_UNSPECIFIED = "EVENT_TYPE_UNSPECIFIED",
|
|
12
|
+
Normal = "Normal",
|
|
13
|
+
Warning = "Warning",
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export enum GetEventListReqKind {
|
|
17
|
+
KIND_UNSPECIFIED = "KIND_UNSPECIFIED",
|
|
18
|
+
Pod = "Pod",
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export enum GetWorkspaceListReqSortDir {
|
|
22
|
+
ASC = "ASC",
|
|
23
|
+
DESC = "DESC",
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export enum GetInsightAgentStatusRespInsightAgentStatus {
|
|
27
|
+
NotInstall = "NotInstall",
|
|
28
|
+
Install = "Install",
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export type EventSource = {
|
|
32
|
+
component?: string
|
|
33
|
+
host?: string
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export type GetEventListReq = {
|
|
37
|
+
cluster?: string
|
|
38
|
+
namespace?: string
|
|
39
|
+
kind?: GetEventListReqKind
|
|
40
|
+
kindName?: string
|
|
41
|
+
page?: number
|
|
42
|
+
pageSize?: number
|
|
43
|
+
type?: EventType[]
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export type ObjectReference = {
|
|
47
|
+
kind?: string
|
|
48
|
+
name?: string
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export type GetEventListRespItem = {
|
|
52
|
+
involvedObject?: ObjectReference
|
|
53
|
+
reason?: string
|
|
54
|
+
message?: string
|
|
55
|
+
source?: EventSource
|
|
56
|
+
lastTimestamp?: string
|
|
57
|
+
type?: EventType
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export type GetEventListResp = {
|
|
61
|
+
items?: GetEventListRespItem[]
|
|
62
|
+
pagination?: CommonCommon.Pagination
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export type GetWorkspaceListReq = {
|
|
66
|
+
page?: number
|
|
67
|
+
pageSize?: number
|
|
68
|
+
sortDir?: GetWorkspaceListReqSortDir
|
|
69
|
+
sortBy?: string
|
|
70
|
+
searchKey?: string
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export type GetWorkspaceListRespItem = {
|
|
74
|
+
workspaceId?: number
|
|
75
|
+
alias?: string
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export type GetWorkspaceListResp = {
|
|
79
|
+
items?: GetWorkspaceListRespItem[]
|
|
80
|
+
pagination?: CommonCommon.Pagination
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export type GetClusterListReq = {
|
|
84
|
+
workspaceId?: number
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export type GetClusterListResp = {
|
|
88
|
+
items?: string[]
|
|
89
|
+
pagination?: CommonCommon.Pagination
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export type GetClusterNamespaceListReq = {
|
|
93
|
+
workspaceId?: number
|
|
94
|
+
cluster?: string
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export type GetClusterNamespaceListResp = {
|
|
98
|
+
items?: string[]
|
|
99
|
+
pagination?: CommonCommon.Pagination
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export type GetInsightAgentStatusReq = {
|
|
103
|
+
cluster?: string
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export type GetInsightAgentStatusResp = {
|
|
107
|
+
status?: GetInsightAgentStatusRespInsightAgentStatus
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export class Cluster {
|
|
111
|
+
static GetClusterList(req: GetClusterListReq, initReq?: fm.InitReq): Promise<GetClusterListResp> {
|
|
112
|
+
return fm.fetchReq<GetClusterListReq, GetClusterListResp>(`/apis/mcamel.io/minio/v1alpha1/${req["workspaceId"]}/clusters?${fm.renderURLSearchParams(req, ["workspaceId"])}`, {...initReq, method: "GET"})
|
|
113
|
+
}
|
|
114
|
+
static GetClusterNamespaceList(req: GetClusterNamespaceListReq, initReq?: fm.InitReq): Promise<GetClusterNamespaceListResp> {
|
|
115
|
+
return fm.fetchReq<GetClusterNamespaceListReq, GetClusterNamespaceListResp>(`/apis/mcamel.io/minio/v1alpha1/${req["workspaceId"]}/${req["cluster"]}/namespaces?${fm.renderURLSearchParams(req, ["workspaceId", "cluster"])}`, {...initReq, method: "GET"})
|
|
116
|
+
}
|
|
117
|
+
static GetWorkspaceList(req: GetWorkspaceListReq, initReq?: fm.InitReq): Promise<GetWorkspaceListResp> {
|
|
118
|
+
return fm.fetchReq<GetWorkspaceListReq, GetWorkspaceListResp>(`/apis/mcamel.io/minio/v1alpha1/workspaces?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
|
|
119
|
+
}
|
|
120
|
+
static GetInsightAgentStatus(req: GetInsightAgentStatusReq, initReq?: fm.InitReq): Promise<GetInsightAgentStatusResp> {
|
|
121
|
+
return fm.fetchReq<GetInsightAgentStatusReq, GetInsightAgentStatusResp>(`/apis/mcamel.io/minio/v1alpha1/${req["cluster"]}/insight/status?${fm.renderURLSearchParams(req, ["cluster"])}`, {...initReq, method: "GET"})
|
|
122
|
+
}
|
|
123
|
+
static GetEventList(req: GetEventListReq, initReq?: fm.InitReq): Promise<GetEventListResp> {
|
|
124
|
+
return fm.fetchReq<GetEventListReq, GetEventListResp>(`/apis/mcamel.io/minio/v1alpha1/${req["cluster"]}/${req["namespace"]}/events?${fm.renderURLSearchParams(req, ["cluster", "namespace"])}`, {...initReq, method: "GET"})
|
|
125
|
+
}
|
|
126
|
+
}
|
package/common.pb.ts
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
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 enum PodCommonPodPhase {
|
|
13
|
+
PHASE_UNSPECIFIED = "PHASE_UNSPECIFIED",
|
|
14
|
+
Unknown = "Unknown",
|
|
15
|
+
Pending = "Pending",
|
|
16
|
+
Running = "Running",
|
|
17
|
+
Succeeded = "Succeeded",
|
|
18
|
+
Failed = "Failed",
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export enum PodCommonConditionStatus {
|
|
22
|
+
PodConditionStatusUnknown = "PodConditionStatusUnknown",
|
|
23
|
+
PodConditionStatusTrue = "PodConditionStatusTrue",
|
|
24
|
+
PodConditionStatusFalse = "PodConditionStatusFalse",
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export type Pagination = {
|
|
28
|
+
total?: number
|
|
29
|
+
page?: number
|
|
30
|
+
pageSize?: number
|
|
31
|
+
pages?: number
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export type PageInfoReq = {
|
|
35
|
+
page?: number
|
|
36
|
+
pageSize?: number
|
|
37
|
+
sortDir?: PageInfoReqSortDir
|
|
38
|
+
sortBy?: string
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export type PodCommonCondition = {
|
|
42
|
+
lastTransitionTime?: string
|
|
43
|
+
lastUpdateTime?: string
|
|
44
|
+
message?: string
|
|
45
|
+
reason?: string
|
|
46
|
+
status?: PodCommonConditionStatus
|
|
47
|
+
type?: string
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export type PodCommon = {
|
|
51
|
+
name?: string
|
|
52
|
+
phase?: PodCommonPodPhase
|
|
53
|
+
ip?: string
|
|
54
|
+
restartCount?: number
|
|
55
|
+
createTimestamp?: string
|
|
56
|
+
cpuUsage?: number
|
|
57
|
+
cpuLimit?: number
|
|
58
|
+
memoryUsage?: number
|
|
59
|
+
memoryLimit?: number
|
|
60
|
+
conditions?: PodCommonCondition[]
|
|
61
|
+
}
|
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/minio.pb.ts
ADDED
|
@@ -0,0 +1,341 @@
|
|
|
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 GetMinioListReqSortDir {
|
|
26
|
+
ASC = "ASC",
|
|
27
|
+
DESC = "DESC",
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export enum GetMinioConfReqSortDir {
|
|
31
|
+
ASC = "ASC",
|
|
32
|
+
DESC = "DESC",
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export enum CreateMinioReqServiceType {
|
|
36
|
+
ClusterIP = "ClusterIP",
|
|
37
|
+
NodePort = "NodePort",
|
|
38
|
+
LoadBalancer = "LoadBalancer",
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export enum CreateMinioReqInstanceType {
|
|
42
|
+
HighAvailable = "HighAvailable",
|
|
43
|
+
Single = "Single",
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export enum GetMinioParamRespSelectSelectType {
|
|
47
|
+
Single = "Single",
|
|
48
|
+
Multiple = "Multiple",
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export enum GetMinioNodeListReqSortDir {
|
|
52
|
+
ASC = "ASC",
|
|
53
|
+
DESC = "DESC",
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export enum GetMinioNodeListRespPodStatus {
|
|
57
|
+
PHASE_UNSPECIFIED = "PHASE_UNSPECIFIED",
|
|
58
|
+
Unknown = "Unknown",
|
|
59
|
+
Pending = "Pending",
|
|
60
|
+
Running = "Running",
|
|
61
|
+
Succeeded = "Succeeded",
|
|
62
|
+
Failed = "Failed",
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export enum GetMinioConfRespItemsParamType {
|
|
66
|
+
conf = "conf",
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export type GetMinioListReq = {
|
|
70
|
+
page?: number
|
|
71
|
+
pageSize?: number
|
|
72
|
+
sortDir?: GetMinioListReqSortDir
|
|
73
|
+
sortBy?: string
|
|
74
|
+
searchKey?: string
|
|
75
|
+
workspaceId?: number
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export type GetMinioConfReq = {
|
|
79
|
+
page?: number
|
|
80
|
+
pageSize?: number
|
|
81
|
+
sortDir?: GetMinioConfReqSortDir
|
|
82
|
+
sortBy?: string
|
|
83
|
+
searchKey?: string
|
|
84
|
+
cluster?: string
|
|
85
|
+
namespace?: string
|
|
86
|
+
name?: string
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export type GetMinioParamReq = {
|
|
90
|
+
cluster?: string
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export type CreateMinioReqPorts = {
|
|
94
|
+
name?: string
|
|
95
|
+
protocol?: string
|
|
96
|
+
port?: number
|
|
97
|
+
targetPort?: number
|
|
98
|
+
nodePort?: number
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export type CreateMinioReq = {
|
|
102
|
+
workspaceId?: number
|
|
103
|
+
cluster?: string
|
|
104
|
+
namespace?: string
|
|
105
|
+
name?: string
|
|
106
|
+
describe?: string
|
|
107
|
+
version?: string
|
|
108
|
+
servers?: number
|
|
109
|
+
volumesPerServer?: number
|
|
110
|
+
storageClassName?: string
|
|
111
|
+
storageCapacity?: string
|
|
112
|
+
serviceType?: CreateMinioReqServiceType
|
|
113
|
+
serviceAnnotations?: {[key: string]: string}
|
|
114
|
+
ports?: CreateMinioReqPorts[]
|
|
115
|
+
cpuRequest?: string
|
|
116
|
+
cpuLimit?: string
|
|
117
|
+
memoryRequest?: string
|
|
118
|
+
memoryLimit?: string
|
|
119
|
+
instanceType?: CreateMinioReqInstanceType
|
|
120
|
+
consoleAccessKey?: string
|
|
121
|
+
consoleSecretKey?: string
|
|
122
|
+
consoleServiceType?: CreateMinioReqServiceType
|
|
123
|
+
consoleNodePort?: number
|
|
124
|
+
minioRootUser?: string
|
|
125
|
+
minioRootPassword?: string
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export type UpdateMinioConfReq = {
|
|
129
|
+
cluster?: string
|
|
130
|
+
namespace?: string
|
|
131
|
+
name?: string
|
|
132
|
+
conf?: string
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
export type UpdateMinioParamsResp = {
|
|
136
|
+
message?: string
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
export type UpdateMinioConfResp = {
|
|
140
|
+
message?: string
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
export type GetMinioParamRespSelectDataStringValue = {
|
|
144
|
+
value?: string
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
export type GetMinioParamRespSelectDataResourceValue = {
|
|
148
|
+
cpuRequest?: string
|
|
149
|
+
cpuLimit?: string
|
|
150
|
+
memoryRequest?: string
|
|
151
|
+
memoryLimit?: string
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
export type GetMinioParamRespSelectDataIntValue = {
|
|
155
|
+
value?: number
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
type BaseGetMinioParamRespSelectData = {
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
export type GetMinioParamRespSelectData = BaseGetMinioParamRespSelectData
|
|
163
|
+
& OneOf<{ sValue: GetMinioParamRespSelectDataStringValue; rValue: GetMinioParamRespSelectDataResourceValue; iValue: GetMinioParamRespSelectDataIntValue }>
|
|
164
|
+
|
|
165
|
+
export type GetMinioParamRespSelect = {
|
|
166
|
+
selectType?: GetMinioParamRespSelectSelectType
|
|
167
|
+
data?: GetMinioParamRespSelectData[]
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
export type GetMinioParamResp = {
|
|
171
|
+
version?: GetMinioParamRespSelect
|
|
172
|
+
storage?: GetMinioParamRespSelect
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
export type GetMinioBackupProviderListResp = {
|
|
176
|
+
provider?: GetMinioParamRespSelect
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
export type CreateMinioResp = {
|
|
180
|
+
message?: string
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
export type GetMinioOperatorVersionListReq = {
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
export type GetMinioOperatorVersionListRespGetMinioOperatorVersionListData = {
|
|
187
|
+
cluster?: string
|
|
188
|
+
namespace?: string
|
|
189
|
+
version?: string
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
export type GetMinioOperatorVersionListResp = {
|
|
193
|
+
items?: GetMinioOperatorVersionListRespGetMinioOperatorVersionListData[]
|
|
194
|
+
pagination?: CommonCommon.Pagination
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
export type DeleteMinioReq = {
|
|
198
|
+
cluster?: string
|
|
199
|
+
namespace?: string
|
|
200
|
+
name?: string
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
export type DeleteMiniosReq = {
|
|
204
|
+
data?: DeleteMinioReq[]
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
export type DeleteMinioResp = {
|
|
208
|
+
message?: string
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
export type DeleteMiniosResp = {
|
|
212
|
+
message?: string
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
export type GetMinioNodeListReq = {
|
|
216
|
+
cluster?: string
|
|
217
|
+
namespace?: string
|
|
218
|
+
name?: string
|
|
219
|
+
page?: number
|
|
220
|
+
pageSize?: number
|
|
221
|
+
sortDir?: GetMinioNodeListReqSortDir
|
|
222
|
+
sortBy?: string
|
|
223
|
+
searchKey?: string
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
export type GetMinioNodeListRespData = {
|
|
227
|
+
podName?: string
|
|
228
|
+
status?: GetMinioNodeListRespPodStatus
|
|
229
|
+
ip?: string
|
|
230
|
+
restart?: number
|
|
231
|
+
cpuUsage?: number
|
|
232
|
+
cpuLimit?: number
|
|
233
|
+
memoryUsage?: number
|
|
234
|
+
memoryLimit?: number
|
|
235
|
+
createTimestamp?: string
|
|
236
|
+
common?: CommonCommon.PodCommon
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
export type GetMinioNodeListResp = {
|
|
240
|
+
items?: GetMinioNodeListRespData[]
|
|
241
|
+
pagination?: CommonCommon.Pagination
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
export type GetMinioGrafanaAddrReq = {
|
|
245
|
+
cluster?: string
|
|
246
|
+
namespace?: string
|
|
247
|
+
name?: string
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
export type GetMinioGrafanaAddrResp = {
|
|
251
|
+
data?: string
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
export type GetMinioReq = {
|
|
255
|
+
cluster?: string
|
|
256
|
+
namespace?: string
|
|
257
|
+
name?: string
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
export type GetMinioResp = {
|
|
261
|
+
data?: TenantItem
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
export type GetMinioConfRespItems = {
|
|
265
|
+
paramType?: GetMinioConfRespItemsParamType
|
|
266
|
+
paramName?: string
|
|
267
|
+
value?: string
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
export type GetMinioConfResp = {
|
|
271
|
+
items?: GetMinioConfRespItems[]
|
|
272
|
+
pagination?: CommonCommon.Pagination
|
|
273
|
+
conf?: UpdateMinioConfReq
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
export type GetMinioListResp = {
|
|
277
|
+
items?: TenantItem[]
|
|
278
|
+
pagination?: CommonCommon.Pagination
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
export type TenantItemStatus = {
|
|
282
|
+
status?: Status
|
|
283
|
+
podsAreReadyNum?: number
|
|
284
|
+
webManagerAddr?: string
|
|
285
|
+
clusterIPs?: string[]
|
|
286
|
+
serviceAddr?: string
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
export type TenantItemMetadata = {
|
|
290
|
+
annotations?: {[key: string]: string}
|
|
291
|
+
creationTimestamp?: string
|
|
292
|
+
name?: string
|
|
293
|
+
namespace?: string
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
export type TenantItem = {
|
|
297
|
+
apiVersion?: string
|
|
298
|
+
kind?: string
|
|
299
|
+
metadata?: TenantItemMetadata
|
|
300
|
+
spec?: CreateMinioReq
|
|
301
|
+
status?: TenantItemStatus
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
export class Minio {
|
|
305
|
+
static GetMinioList(req: GetMinioListReq, initReq?: fm.InitReq): Promise<GetMinioListResp> {
|
|
306
|
+
return fm.fetchReq<GetMinioListReq, GetMinioListResp>(`/apis/mcamel.io/minio/v1alpha1/${req["workspaceId"]}/minios?${fm.renderURLSearchParams(req, ["workspaceId"])}`, {...initReq, method: "GET"})
|
|
307
|
+
}
|
|
308
|
+
static GetMinioOperatorVersionList(req: GetMinioOperatorVersionListReq, initReq?: fm.InitReq): Promise<GetMinioOperatorVersionListResp> {
|
|
309
|
+
return fm.fetchReq<GetMinioOperatorVersionListReq, GetMinioOperatorVersionListResp>(`/apis/mcamel.io/minio/v1alpha1/minio-operator/versions?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
|
|
310
|
+
}
|
|
311
|
+
static GetMinio(req: GetMinioReq, initReq?: fm.InitReq): Promise<GetMinioResp> {
|
|
312
|
+
return fm.fetchReq<GetMinioReq, GetMinioResp>(`/apis/mcamel.io/minio/v1alpha1/minio/${req["cluster"]}/${req["namespace"]}/${req["name"]}?${fm.renderURLSearchParams(req, ["cluster", "namespace", "name"])}`, {...initReq, method: "GET"})
|
|
313
|
+
}
|
|
314
|
+
static GetMinioParam(req: GetMinioParamReq, initReq?: fm.InitReq): Promise<GetMinioParamResp> {
|
|
315
|
+
return fm.fetchReq<GetMinioParamReq, GetMinioParamResp>(`/apis/mcamel.io/minio/v1alpha1/minio-params/${req["cluster"]}?${fm.renderURLSearchParams(req, ["cluster"])}`, {...initReq, method: "GET"})
|
|
316
|
+
}
|
|
317
|
+
static GetMinioNodeList(req: GetMinioNodeListReq, initReq?: fm.InitReq): Promise<GetMinioNodeListResp> {
|
|
318
|
+
return fm.fetchReq<GetMinioNodeListReq, GetMinioNodeListResp>(`/apis/mcamel.io/minio/v1alpha1/minio/${req["cluster"]}/${req["namespace"]}/${req["name"]}/nodes?${fm.renderURLSearchParams(req, ["cluster", "namespace", "name"])}`, {...initReq, method: "GET"})
|
|
319
|
+
}
|
|
320
|
+
static GetMinioGrafanaAddr(req: GetMinioGrafanaAddrReq, initReq?: fm.InitReq): Promise<GetMinioGrafanaAddrResp> {
|
|
321
|
+
return fm.fetchReq<GetMinioGrafanaAddrReq, GetMinioGrafanaAddrResp>(`/apis/mcamel.io/minio/v1alpha1/minio/${req["cluster"]}/${req["namespace"]}/${req["name"]}/grafana?${fm.renderURLSearchParams(req, ["cluster", "namespace", "name"])}`, {...initReq, method: "GET"})
|
|
322
|
+
}
|
|
323
|
+
static CreateMinio(req: CreateMinioReq, initReq?: fm.InitReq): Promise<CreateMinioResp> {
|
|
324
|
+
return fm.fetchReq<CreateMinioReq, CreateMinioResp>(`/apis/mcamel.io/minio/v1alpha1/minio`, {...initReq, method: "POST", body: JSON.stringify(req)})
|
|
325
|
+
}
|
|
326
|
+
static GetMinioConfs(req: GetMinioConfReq, initReq?: fm.InitReq): Promise<GetMinioConfResp> {
|
|
327
|
+
return fm.fetchReq<GetMinioConfReq, GetMinioConfResp>(`/apis/mcamel.io/minio/v1alpha1/minio/${req["cluster"]}/${req["namespace"]}/${req["name"]}/confs?${fm.renderURLSearchParams(req, ["cluster", "namespace", "name"])}`, {...initReq, method: "GET"})
|
|
328
|
+
}
|
|
329
|
+
static UpdateMinioConf(req: UpdateMinioConfReq, initReq?: fm.InitReq): Promise<UpdateMinioConfResp> {
|
|
330
|
+
return fm.fetchReq<UpdateMinioConfReq, UpdateMinioConfResp>(`/apis/mcamel.io/minio/v1alpha1/minio/${req["cluster"]}/${req["namespace"]}/${req["name"]}/conf`, {...initReq, method: "PUT", body: JSON.stringify(req)})
|
|
331
|
+
}
|
|
332
|
+
static UpdateMinioParams(req: CreateMinioReq, initReq?: fm.InitReq): Promise<UpdateMinioParamsResp> {
|
|
333
|
+
return fm.fetchReq<CreateMinioReq, UpdateMinioParamsResp>(`/apis/mcamel.io/minio/v1alpha1/minio/${req["cluster"]}/${req["namespace"]}/${req["name"]}/params`, {...initReq, method: "PUT", body: JSON.stringify(req)})
|
|
334
|
+
}
|
|
335
|
+
static DeleteMinio(req: DeleteMinioReq, initReq?: fm.InitReq): Promise<DeleteMinioResp> {
|
|
336
|
+
return fm.fetchReq<DeleteMinioReq, DeleteMinioResp>(`/apis/mcamel.io/minio/v1alpha1/minio/${req["cluster"]}/${req["namespace"]}/${req["name"]}`, {...initReq, method: "DELETE"})
|
|
337
|
+
}
|
|
338
|
+
static DeleteMinios(req: DeleteMiniosReq, initReq?: fm.InitReq): Promise<DeleteMiniosResp> {
|
|
339
|
+
return fm.fetchReq<DeleteMiniosReq, DeleteMiniosResp>(`/apis/mcamel.io/minio/v1alpha1/minios`, {...initReq, method: "POST", body: JSON.stringify(req)})
|
|
340
|
+
}
|
|
341
|
+
}
|
package/package.json
ADDED
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/minio/v1alpha1/minio/version?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
|
|
26
|
+
}
|
|
27
|
+
}
|