@daocloud-proto/virtnest 0.1.10-dev → 0.1.10-dev3
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/package.json +1 -1
- package/v1alpha1/cluster.pb.ts +11 -0
- package/v1alpha1/role.pb.ts +40 -0
- package/v1alpha1/vm.pb.ts +81 -13
package/package.json
CHANGED
package/v1alpha1/cluster.pb.ts
CHANGED
|
@@ -33,6 +33,14 @@ export type ListClusterNamespacesResponse = {
|
|
|
33
33
|
items?: string[]
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
+
export type ListClusterStorageClassesRequest = {
|
|
37
|
+
cluster?: string
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export type ListClusterStorageClassesResponse = {
|
|
41
|
+
items?: string[]
|
|
42
|
+
}
|
|
43
|
+
|
|
36
44
|
export class Cluster {
|
|
37
45
|
static ListClusters(req: ListClustersRequest, initReq?: fm.InitReq): Promise<ListClustersResponse> {
|
|
38
46
|
return fm.fetchReq<ListClustersRequest, ListClustersResponse>(`/apis/virtnest.io/v1alpha1/clusters?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
|
|
@@ -40,4 +48,7 @@ export class Cluster {
|
|
|
40
48
|
static ListClusterNamespaces(req: ListClusterNamespacesRequest, initReq?: fm.InitReq): Promise<ListClusterNamespacesResponse> {
|
|
41
49
|
return fm.fetchReq<ListClusterNamespacesRequest, ListClusterNamespacesResponse>(`/apis/virtnest.io/v1alpha1/clusters/${req["cluster"]}/namespaces?${fm.renderURLSearchParams(req, ["cluster"])}`, {...initReq, method: "GET"})
|
|
42
50
|
}
|
|
51
|
+
static ListClusterStorageClasses(req: ListClusterStorageClassesRequest, initReq?: fm.InitReq): Promise<ListClusterStorageClassesResponse> {
|
|
52
|
+
return fm.fetchReq<ListClusterStorageClassesRequest, ListClusterStorageClassesResponse>(`/apis/virtnest.io/v1alpha1/clusters/${req["cluster"]}/storageclasses?${fm.renderURLSearchParams(req, ["cluster"])}`, {...initReq, method: "GET"})
|
|
53
|
+
}
|
|
43
54
|
}
|
|
@@ -0,0 +1,40 @@
|
|
|
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
|
+
|
|
9
|
+
export enum RoleEnum {
|
|
10
|
+
admin = "admin",
|
|
11
|
+
cluster_admin = "cluster_admin",
|
|
12
|
+
cluster_edit = "cluster_edit",
|
|
13
|
+
cluster_view = "cluster_view",
|
|
14
|
+
ns_admin = "ns_admin",
|
|
15
|
+
ns_edit = "ns_edit",
|
|
16
|
+
ns_view = "ns_view",
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export type GetUserRolesRequest = {
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export type GetUserRolesResponse = {
|
|
23
|
+
platformRoles?: RoleEnum[]
|
|
24
|
+
clusterRoles?: {[key: string]: ClusterRoles}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export type ClusterRoles = {
|
|
28
|
+
roles?: RoleEnum[]
|
|
29
|
+
nsRoles?: {[key: string]: NSRoles}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export type NSRoles = {
|
|
33
|
+
roles?: RoleEnum[]
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export class Role {
|
|
37
|
+
static GetUserRoles(req: GetUserRolesRequest, initReq?: fm.InitReq): Promise<GetUserRolesResponse> {
|
|
38
|
+
return fm.fetchReq<GetUserRolesRequest, GetUserRolesResponse>(`/apis/virtnest.io/v1alpha1/roles?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
|
|
39
|
+
}
|
|
40
|
+
}
|
package/v1alpha1/vm.pb.ts
CHANGED
|
@@ -6,11 +6,17 @@
|
|
|
6
6
|
|
|
7
7
|
import * as fm from "../fetch.pb"
|
|
8
8
|
|
|
9
|
-
export enum
|
|
10
|
-
|
|
9
|
+
export enum OSFamily {
|
|
10
|
+
debian = "debian",
|
|
11
11
|
centos = "centos",
|
|
12
12
|
ubuntu = "ubuntu",
|
|
13
|
-
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export enum OSFamilyResponse {
|
|
16
|
+
debian_response = "debian_response",
|
|
17
|
+
centos_response = "centos_response",
|
|
18
|
+
ubuntu_response = "ubuntu_response",
|
|
19
|
+
unknown_osfamily_response = "unknown_osfamily_response",
|
|
14
20
|
}
|
|
15
21
|
|
|
16
22
|
export enum ImageSource {
|
|
@@ -37,6 +43,14 @@ export enum StorageType {
|
|
|
37
43
|
data = "data",
|
|
38
44
|
}
|
|
39
45
|
|
|
46
|
+
export enum SnapshotStatus {
|
|
47
|
+
snapshot_succeeded = "snapshot_succeeded",
|
|
48
|
+
snapshot_failed = "snapshot_failed",
|
|
49
|
+
snapshot_deleting = "snapshot_deleting",
|
|
50
|
+
snapshot_processing = "snapshot_processing",
|
|
51
|
+
snapshot_unknown = "snapshot_unknown",
|
|
52
|
+
}
|
|
53
|
+
|
|
40
54
|
export type Pagination = {
|
|
41
55
|
page?: number
|
|
42
56
|
pageSize?: number
|
|
@@ -48,10 +62,10 @@ export type ListClusterVmsInfo = {
|
|
|
48
62
|
status?: VMStatus
|
|
49
63
|
namespace?: string
|
|
50
64
|
ips?: string[]
|
|
51
|
-
cpu?:
|
|
65
|
+
cpu?: string
|
|
52
66
|
memory?: string
|
|
53
67
|
createdAt?: string
|
|
54
|
-
|
|
68
|
+
osFamily?: OSFamilyResponse
|
|
55
69
|
}
|
|
56
70
|
|
|
57
71
|
export type ListClusterVMsRequest = {
|
|
@@ -75,10 +89,12 @@ export type CreateVMRequest = {
|
|
|
75
89
|
annotations?: {[key: string]: string}
|
|
76
90
|
imageSource?: ImageSource
|
|
77
91
|
imageUrl?: string
|
|
78
|
-
systemDisk?:
|
|
92
|
+
systemDisk?: string
|
|
79
93
|
cpu?: Item
|
|
80
94
|
memory?: Item
|
|
81
95
|
ssh?: SSH
|
|
96
|
+
osFamily?: OSFamily
|
|
97
|
+
osVersion?: string
|
|
82
98
|
}
|
|
83
99
|
|
|
84
100
|
export type SSH = {
|
|
@@ -88,8 +104,8 @@ export type SSH = {
|
|
|
88
104
|
}
|
|
89
105
|
|
|
90
106
|
export type Item = {
|
|
91
|
-
request?:
|
|
92
|
-
limit?:
|
|
107
|
+
request?: string
|
|
108
|
+
limit?: string
|
|
93
109
|
}
|
|
94
110
|
|
|
95
111
|
export type Network = {
|
|
@@ -114,6 +130,11 @@ export type UpdateVMRequest = {
|
|
|
114
130
|
cluster?: string
|
|
115
131
|
namespace?: string
|
|
116
132
|
name?: string
|
|
133
|
+
aliasName?: string
|
|
134
|
+
labels?: {[key: string]: string}
|
|
135
|
+
annotations?: {[key: string]: string}
|
|
136
|
+
cpu?: Item
|
|
137
|
+
memory?: Item
|
|
117
138
|
}
|
|
118
139
|
|
|
119
140
|
export type UpdateVMResponse = {
|
|
@@ -146,6 +167,11 @@ export type GetVMResponse = {
|
|
|
146
167
|
ips?: string[]
|
|
147
168
|
status?: VMStatus
|
|
148
169
|
createdAt?: string
|
|
170
|
+
username?: string
|
|
171
|
+
password?: string
|
|
172
|
+
sshKey?: string
|
|
173
|
+
cpu?: Item
|
|
174
|
+
memory?: Item
|
|
149
175
|
}
|
|
150
176
|
|
|
151
177
|
export type VMNetwork = {
|
|
@@ -197,6 +223,7 @@ export type VMSnapshot = {
|
|
|
197
223
|
name?: string
|
|
198
224
|
description?: string
|
|
199
225
|
createdAt?: string
|
|
226
|
+
status?: SnapshotStatus
|
|
200
227
|
}
|
|
201
228
|
|
|
202
229
|
export type ListVMSnapshotsResponse = {
|
|
@@ -204,12 +231,12 @@ export type ListVMSnapshotsResponse = {
|
|
|
204
231
|
pagination?: Pagination
|
|
205
232
|
}
|
|
206
233
|
|
|
207
|
-
export type
|
|
234
|
+
export type CreateCustomResourceRequest = {
|
|
208
235
|
cluster?: string
|
|
209
|
-
data?: string
|
|
236
|
+
data?: string[]
|
|
210
237
|
}
|
|
211
238
|
|
|
212
|
-
export type
|
|
239
|
+
export type CreateCustomResourceResponse = {
|
|
213
240
|
}
|
|
214
241
|
|
|
215
242
|
export type CreateVMSnapshotRequest = {
|
|
@@ -233,6 +260,38 @@ export type RestoreVMSnapshotRequest = {
|
|
|
233
260
|
export type RestoreVMSnapshotResponse = {
|
|
234
261
|
}
|
|
235
262
|
|
|
263
|
+
export type DeleteVMSnapshotRequest = {
|
|
264
|
+
cluster?: string
|
|
265
|
+
namespace?: string
|
|
266
|
+
name?: string
|
|
267
|
+
snapshotName?: string
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
export type DeleteVMSnapshotResponse = {
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
export type UpdateVMSnapshotRequest = {
|
|
274
|
+
cluster?: string
|
|
275
|
+
namespace?: string
|
|
276
|
+
name?: string
|
|
277
|
+
snapshotName?: string
|
|
278
|
+
snapshotDescription?: string
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
export type UpdateVMSnapshotResponse = {
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
export type CloneVMRequest = {
|
|
285
|
+
cluster?: string
|
|
286
|
+
namespace?: string
|
|
287
|
+
name?: string
|
|
288
|
+
cloneName?: string
|
|
289
|
+
description?: string
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
export type CloneVMResponse = {
|
|
293
|
+
}
|
|
294
|
+
|
|
236
295
|
export class VM {
|
|
237
296
|
static ListClusterVMs(req: ListClusterVMsRequest, initReq?: fm.InitReq): Promise<ListClusterVmsResponse> {
|
|
238
297
|
return fm.fetchReq<ListClusterVMsRequest, ListClusterVmsResponse>(`/apis/virtnest.io/v1alpha1/clusters/${req["cluster"]}/vms?${fm.renderURLSearchParams(req, ["cluster"])}`, {...initReq, method: "GET"})
|
|
@@ -240,8 +299,8 @@ export class VM {
|
|
|
240
299
|
static CreateVM(req: CreateVMRequest, initReq?: fm.InitReq): Promise<CreateVMResponse> {
|
|
241
300
|
return fm.fetchReq<CreateVMRequest, CreateVMResponse>(`/apis/virtnest.io/v1alpha1/clusters/${req["cluster"]}/namespaces/${req["namespace"]}/vm`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
|
|
242
301
|
}
|
|
243
|
-
static
|
|
244
|
-
return fm.fetchReq<
|
|
302
|
+
static CreateCustomResource(req: CreateCustomResourceRequest, initReq?: fm.InitReq): Promise<CreateCustomResourceResponse> {
|
|
303
|
+
return fm.fetchReq<CreateCustomResourceRequest, CreateCustomResourceResponse>(`/apis/virtnest.io/v1alpha1/clusters/${req["cluster"]}/custom-resource`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
|
|
245
304
|
}
|
|
246
305
|
static DeleteVM(req: DeleteVMRequest, initReq?: fm.InitReq): Promise<DeleteVMResponse> {
|
|
247
306
|
return fm.fetchReq<DeleteVMRequest, DeleteVMResponse>(`/apis/virtnest.io/v1alpha1/clusters/${req["cluster"]}/namespaces/${req["namespace"]}/vms/${req["name"]}`, {...initReq, method: "DELETE"})
|
|
@@ -270,4 +329,13 @@ export class VM {
|
|
|
270
329
|
static RestoreVMSnapshot(req: RestoreVMSnapshotRequest, initReq?: fm.InitReq): Promise<RestoreVMSnapshotResponse> {
|
|
271
330
|
return fm.fetchReq<RestoreVMSnapshotRequest, RestoreVMSnapshotResponse>(`/apis/virtnest.io/v1alpha1/clusters/${req["cluster"]}/namespaces/${req["namespace"]}/vms/${req["name"]}/restore`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
|
|
272
331
|
}
|
|
332
|
+
static DeleteVMSnapshot(req: DeleteVMSnapshotRequest, initReq?: fm.InitReq): Promise<DeleteVMSnapshotResponse> {
|
|
333
|
+
return fm.fetchReq<DeleteVMSnapshotRequest, DeleteVMSnapshotResponse>(`/apis/virtnest.io/v1alpha1/clusters/${req["cluster"]}/namespaces/${req["namespace"]}/vms/${req["name"]}/snapshots/${req["snapshotName"]}`, {...initReq, method: "DELETE"})
|
|
334
|
+
}
|
|
335
|
+
static UpdateVMSnapshot(req: UpdateVMSnapshotRequest, initReq?: fm.InitReq): Promise<UpdateVMSnapshotResponse> {
|
|
336
|
+
return fm.fetchReq<UpdateVMSnapshotRequest, UpdateVMSnapshotResponse>(`/apis/virtnest.io/v1alpha1/clusters/${req["cluster"]}/namespaces/${req["namespace"]}/vms/${req["name"]}/snapshots/${req["snapshotName"]}`, {...initReq, method: "PUT", body: JSON.stringify(req, fm.replacer)})
|
|
337
|
+
}
|
|
338
|
+
static CloneVM(req: CloneVMRequest, initReq?: fm.InitReq): Promise<CloneVMResponse> {
|
|
339
|
+
return fm.fetchReq<CloneVMRequest, CloneVMResponse>(`/apis/virtnest.io/v1alpha1/clusters/${req["cluster"]}/namespaces/${req["namespace"]}/vms/${req["name"]}/clone`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
|
|
340
|
+
}
|
|
273
341
|
}
|