@daocloud-proto/virtnest 0.2.0-dev1 → 0.2.0-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/feature_gate.pb.ts +2 -9
- package/v1alpha1/vm.pb.ts +33 -24
package/package.json
CHANGED
|
@@ -7,21 +7,14 @@
|
|
|
7
7
|
import * as fm from "../fetch.pb"
|
|
8
8
|
|
|
9
9
|
export enum FeatureGateID {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export enum FeatureGateStatus {
|
|
15
|
-
Ready = "Ready",
|
|
16
|
-
Pending = "Pending",
|
|
10
|
+
VirtualMachineSnapshot = "VirtualMachineSnapshot",
|
|
11
|
+
VirtualMachineClone = "VirtualMachineClone",
|
|
17
12
|
}
|
|
18
13
|
|
|
19
14
|
export type FeatureGateInfo = {
|
|
20
15
|
id?: FeatureGateID
|
|
21
|
-
name?: string
|
|
22
16
|
description?: string
|
|
23
17
|
enabled?: boolean
|
|
24
|
-
status?: FeatureGateStatus
|
|
25
18
|
}
|
|
26
19
|
|
|
27
20
|
export type ListFeatureGatesRequest = {
|
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",
|
|
@@ -72,6 +77,7 @@ export type ListClusterVmsInfo = {
|
|
|
72
77
|
createdAt?: string
|
|
73
78
|
osFamily?: OSFamily
|
|
74
79
|
vmErrorMessage?: VmErrorMessage
|
|
80
|
+
allowedOperation?: AllowedOperation[]
|
|
75
81
|
}
|
|
76
82
|
|
|
77
83
|
export type ListClusterVMsRequest = {
|
|
@@ -95,7 +101,7 @@ export type CreateVMRequest = {
|
|
|
95
101
|
annotations?: {[key: string]: string}
|
|
96
102
|
imageSource?: ImageSource
|
|
97
103
|
imageUrl?: string
|
|
98
|
-
|
|
104
|
+
disks?: VMDisks
|
|
99
105
|
cpu?: Item
|
|
100
106
|
memory?: Item
|
|
101
107
|
ssh?: SSH
|
|
@@ -267,6 +273,26 @@ export type CreateCustomResourceRequest = {
|
|
|
267
273
|
export type CreateCustomResourceResponse = {
|
|
268
274
|
}
|
|
269
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
|
+
|
|
270
296
|
export type CreateVMSnapshotRequest = {
|
|
271
297
|
cluster?: string
|
|
272
298
|
namespace?: string
|
|
@@ -387,31 +413,11 @@ export type ExpandVMDiskCapacityRequest = {
|
|
|
387
413
|
export type ExpandVMDiskCapacityResponse = {
|
|
388
414
|
}
|
|
389
415
|
|
|
390
|
-
export type CreateMultiStorageVMRequest = {
|
|
391
|
-
cluster?: string
|
|
392
|
-
namespace?: string
|
|
393
|
-
name?: string
|
|
394
|
-
aliasName?: string
|
|
395
|
-
labels?: {[key: string]: string}
|
|
396
|
-
annotations?: {[key: string]: string}
|
|
397
|
-
imageSource?: ImageSource
|
|
398
|
-
imageUrl?: string
|
|
399
|
-
disks?: VMDisks
|
|
400
|
-
cpu?: Item
|
|
401
|
-
memory?: Item
|
|
402
|
-
ssh?: SSH
|
|
403
|
-
osFamily?: OSFamily
|
|
404
|
-
osVersion?: string
|
|
405
|
-
}
|
|
406
|
-
|
|
407
416
|
export type VMDisks = {
|
|
408
417
|
systemVolume?: DiskVolume
|
|
409
418
|
dataVolumes?: DiskVolume[]
|
|
410
419
|
}
|
|
411
420
|
|
|
412
|
-
export type CreateMultiStorageVMVMResponse = {
|
|
413
|
-
}
|
|
414
|
-
|
|
415
421
|
export class VM {
|
|
416
422
|
static ListClusterVMs(req: ListClusterVMsRequest, initReq?: fm.InitReq): Promise<ListClusterVmsResponse> {
|
|
417
423
|
return fm.fetchReq<ListClusterVMsRequest, ListClusterVmsResponse>(`/apis/virtnest.io/v1alpha1/clusters/${req["cluster"]}/vms?${fm.renderURLSearchParams(req, ["cluster"])}`, {...initReq, method: "GET"})
|
|
@@ -419,12 +425,15 @@ export class VM {
|
|
|
419
425
|
static CreateVM(req: CreateVMRequest, initReq?: fm.InitReq): Promise<CreateVMResponse> {
|
|
420
426
|
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)})
|
|
421
427
|
}
|
|
422
|
-
static CreateMultiStorageVM(req: CreateMultiStorageVMRequest, initReq?: fm.InitReq): Promise<CreateMultiStorageVMVMResponse> {
|
|
423
|
-
return fm.fetchReq<CreateMultiStorageVMRequest, CreateMultiStorageVMVMResponse>(`/apis/virtnest.io/v1alpha1/clusters/${req["cluster"]}/namespaces/${req["namespace"]}/multi-storage-vm`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
|
|
424
|
-
}
|
|
425
428
|
static CreateCustomResource(req: CreateCustomResourceRequest, initReq?: fm.InitReq): Promise<CreateCustomResourceResponse> {
|
|
426
429
|
return fm.fetchReq<CreateCustomResourceRequest, CreateCustomResourceResponse>(`/apis/virtnest.io/v1alpha1/clusters/${req["cluster"]}/custom-resource`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
|
|
427
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
|
+
}
|
|
428
437
|
static DeleteVM(req: DeleteVMRequest, initReq?: fm.InitReq): Promise<DeleteVMResponse> {
|
|
429
438
|
return fm.fetchReq<DeleteVMRequest, DeleteVMResponse>(`/apis/virtnest.io/v1alpha1/clusters/${req["cluster"]}/namespaces/${req["namespace"]}/vms/${req["name"]}`, {...initReq, method: "DELETE"})
|
|
430
439
|
}
|