@daocloud-proto/virtnest 0.1.10-dev5 → 0.2.0-dev2
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/feature_gate.pb.ts +31 -0
- package/v1alpha1/vm.pb.ts +137 -2
package/package.json
CHANGED
|
@@ -0,0 +1,31 @@
|
|
|
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 FeatureGateID {
|
|
10
|
+
VirtualMachineSnapshot = "VirtualMachineSnapshot",
|
|
11
|
+
VirtualMachineClone = "VirtualMachineClone",
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export type FeatureGateInfo = {
|
|
15
|
+
id?: FeatureGateID
|
|
16
|
+
description?: string
|
|
17
|
+
enabled?: boolean
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export type ListFeatureGatesRequest = {
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export type ListFeatureGatesResponse = {
|
|
24
|
+
items?: FeatureGateInfo[]
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export class FeatureGate {
|
|
28
|
+
static ListFeatureGates(req: ListFeatureGatesRequest, initReq?: fm.InitReq): Promise<ListFeatureGatesResponse> {
|
|
29
|
+
return fm.fetchReq<ListFeatureGatesRequest, ListFeatureGatesResponse>(`/apis/virtnest.io/v1alpha1/feature-gate?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
|
|
30
|
+
}
|
|
31
|
+
}
|
package/v1alpha1/vm.pb.ts
CHANGED
|
@@ -13,6 +13,11 @@ export enum OSFamily {
|
|
|
13
13
|
Ubuntu = "Ubuntu",
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
+
export enum AllowedOperation {
|
|
17
|
+
allowed_operation_snapshot = "allowed_operation_snapshot",
|
|
18
|
+
allowed_operation_clone = "allowed_operation_clone",
|
|
19
|
+
}
|
|
20
|
+
|
|
16
21
|
export enum ImageSource {
|
|
17
22
|
docker = "docker",
|
|
18
23
|
http = "http",
|
|
@@ -32,6 +37,12 @@ export enum VMStatus {
|
|
|
32
37
|
poweroff = "poweroff",
|
|
33
38
|
}
|
|
34
39
|
|
|
40
|
+
export enum StorageStatus {
|
|
41
|
+
storage_processing = "storage_processing",
|
|
42
|
+
storage_ready = "storage_ready",
|
|
43
|
+
storage_failed = "storage_failed",
|
|
44
|
+
}
|
|
45
|
+
|
|
35
46
|
export enum StorageType {
|
|
36
47
|
system = "system",
|
|
37
48
|
data = "data",
|
|
@@ -51,6 +62,11 @@ export type Pagination = {
|
|
|
51
62
|
total?: number
|
|
52
63
|
}
|
|
53
64
|
|
|
65
|
+
export type VmErrorMessage = {
|
|
66
|
+
message?: string
|
|
67
|
+
reason?: string
|
|
68
|
+
}
|
|
69
|
+
|
|
54
70
|
export type ListClusterVmsInfo = {
|
|
55
71
|
name?: string
|
|
56
72
|
status?: VMStatus
|
|
@@ -60,6 +76,8 @@ export type ListClusterVmsInfo = {
|
|
|
60
76
|
memory?: string
|
|
61
77
|
createdAt?: string
|
|
62
78
|
osFamily?: OSFamily
|
|
79
|
+
vmErrorMessage?: VmErrorMessage
|
|
80
|
+
allowedOperation?: AllowedOperation[]
|
|
63
81
|
}
|
|
64
82
|
|
|
65
83
|
export type ListClusterVMsRequest = {
|
|
@@ -83,7 +101,7 @@ export type CreateVMRequest = {
|
|
|
83
101
|
annotations?: {[key: string]: string}
|
|
84
102
|
imageSource?: ImageSource
|
|
85
103
|
imageUrl?: string
|
|
86
|
-
|
|
104
|
+
disks?: VMDisks
|
|
87
105
|
cpu?: Item
|
|
88
106
|
memory?: Item
|
|
89
107
|
ssh?: SSH
|
|
@@ -188,6 +206,8 @@ export type VMStorage = {
|
|
|
188
206
|
name?: string
|
|
189
207
|
type?: StorageType
|
|
190
208
|
capacity?: string
|
|
209
|
+
status?: StorageStatus
|
|
210
|
+
storageClass?: string
|
|
191
211
|
}
|
|
192
212
|
|
|
193
213
|
export type ListVMStoragesRequest = {
|
|
@@ -225,6 +245,26 @@ export type ListVMSnapshotsResponse = {
|
|
|
225
245
|
pagination?: Pagination
|
|
226
246
|
}
|
|
227
247
|
|
|
248
|
+
export type VMRestore = {
|
|
249
|
+
name?: string
|
|
250
|
+
description?: string
|
|
251
|
+
complete?: boolean
|
|
252
|
+
createdAt?: string
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
export type ListVMRestoresRequest = {
|
|
256
|
+
pageSize?: number
|
|
257
|
+
page?: number
|
|
258
|
+
cluster?: string
|
|
259
|
+
namespace?: string
|
|
260
|
+
name?: string
|
|
261
|
+
snapshotName?: string
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
export type ListVMRestoresResponse = {
|
|
265
|
+
items?: VMRestore[]
|
|
266
|
+
}
|
|
267
|
+
|
|
228
268
|
export type CreateCustomResourceRequest = {
|
|
229
269
|
cluster?: string
|
|
230
270
|
data?: string[]
|
|
@@ -233,6 +273,26 @@ export type CreateCustomResourceRequest = {
|
|
|
233
273
|
export type CreateCustomResourceResponse = {
|
|
234
274
|
}
|
|
235
275
|
|
|
276
|
+
export type UpdateCustomResourceRequest = {
|
|
277
|
+
cluster?: string
|
|
278
|
+
namespace?: string
|
|
279
|
+
name?: string
|
|
280
|
+
data?: string
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
export type UpdateCustomResourceResponse = {
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
export type GetCustomResourceRequest = {
|
|
287
|
+
cluster?: string
|
|
288
|
+
namespace?: string
|
|
289
|
+
name?: string
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
export type GetCustomResourceResponse = {
|
|
293
|
+
data?: string
|
|
294
|
+
}
|
|
295
|
+
|
|
236
296
|
export type CreateVMSnapshotRequest = {
|
|
237
297
|
cluster?: string
|
|
238
298
|
namespace?: string
|
|
@@ -249,6 +309,8 @@ export type RestoreVMSnapshotRequest = {
|
|
|
249
309
|
namespace?: string
|
|
250
310
|
name?: string
|
|
251
311
|
snapshotName?: string
|
|
312
|
+
restoreName?: string
|
|
313
|
+
restoreDescription?: string
|
|
252
314
|
}
|
|
253
315
|
|
|
254
316
|
export type RestoreVMSnapshotResponse = {
|
|
@@ -264,6 +326,16 @@ export type DeleteVMSnapshotRequest = {
|
|
|
264
326
|
export type DeleteVMSnapshotResponse = {
|
|
265
327
|
}
|
|
266
328
|
|
|
329
|
+
export type DeleteVMRestoreRequest = {
|
|
330
|
+
cluster?: string
|
|
331
|
+
namespace?: string
|
|
332
|
+
name?: string
|
|
333
|
+
restoreName?: string
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
export type DeleteVMRestoreResponse = {
|
|
337
|
+
}
|
|
338
|
+
|
|
267
339
|
export type UpdateVMSnapshotRequest = {
|
|
268
340
|
cluster?: string
|
|
269
341
|
namespace?: string
|
|
@@ -280,7 +352,7 @@ export type CloneVMRequest = {
|
|
|
280
352
|
namespace?: string
|
|
281
353
|
name?: string
|
|
282
354
|
cloneName?: string
|
|
283
|
-
|
|
355
|
+
aliasName?: string
|
|
284
356
|
}
|
|
285
357
|
|
|
286
358
|
export type CloneVMResponse = {
|
|
@@ -304,6 +376,48 @@ export type SystemImageVersion = {
|
|
|
304
376
|
url?: string
|
|
305
377
|
}
|
|
306
378
|
|
|
379
|
+
export type DiskVolume = {
|
|
380
|
+
storageClass?: string
|
|
381
|
+
storage?: string
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
export type AddDiskVolumeToVMRequest = {
|
|
385
|
+
cluster?: string
|
|
386
|
+
namespace?: string
|
|
387
|
+
name?: string
|
|
388
|
+
diskVolumes?: DiskVolume
|
|
389
|
+
hotplug?: boolean
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
export type AddDiskVolumeToVMResponse = {
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
export type RemoveVMDiskVolumeRequest = {
|
|
396
|
+
cluster?: string
|
|
397
|
+
namespace?: string
|
|
398
|
+
name?: string
|
|
399
|
+
diskName?: string
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
export type RemoveVMDiskVolumeResponse = {
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
export type ExpandVMDiskCapacityRequest = {
|
|
406
|
+
cluster?: string
|
|
407
|
+
namespace?: string
|
|
408
|
+
name?: string
|
|
409
|
+
diskName?: string
|
|
410
|
+
capacity?: string
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
export type ExpandVMDiskCapacityResponse = {
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
export type VMDisks = {
|
|
417
|
+
systemVolume?: DiskVolume
|
|
418
|
+
dataVolumes?: DiskVolume[]
|
|
419
|
+
}
|
|
420
|
+
|
|
307
421
|
export class VM {
|
|
308
422
|
static ListClusterVMs(req: ListClusterVMsRequest, initReq?: fm.InitReq): Promise<ListClusterVmsResponse> {
|
|
309
423
|
return fm.fetchReq<ListClusterVMsRequest, ListClusterVmsResponse>(`/apis/virtnest.io/v1alpha1/clusters/${req["cluster"]}/vms?${fm.renderURLSearchParams(req, ["cluster"])}`, {...initReq, method: "GET"})
|
|
@@ -314,6 +428,12 @@ export class VM {
|
|
|
314
428
|
static CreateCustomResource(req: CreateCustomResourceRequest, initReq?: fm.InitReq): Promise<CreateCustomResourceResponse> {
|
|
315
429
|
return fm.fetchReq<CreateCustomResourceRequest, CreateCustomResourceResponse>(`/apis/virtnest.io/v1alpha1/clusters/${req["cluster"]}/custom-resource`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
|
|
316
430
|
}
|
|
431
|
+
static UpdateCustomResource(req: UpdateCustomResourceRequest, initReq?: fm.InitReq): Promise<UpdateCustomResourceResponse> {
|
|
432
|
+
return fm.fetchReq<UpdateCustomResourceRequest, UpdateCustomResourceResponse>(`/apis/virtnest.io/v1alpha1/clusters/${req["cluster"]}/namespaces/${req["namespace"]}/vms/${req["name"]}/custom-resource`, {...initReq, method: "PUT", body: JSON.stringify(req, fm.replacer)})
|
|
433
|
+
}
|
|
434
|
+
static GetCustomResource(req: GetCustomResourceRequest, initReq?: fm.InitReq): Promise<GetCustomResourceResponse> {
|
|
435
|
+
return fm.fetchReq<GetCustomResourceRequest, GetCustomResourceResponse>(`/apis/virtnest.io/v1alpha1/clusters/${req["cluster"]}/namespaces/${req["namespace"]}/vms/${req["name"]}/custom-resource?${fm.renderURLSearchParams(req, ["cluster", "namespace", "name"])}`, {...initReq, method: "GET"})
|
|
436
|
+
}
|
|
317
437
|
static DeleteVM(req: DeleteVMRequest, initReq?: fm.InitReq): Promise<DeleteVMResponse> {
|
|
318
438
|
return fm.fetchReq<DeleteVMRequest, DeleteVMResponse>(`/apis/virtnest.io/v1alpha1/clusters/${req["cluster"]}/namespaces/${req["namespace"]}/vms/${req["name"]}`, {...initReq, method: "DELETE"})
|
|
319
439
|
}
|
|
@@ -335,6 +455,9 @@ export class VM {
|
|
|
335
455
|
static ListVMSnapshots(req: ListVMSnapshotsRequest, initReq?: fm.InitReq): Promise<ListVMSnapshotsResponse> {
|
|
336
456
|
return fm.fetchReq<ListVMSnapshotsRequest, ListVMSnapshotsResponse>(`/apis/virtnest.io/v1alpha1/clusters/${req["cluster"]}/namespaces/${req["namespace"]}/vms/${req["name"]}/snapshots?${fm.renderURLSearchParams(req, ["cluster", "namespace", "name"])}`, {...initReq, method: "GET"})
|
|
337
457
|
}
|
|
458
|
+
static ListVMRestores(req: ListVMRestoresRequest, initReq?: fm.InitReq): Promise<ListVMRestoresResponse> {
|
|
459
|
+
return fm.fetchReq<ListVMRestoresRequest, ListVMRestoresResponse>(`/apis/virtnest.io/v1alpha1/clusters/${req["cluster"]}/namespaces/${req["namespace"]}/vms/${req["name"]}/snapshots/${req["snapshotName"]}/restores?${fm.renderURLSearchParams(req, ["cluster", "namespace", "name", "snapshotName"])}`, {...initReq, method: "GET"})
|
|
460
|
+
}
|
|
338
461
|
static CreateVMSnapshot(req: CreateVMSnapshotRequest, initReq?: fm.InitReq): Promise<CreateVMSnapshotResponse> {
|
|
339
462
|
return fm.fetchReq<CreateVMSnapshotRequest, CreateVMSnapshotResponse>(`/apis/virtnest.io/v1alpha1/clusters/${req["cluster"]}/namespaces/${req["namespace"]}/vms/${req["name"]}/snapshot`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
|
|
340
463
|
}
|
|
@@ -344,6 +467,9 @@ export class VM {
|
|
|
344
467
|
static DeleteVMSnapshot(req: DeleteVMSnapshotRequest, initReq?: fm.InitReq): Promise<DeleteVMSnapshotResponse> {
|
|
345
468
|
return fm.fetchReq<DeleteVMSnapshotRequest, DeleteVMSnapshotResponse>(`/apis/virtnest.io/v1alpha1/clusters/${req["cluster"]}/namespaces/${req["namespace"]}/vms/${req["name"]}/snapshots/${req["snapshotName"]}`, {...initReq, method: "DELETE"})
|
|
346
469
|
}
|
|
470
|
+
static DeleteVMRestore(req: DeleteVMRestoreRequest, initReq?: fm.InitReq): Promise<DeleteVMRestoreResponse> {
|
|
471
|
+
return fm.fetchReq<DeleteVMRestoreRequest, DeleteVMRestoreResponse>(`/apis/virtnest.io/v1alpha1/clusters/${req["cluster"]}/namespaces/${req["namespace"]}/vms/${req["name"]}/restores/${req["restoreName"]}`, {...initReq, method: "DELETE"})
|
|
472
|
+
}
|
|
347
473
|
static UpdateVMSnapshot(req: UpdateVMSnapshotRequest, initReq?: fm.InitReq): Promise<UpdateVMSnapshotResponse> {
|
|
348
474
|
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)})
|
|
349
475
|
}
|
|
@@ -353,4 +479,13 @@ export class VM {
|
|
|
353
479
|
static ListSystemImages(req: ListSystemImagesRequest, initReq?: fm.InitReq): Promise<ListSystemImagesResponse> {
|
|
354
480
|
return fm.fetchReq<ListSystemImagesRequest, ListSystemImagesResponse>(`/apis/virtnest.io/v1alpha1/clusters/${req["cluster"]}/system-images?${fm.renderURLSearchParams(req, ["cluster"])}`, {...initReq, method: "GET"})
|
|
355
481
|
}
|
|
482
|
+
static AddDiskVolumeToVM(req: AddDiskVolumeToVMRequest, initReq?: fm.InitReq): Promise<AddDiskVolumeToVMResponse> {
|
|
483
|
+
return fm.fetchReq<AddDiskVolumeToVMRequest, AddDiskVolumeToVMResponse>(`/apis/virtnest.io/v1alpha1/clusters/${req["cluster"]}/namespaces/${req["namespace"]}/vms/${req["name"]}/disk-volume`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
|
|
484
|
+
}
|
|
485
|
+
static RemoveVMDiskVolume(req: RemoveVMDiskVolumeRequest, initReq?: fm.InitReq): Promise<RemoveVMDiskVolumeResponse> {
|
|
486
|
+
return fm.fetchReq<RemoveVMDiskVolumeRequest, RemoveVMDiskVolumeResponse>(`/apis/virtnest.io/v1alpha1/clusters/${req["cluster"]}/namespaces/${req["namespace"]}/vms/${req["name"]}/disk-volume/${req["diskName"]}`, {...initReq, method: "DELETE"})
|
|
487
|
+
}
|
|
488
|
+
static ExpandVMDiskCapacity(req: ExpandVMDiskCapacityRequest, initReq?: fm.InitReq): Promise<ExpandVMDiskCapacityResponse> {
|
|
489
|
+
return fm.fetchReq<ExpandVMDiskCapacityRequest, ExpandVMDiskCapacityResponse>(`/apis/virtnest.io/v1alpha1/clusters/${req["cluster"]}/namespaces/${req["namespace"]}/vms/${req["name"]}/disk-volume/${req["diskName"]}/expand-capacity`, {...initReq, method: "PUT", body: JSON.stringify(req, fm.replacer)})
|
|
490
|
+
}
|
|
356
491
|
}
|