@daocloud-proto/virtnest 0.1.9-test-11-g62b7c25a → 0.1.10-dev
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 +2 -2
- package/v1alpha1/vm.pb.ts +70 -11
package/package.json
CHANGED
package/v1alpha1/cluster.pb.ts
CHANGED
|
@@ -35,9 +35,9 @@ export type ListClusterNamespacesResponse = {
|
|
|
35
35
|
|
|
36
36
|
export class Cluster {
|
|
37
37
|
static ListClusters(req: ListClustersRequest, initReq?: fm.InitReq): Promise<ListClustersResponse> {
|
|
38
|
-
return fm.fetchReq<ListClustersRequest, ListClustersResponse>(`/apis/virtnest.io/v1alpha1/
|
|
38
|
+
return fm.fetchReq<ListClustersRequest, ListClustersResponse>(`/apis/virtnest.io/v1alpha1/clusters?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
|
|
39
39
|
}
|
|
40
40
|
static ListClusterNamespaces(req: ListClusterNamespacesRequest, initReq?: fm.InitReq): Promise<ListClusterNamespacesResponse> {
|
|
41
|
-
return fm.fetchReq<ListClusterNamespacesRequest, ListClusterNamespacesResponse>(`/apis/virtnest.io/v1alpha1/
|
|
41
|
+
return fm.fetchReq<ListClusterNamespacesRequest, ListClusterNamespacesResponse>(`/apis/virtnest.io/v1alpha1/clusters/${req["cluster"]}/namespaces?${fm.renderURLSearchParams(req, ["cluster"])}`, {...initReq, method: "GET"})
|
|
42
42
|
}
|
|
43
43
|
}
|
package/v1alpha1/vm.pb.ts
CHANGED
|
@@ -6,6 +6,19 @@
|
|
|
6
6
|
|
|
7
7
|
import * as fm from "../fetch.pb"
|
|
8
8
|
|
|
9
|
+
export enum GuestOS {
|
|
10
|
+
linux = "linux",
|
|
11
|
+
centos = "centos",
|
|
12
|
+
ubuntu = "ubuntu",
|
|
13
|
+
unknown = "unknown",
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export enum ImageSource {
|
|
17
|
+
docker = "docker",
|
|
18
|
+
http = "http",
|
|
19
|
+
s3 = "s3",
|
|
20
|
+
}
|
|
21
|
+
|
|
9
22
|
export enum VMOperation {
|
|
10
23
|
start = "start",
|
|
11
24
|
stop = "stop",
|
|
@@ -38,6 +51,7 @@ export type ListClusterVmsInfo = {
|
|
|
38
51
|
cpu?: number
|
|
39
52
|
memory?: string
|
|
40
53
|
createdAt?: string
|
|
54
|
+
guestOs?: GuestOS
|
|
41
55
|
}
|
|
42
56
|
|
|
43
57
|
export type ListClusterVMsRequest = {
|
|
@@ -57,14 +71,20 @@ export type CreateVMRequest = {
|
|
|
57
71
|
namespace?: string
|
|
58
72
|
name?: string
|
|
59
73
|
aliasName?: string
|
|
60
|
-
describe?: string
|
|
61
74
|
labels?: {[key: string]: string}
|
|
62
75
|
annotations?: {[key: string]: string}
|
|
63
|
-
imageSource?:
|
|
76
|
+
imageSource?: ImageSource
|
|
64
77
|
imageUrl?: string
|
|
65
78
|
systemDisk?: number
|
|
66
79
|
cpu?: Item
|
|
67
80
|
memory?: Item
|
|
81
|
+
ssh?: SSH
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export type SSH = {
|
|
85
|
+
username?: string
|
|
86
|
+
password?: string
|
|
87
|
+
sshKey?: string
|
|
68
88
|
}
|
|
69
89
|
|
|
70
90
|
export type Item = {
|
|
@@ -125,6 +145,7 @@ export type GetVMResponse = {
|
|
|
125
145
|
annotations?: {[key: string]: string}
|
|
126
146
|
ips?: string[]
|
|
127
147
|
status?: VMStatus
|
|
148
|
+
createdAt?: string
|
|
128
149
|
}
|
|
129
150
|
|
|
130
151
|
export type VMNetwork = {
|
|
@@ -183,32 +204,70 @@ export type ListVMSnapshotsResponse = {
|
|
|
183
204
|
pagination?: Pagination
|
|
184
205
|
}
|
|
185
206
|
|
|
207
|
+
export type CreateVMByCRRequest = {
|
|
208
|
+
cluster?: string
|
|
209
|
+
data?: string
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
export type CreateVMByCRResponse = {
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
export type CreateVMSnapshotRequest = {
|
|
216
|
+
cluster?: string
|
|
217
|
+
namespace?: string
|
|
218
|
+
name?: string
|
|
219
|
+
snapshotName?: string
|
|
220
|
+
snapshotDescription?: string
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
export type CreateVMSnapshotResponse = {
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
export type RestoreVMSnapshotRequest = {
|
|
227
|
+
cluster?: string
|
|
228
|
+
namespace?: string
|
|
229
|
+
name?: string
|
|
230
|
+
snapshotName?: string
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
export type RestoreVMSnapshotResponse = {
|
|
234
|
+
}
|
|
235
|
+
|
|
186
236
|
export class VM {
|
|
187
237
|
static ListClusterVMs(req: ListClusterVMsRequest, initReq?: fm.InitReq): Promise<ListClusterVmsResponse> {
|
|
188
|
-
return fm.fetchReq<ListClusterVMsRequest, ListClusterVmsResponse>(`/apis/virtnest.io/v1alpha1/${req["cluster"]}/vms?${fm.renderURLSearchParams(req, ["cluster"])}`, {...initReq, method: "GET"})
|
|
238
|
+
return fm.fetchReq<ListClusterVMsRequest, ListClusterVmsResponse>(`/apis/virtnest.io/v1alpha1/clusters/${req["cluster"]}/vms?${fm.renderURLSearchParams(req, ["cluster"])}`, {...initReq, method: "GET"})
|
|
189
239
|
}
|
|
190
240
|
static CreateVM(req: CreateVMRequest, initReq?: fm.InitReq): Promise<CreateVMResponse> {
|
|
191
|
-
return fm.fetchReq<CreateVMRequest, CreateVMResponse>(`/apis/virtnest.io/v1alpha1/${req["cluster"]}/${req["namespace"]}/vm`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
|
|
241
|
+
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
|
+
}
|
|
243
|
+
static CreateVMByCR(req: CreateVMByCRRequest, initReq?: fm.InitReq): Promise<CreateVMByCRResponse> {
|
|
244
|
+
return fm.fetchReq<CreateVMByCRRequest, CreateVMByCRResponse>(`/apis/virtnest.io/v1alpha1/clusters/${req["cluster"]}/vm`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
|
|
192
245
|
}
|
|
193
246
|
static DeleteVM(req: DeleteVMRequest, initReq?: fm.InitReq): Promise<DeleteVMResponse> {
|
|
194
|
-
return fm.fetchReq<DeleteVMRequest, DeleteVMResponse>(`/apis/virtnest.io/v1alpha1/${req["cluster"]}/${req["namespace"]}/vms/${req["name"]}`, {...initReq, method: "DELETE"})
|
|
247
|
+
return fm.fetchReq<DeleteVMRequest, DeleteVMResponse>(`/apis/virtnest.io/v1alpha1/clusters/${req["cluster"]}/namespaces/${req["namespace"]}/vms/${req["name"]}`, {...initReq, method: "DELETE"})
|
|
195
248
|
}
|
|
196
249
|
static UpdateVM(req: UpdateVMRequest, initReq?: fm.InitReq): Promise<UpdateVMResponse> {
|
|
197
|
-
return fm.fetchReq<UpdateVMRequest, UpdateVMResponse>(`/apis/virtnest.io/v1alpha1/${req["cluster"]}/${req["namespace"]}/vms/${req["name"]}`, {...initReq, method: "PUT", body: JSON.stringify(req, fm.replacer)})
|
|
250
|
+
return fm.fetchReq<UpdateVMRequest, UpdateVMResponse>(`/apis/virtnest.io/v1alpha1/clusters/${req["cluster"]}/namespaces/${req["namespace"]}/vms/${req["name"]}`, {...initReq, method: "PUT", body: JSON.stringify(req, fm.replacer)})
|
|
198
251
|
}
|
|
199
252
|
static UpdateVMRunningStatus(req: UpdateVMRunningStatusRequest, initReq?: fm.InitReq): Promise<UpdateVMRunningStatusResponse> {
|
|
200
|
-
return fm.fetchReq<UpdateVMRunningStatusRequest, UpdateVMRunningStatusResponse>(`/apis/virtnest.io/v1alpha1/${req["cluster"]}/${req["namespace"]}/vms/${req["name"]}/running-status`, {...initReq, method: "PUT", body: JSON.stringify(req, fm.replacer)})
|
|
253
|
+
return fm.fetchReq<UpdateVMRunningStatusRequest, UpdateVMRunningStatusResponse>(`/apis/virtnest.io/v1alpha1/clusters/${req["cluster"]}/namespaces/${req["namespace"]}/vms/${req["name"]}/running-status`, {...initReq, method: "PUT", body: JSON.stringify(req, fm.replacer)})
|
|
201
254
|
}
|
|
202
255
|
static GetVM(req: GetVMRequest, initReq?: fm.InitReq): Promise<GetVMResponse> {
|
|
203
|
-
return fm.fetchReq<GetVMRequest, GetVMResponse>(`/apis/virtnest.io/v1alpha1/${req["cluster"]}/${req["namespace"]}/vms/${req["name"]}?${fm.renderURLSearchParams(req, ["cluster", "namespace", "name"])}`, {...initReq, method: "GET"})
|
|
256
|
+
return fm.fetchReq<GetVMRequest, GetVMResponse>(`/apis/virtnest.io/v1alpha1/clusters/${req["cluster"]}/namespaces/${req["namespace"]}/vms/${req["name"]}?${fm.renderURLSearchParams(req, ["cluster", "namespace", "name"])}`, {...initReq, method: "GET"})
|
|
204
257
|
}
|
|
205
258
|
static ListVMNetworks(req: ListVMNetworksRequest, initReq?: fm.InitReq): Promise<ListVMNetworksResponse> {
|
|
206
|
-
return fm.fetchReq<ListVMNetworksRequest, ListVMNetworksResponse>(`/apis/virtnest.io/v1alpha1/${req["cluster"]}/${req["namespace"]}/vms/${req["name"]}/networks?${fm.renderURLSearchParams(req, ["cluster", "namespace", "name"])}`, {...initReq, method: "GET"})
|
|
259
|
+
return fm.fetchReq<ListVMNetworksRequest, ListVMNetworksResponse>(`/apis/virtnest.io/v1alpha1/clusters/${req["cluster"]}/namespaces/${req["namespace"]}/vms/${req["name"]}/networks?${fm.renderURLSearchParams(req, ["cluster", "namespace", "name"])}`, {...initReq, method: "GET"})
|
|
207
260
|
}
|
|
208
261
|
static ListVMStorages(req: ListVMStoragesRequest, initReq?: fm.InitReq): Promise<ListVMStoragesResponse> {
|
|
209
|
-
return fm.fetchReq<ListVMStoragesRequest, ListVMStoragesResponse>(`/apis/virtnest.io/v1alpha1/${req["cluster"]}/${req["namespace"]}/vms/${req["name"]}/storages?${fm.renderURLSearchParams(req, ["cluster", "namespace", "name"])}`, {...initReq, method: "GET"})
|
|
262
|
+
return fm.fetchReq<ListVMStoragesRequest, ListVMStoragesResponse>(`/apis/virtnest.io/v1alpha1/clusters/${req["cluster"]}/namespaces/${req["namespace"]}/vms/${req["name"]}/storages?${fm.renderURLSearchParams(req, ["cluster", "namespace", "name"])}`, {...initReq, method: "GET"})
|
|
210
263
|
}
|
|
211
264
|
static ListVMSnapshots(req: ListVMSnapshotsRequest, initReq?: fm.InitReq): Promise<ListVMSnapshotsResponse> {
|
|
212
|
-
return fm.fetchReq<ListVMSnapshotsRequest, ListVMSnapshotsResponse>(`/apis/virtnest.io/v1alpha1/${req["cluster"]}/${req["namespace"]}/vms/${req["name"]}/snapshots?${fm.renderURLSearchParams(req, ["cluster", "namespace", "name"])}`, {...initReq, method: "GET"})
|
|
265
|
+
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"})
|
|
266
|
+
}
|
|
267
|
+
static CreateVMSnapshot(req: CreateVMSnapshotRequest, initReq?: fm.InitReq): Promise<CreateVMSnapshotResponse> {
|
|
268
|
+
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)})
|
|
269
|
+
}
|
|
270
|
+
static RestoreVMSnapshot(req: RestoreVMSnapshotRequest, initReq?: fm.InitReq): Promise<RestoreVMSnapshotResponse> {
|
|
271
|
+
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)})
|
|
213
272
|
}
|
|
214
273
|
}
|