@daocloud-proto/virtnest 0.1.10-dev2 → 0.1.10-dev4
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 +1 -0
- package/v1alpha1/vm.pb.ts +95 -20
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
|
}
|
package/v1alpha1/role.pb.ts
CHANGED
package/v1alpha1/vm.pb.ts
CHANGED
|
@@ -7,16 +7,10 @@
|
|
|
7
7
|
import * as fm from "../fetch.pb"
|
|
8
8
|
|
|
9
9
|
export enum OSFamily {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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",
|
|
10
|
+
Unknown = "Unknown",
|
|
11
|
+
Debian = "Debian",
|
|
12
|
+
CentOS = "CentOS",
|
|
13
|
+
Ubuntu = "Ubuntu",
|
|
20
14
|
}
|
|
21
15
|
|
|
22
16
|
export enum ImageSource {
|
|
@@ -43,6 +37,14 @@ export enum StorageType {
|
|
|
43
37
|
data = "data",
|
|
44
38
|
}
|
|
45
39
|
|
|
40
|
+
export enum SnapshotStatus {
|
|
41
|
+
snapshot_succeeded = "snapshot_succeeded",
|
|
42
|
+
snapshot_failed = "snapshot_failed",
|
|
43
|
+
snapshot_deleting = "snapshot_deleting",
|
|
44
|
+
snapshot_processing = "snapshot_processing",
|
|
45
|
+
snapshot_unknown = "snapshot_unknown",
|
|
46
|
+
}
|
|
47
|
+
|
|
46
48
|
export type Pagination = {
|
|
47
49
|
page?: number
|
|
48
50
|
pageSize?: number
|
|
@@ -54,10 +56,10 @@ export type ListClusterVmsInfo = {
|
|
|
54
56
|
status?: VMStatus
|
|
55
57
|
namespace?: string
|
|
56
58
|
ips?: string[]
|
|
57
|
-
cpu?:
|
|
59
|
+
cpu?: string
|
|
58
60
|
memory?: string
|
|
59
61
|
createdAt?: string
|
|
60
|
-
osFamily?:
|
|
62
|
+
osFamily?: OSFamily
|
|
61
63
|
}
|
|
62
64
|
|
|
63
65
|
export type ListClusterVMsRequest = {
|
|
@@ -81,7 +83,7 @@ export type CreateVMRequest = {
|
|
|
81
83
|
annotations?: {[key: string]: string}
|
|
82
84
|
imageSource?: ImageSource
|
|
83
85
|
imageUrl?: string
|
|
84
|
-
systemDisk?:
|
|
86
|
+
systemDisk?: string
|
|
85
87
|
cpu?: Item
|
|
86
88
|
memory?: Item
|
|
87
89
|
ssh?: SSH
|
|
@@ -96,8 +98,8 @@ export type SSH = {
|
|
|
96
98
|
}
|
|
97
99
|
|
|
98
100
|
export type Item = {
|
|
99
|
-
request?:
|
|
100
|
-
limit?:
|
|
101
|
+
request?: string
|
|
102
|
+
limit?: string
|
|
101
103
|
}
|
|
102
104
|
|
|
103
105
|
export type Network = {
|
|
@@ -122,6 +124,11 @@ export type UpdateVMRequest = {
|
|
|
122
124
|
cluster?: string
|
|
123
125
|
namespace?: string
|
|
124
126
|
name?: string
|
|
127
|
+
aliasName?: string
|
|
128
|
+
labels?: {[key: string]: string}
|
|
129
|
+
annotations?: {[key: string]: string}
|
|
130
|
+
cpu?: Item
|
|
131
|
+
memory?: Item
|
|
125
132
|
}
|
|
126
133
|
|
|
127
134
|
export type UpdateVMResponse = {
|
|
@@ -154,6 +161,11 @@ export type GetVMResponse = {
|
|
|
154
161
|
ips?: string[]
|
|
155
162
|
status?: VMStatus
|
|
156
163
|
createdAt?: string
|
|
164
|
+
username?: string
|
|
165
|
+
password?: string
|
|
166
|
+
sshKey?: string
|
|
167
|
+
cpu?: Item
|
|
168
|
+
memory?: Item
|
|
157
169
|
}
|
|
158
170
|
|
|
159
171
|
export type VMNetwork = {
|
|
@@ -205,6 +217,7 @@ export type VMSnapshot = {
|
|
|
205
217
|
name?: string
|
|
206
218
|
description?: string
|
|
207
219
|
createdAt?: string
|
|
220
|
+
status?: SnapshotStatus
|
|
208
221
|
}
|
|
209
222
|
|
|
210
223
|
export type ListVMSnapshotsResponse = {
|
|
@@ -212,12 +225,12 @@ export type ListVMSnapshotsResponse = {
|
|
|
212
225
|
pagination?: Pagination
|
|
213
226
|
}
|
|
214
227
|
|
|
215
|
-
export type
|
|
228
|
+
export type CreateCustomResourceRequest = {
|
|
216
229
|
cluster?: string
|
|
217
|
-
data?: string
|
|
230
|
+
data?: string[]
|
|
218
231
|
}
|
|
219
232
|
|
|
220
|
-
export type
|
|
233
|
+
export type CreateCustomResourceResponse = {
|
|
221
234
|
}
|
|
222
235
|
|
|
223
236
|
export type CreateVMSnapshotRequest = {
|
|
@@ -241,6 +254,56 @@ export type RestoreVMSnapshotRequest = {
|
|
|
241
254
|
export type RestoreVMSnapshotResponse = {
|
|
242
255
|
}
|
|
243
256
|
|
|
257
|
+
export type DeleteVMSnapshotRequest = {
|
|
258
|
+
cluster?: string
|
|
259
|
+
namespace?: string
|
|
260
|
+
name?: string
|
|
261
|
+
snapshotName?: string
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
export type DeleteVMSnapshotResponse = {
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
export type UpdateVMSnapshotRequest = {
|
|
268
|
+
cluster?: string
|
|
269
|
+
namespace?: string
|
|
270
|
+
name?: string
|
|
271
|
+
snapshotName?: string
|
|
272
|
+
snapshotDescription?: string
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
export type UpdateVMSnapshotResponse = {
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
export type CloneVMRequest = {
|
|
279
|
+
cluster?: string
|
|
280
|
+
namespace?: string
|
|
281
|
+
name?: string
|
|
282
|
+
cloneName?: string
|
|
283
|
+
description?: string
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
export type CloneVMResponse = {
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
export type ListSystemImagesRequest = {
|
|
290
|
+
cluster?: string
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
export type ListSystemImagesResponse = {
|
|
294
|
+
items?: SystemImage[]
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
export type SystemImage = {
|
|
298
|
+
osFamily?: OSFamily
|
|
299
|
+
version?: SystemImageVersion[]
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
export type SystemImageVersion = {
|
|
303
|
+
version?: string
|
|
304
|
+
url?: string
|
|
305
|
+
}
|
|
306
|
+
|
|
244
307
|
export class VM {
|
|
245
308
|
static ListClusterVMs(req: ListClusterVMsRequest, initReq?: fm.InitReq): Promise<ListClusterVmsResponse> {
|
|
246
309
|
return fm.fetchReq<ListClusterVMsRequest, ListClusterVmsResponse>(`/apis/virtnest.io/v1alpha1/clusters/${req["cluster"]}/vms?${fm.renderURLSearchParams(req, ["cluster"])}`, {...initReq, method: "GET"})
|
|
@@ -248,8 +311,8 @@ export class VM {
|
|
|
248
311
|
static CreateVM(req: CreateVMRequest, initReq?: fm.InitReq): Promise<CreateVMResponse> {
|
|
249
312
|
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)})
|
|
250
313
|
}
|
|
251
|
-
static
|
|
252
|
-
return fm.fetchReq<
|
|
314
|
+
static CreateCustomResource(req: CreateCustomResourceRequest, initReq?: fm.InitReq): Promise<CreateCustomResourceResponse> {
|
|
315
|
+
return fm.fetchReq<CreateCustomResourceRequest, CreateCustomResourceResponse>(`/apis/virtnest.io/v1alpha1/clusters/${req["cluster"]}/custom-resource`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
|
|
253
316
|
}
|
|
254
317
|
static DeleteVM(req: DeleteVMRequest, initReq?: fm.InitReq): Promise<DeleteVMResponse> {
|
|
255
318
|
return fm.fetchReq<DeleteVMRequest, DeleteVMResponse>(`/apis/virtnest.io/v1alpha1/clusters/${req["cluster"]}/namespaces/${req["namespace"]}/vms/${req["name"]}`, {...initReq, method: "DELETE"})
|
|
@@ -278,4 +341,16 @@ export class VM {
|
|
|
278
341
|
static RestoreVMSnapshot(req: RestoreVMSnapshotRequest, initReq?: fm.InitReq): Promise<RestoreVMSnapshotResponse> {
|
|
279
342
|
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)})
|
|
280
343
|
}
|
|
344
|
+
static DeleteVMSnapshot(req: DeleteVMSnapshotRequest, initReq?: fm.InitReq): Promise<DeleteVMSnapshotResponse> {
|
|
345
|
+
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
|
+
}
|
|
347
|
+
static UpdateVMSnapshot(req: UpdateVMSnapshotRequest, initReq?: fm.InitReq): Promise<UpdateVMSnapshotResponse> {
|
|
348
|
+
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
|
+
}
|
|
350
|
+
static CloneVM(req: CloneVMRequest, initReq?: fm.InitReq): Promise<CloneVMResponse> {
|
|
351
|
+
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)})
|
|
352
|
+
}
|
|
353
|
+
static ListSystemImages(req: ListSystemImagesRequest, initReq?: fm.InitReq): Promise<ListSystemImagesResponse> {
|
|
354
|
+
return fm.fetchReq<ListSystemImagesRequest, ListSystemImagesResponse>(`/apis/virtnest.io/v1alpha1/clusters/${req["cluster"]}/system-images?${fm.renderURLSearchParams(req, ["cluster"])}`, {...initReq, method: "GET"})
|
|
355
|
+
}
|
|
281
356
|
}
|