@daocloud-proto/virtnest 0.1.10-dev2 → 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 +1 -0
- package/v1alpha1/vm.pb.ts +69 -9
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
|
@@ -43,6 +43,14 @@ export enum StorageType {
|
|
|
43
43
|
data = "data",
|
|
44
44
|
}
|
|
45
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
|
+
|
|
46
54
|
export type Pagination = {
|
|
47
55
|
page?: number
|
|
48
56
|
pageSize?: number
|
|
@@ -54,7 +62,7 @@ export type ListClusterVmsInfo = {
|
|
|
54
62
|
status?: VMStatus
|
|
55
63
|
namespace?: string
|
|
56
64
|
ips?: string[]
|
|
57
|
-
cpu?:
|
|
65
|
+
cpu?: string
|
|
58
66
|
memory?: string
|
|
59
67
|
createdAt?: string
|
|
60
68
|
osFamily?: OSFamilyResponse
|
|
@@ -81,7 +89,7 @@ export type CreateVMRequest = {
|
|
|
81
89
|
annotations?: {[key: string]: string}
|
|
82
90
|
imageSource?: ImageSource
|
|
83
91
|
imageUrl?: string
|
|
84
|
-
systemDisk?:
|
|
92
|
+
systemDisk?: string
|
|
85
93
|
cpu?: Item
|
|
86
94
|
memory?: Item
|
|
87
95
|
ssh?: SSH
|
|
@@ -96,8 +104,8 @@ export type SSH = {
|
|
|
96
104
|
}
|
|
97
105
|
|
|
98
106
|
export type Item = {
|
|
99
|
-
request?:
|
|
100
|
-
limit?:
|
|
107
|
+
request?: string
|
|
108
|
+
limit?: string
|
|
101
109
|
}
|
|
102
110
|
|
|
103
111
|
export type Network = {
|
|
@@ -122,6 +130,11 @@ export type UpdateVMRequest = {
|
|
|
122
130
|
cluster?: string
|
|
123
131
|
namespace?: string
|
|
124
132
|
name?: string
|
|
133
|
+
aliasName?: string
|
|
134
|
+
labels?: {[key: string]: string}
|
|
135
|
+
annotations?: {[key: string]: string}
|
|
136
|
+
cpu?: Item
|
|
137
|
+
memory?: Item
|
|
125
138
|
}
|
|
126
139
|
|
|
127
140
|
export type UpdateVMResponse = {
|
|
@@ -154,6 +167,11 @@ export type GetVMResponse = {
|
|
|
154
167
|
ips?: string[]
|
|
155
168
|
status?: VMStatus
|
|
156
169
|
createdAt?: string
|
|
170
|
+
username?: string
|
|
171
|
+
password?: string
|
|
172
|
+
sshKey?: string
|
|
173
|
+
cpu?: Item
|
|
174
|
+
memory?: Item
|
|
157
175
|
}
|
|
158
176
|
|
|
159
177
|
export type VMNetwork = {
|
|
@@ -205,6 +223,7 @@ export type VMSnapshot = {
|
|
|
205
223
|
name?: string
|
|
206
224
|
description?: string
|
|
207
225
|
createdAt?: string
|
|
226
|
+
status?: SnapshotStatus
|
|
208
227
|
}
|
|
209
228
|
|
|
210
229
|
export type ListVMSnapshotsResponse = {
|
|
@@ -212,12 +231,12 @@ export type ListVMSnapshotsResponse = {
|
|
|
212
231
|
pagination?: Pagination
|
|
213
232
|
}
|
|
214
233
|
|
|
215
|
-
export type
|
|
234
|
+
export type CreateCustomResourceRequest = {
|
|
216
235
|
cluster?: string
|
|
217
|
-
data?: string
|
|
236
|
+
data?: string[]
|
|
218
237
|
}
|
|
219
238
|
|
|
220
|
-
export type
|
|
239
|
+
export type CreateCustomResourceResponse = {
|
|
221
240
|
}
|
|
222
241
|
|
|
223
242
|
export type CreateVMSnapshotRequest = {
|
|
@@ -241,6 +260,38 @@ export type RestoreVMSnapshotRequest = {
|
|
|
241
260
|
export type RestoreVMSnapshotResponse = {
|
|
242
261
|
}
|
|
243
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
|
+
|
|
244
295
|
export class VM {
|
|
245
296
|
static ListClusterVMs(req: ListClusterVMsRequest, initReq?: fm.InitReq): Promise<ListClusterVmsResponse> {
|
|
246
297
|
return fm.fetchReq<ListClusterVMsRequest, ListClusterVmsResponse>(`/apis/virtnest.io/v1alpha1/clusters/${req["cluster"]}/vms?${fm.renderURLSearchParams(req, ["cluster"])}`, {...initReq, method: "GET"})
|
|
@@ -248,8 +299,8 @@ export class VM {
|
|
|
248
299
|
static CreateVM(req: CreateVMRequest, initReq?: fm.InitReq): Promise<CreateVMResponse> {
|
|
249
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)})
|
|
250
301
|
}
|
|
251
|
-
static
|
|
252
|
-
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)})
|
|
253
304
|
}
|
|
254
305
|
static DeleteVM(req: DeleteVMRequest, initReq?: fm.InitReq): Promise<DeleteVMResponse> {
|
|
255
306
|
return fm.fetchReq<DeleteVMRequest, DeleteVMResponse>(`/apis/virtnest.io/v1alpha1/clusters/${req["cluster"]}/namespaces/${req["namespace"]}/vms/${req["name"]}`, {...initReq, method: "DELETE"})
|
|
@@ -278,4 +329,13 @@ export class VM {
|
|
|
278
329
|
static RestoreVMSnapshot(req: RestoreVMSnapshotRequest, initReq?: fm.InitReq): Promise<RestoreVMSnapshotResponse> {
|
|
279
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)})
|
|
280
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
|
+
}
|
|
281
341
|
}
|