@daocloud-proto/virtnest 0.1.9-test-11-g62b7c25a → 0.1.10-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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@daocloud-proto/virtnest",
3
- "version":"0.1.9-test-11-g62b7c25a",
3
+ "version":"0.1.10-dev2",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "license": "ISC"
@@ -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/cluster?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
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/cluster/${req["cluster"]}/namespaces?${fm.renderURLSearchParams(req, ["cluster"])}`, {...initReq, method: "GET"})
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
  }
@@ -0,0 +1,39 @@
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 RoleEnum {
10
+ cluster_admin = "cluster_admin",
11
+ cluster_edit = "cluster_edit",
12
+ cluster_view = "cluster_view",
13
+ ns_admin = "ns_admin",
14
+ ns_edit = "ns_edit",
15
+ ns_view = "ns_view",
16
+ }
17
+
18
+ export type GetUserRolesRequest = {
19
+ }
20
+
21
+ export type GetUserRolesResponse = {
22
+ platformRoles?: RoleEnum[]
23
+ clusterRoles?: {[key: string]: ClusterRoles}
24
+ }
25
+
26
+ export type ClusterRoles = {
27
+ roles?: RoleEnum[]
28
+ nsRoles?: {[key: string]: NSRoles}
29
+ }
30
+
31
+ export type NSRoles = {
32
+ roles?: RoleEnum[]
33
+ }
34
+
35
+ export class Role {
36
+ static GetUserRoles(req: GetUserRolesRequest, initReq?: fm.InitReq): Promise<GetUserRolesResponse> {
37
+ return fm.fetchReq<GetUserRolesRequest, GetUserRolesResponse>(`/apis/virtnest.io/v1alpha1/roles?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
38
+ }
39
+ }
package/v1alpha1/vm.pb.ts CHANGED
@@ -6,6 +6,25 @@
6
6
 
7
7
  import * as fm from "../fetch.pb"
8
8
 
9
+ export enum OSFamily {
10
+ debian = "debian",
11
+ centos = "centos",
12
+ ubuntu = "ubuntu",
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",
20
+ }
21
+
22
+ export enum ImageSource {
23
+ docker = "docker",
24
+ http = "http",
25
+ s3 = "s3",
26
+ }
27
+
9
28
  export enum VMOperation {
10
29
  start = "start",
11
30
  stop = "stop",
@@ -38,6 +57,7 @@ export type ListClusterVmsInfo = {
38
57
  cpu?: number
39
58
  memory?: string
40
59
  createdAt?: string
60
+ osFamily?: OSFamilyResponse
41
61
  }
42
62
 
43
63
  export type ListClusterVMsRequest = {
@@ -57,14 +77,22 @@ export type CreateVMRequest = {
57
77
  namespace?: string
58
78
  name?: string
59
79
  aliasName?: string
60
- describe?: string
61
80
  labels?: {[key: string]: string}
62
81
  annotations?: {[key: string]: string}
63
- imageSource?: string
82
+ imageSource?: ImageSource
64
83
  imageUrl?: string
65
84
  systemDisk?: number
66
85
  cpu?: Item
67
86
  memory?: Item
87
+ ssh?: SSH
88
+ osFamily?: OSFamily
89
+ osVersion?: string
90
+ }
91
+
92
+ export type SSH = {
93
+ username?: string
94
+ password?: string
95
+ sshKey?: string
68
96
  }
69
97
 
70
98
  export type Item = {
@@ -125,6 +153,7 @@ export type GetVMResponse = {
125
153
  annotations?: {[key: string]: string}
126
154
  ips?: string[]
127
155
  status?: VMStatus
156
+ createdAt?: string
128
157
  }
129
158
 
130
159
  export type VMNetwork = {
@@ -183,32 +212,70 @@ export type ListVMSnapshotsResponse = {
183
212
  pagination?: Pagination
184
213
  }
185
214
 
215
+ export type CreateVMByCRRequest = {
216
+ cluster?: string
217
+ data?: string
218
+ }
219
+
220
+ export type CreateVMByCRResponse = {
221
+ }
222
+
223
+ export type CreateVMSnapshotRequest = {
224
+ cluster?: string
225
+ namespace?: string
226
+ name?: string
227
+ snapshotName?: string
228
+ snapshotDescription?: string
229
+ }
230
+
231
+ export type CreateVMSnapshotResponse = {
232
+ }
233
+
234
+ export type RestoreVMSnapshotRequest = {
235
+ cluster?: string
236
+ namespace?: string
237
+ name?: string
238
+ snapshotName?: string
239
+ }
240
+
241
+ export type RestoreVMSnapshotResponse = {
242
+ }
243
+
186
244
  export class VM {
187
245
  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"})
246
+ return fm.fetchReq<ListClusterVMsRequest, ListClusterVmsResponse>(`/apis/virtnest.io/v1alpha1/clusters/${req["cluster"]}/vms?${fm.renderURLSearchParams(req, ["cluster"])}`, {...initReq, method: "GET"})
189
247
  }
190
248
  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)})
249
+ 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
+ }
251
+ static CreateVMByCR(req: CreateVMByCRRequest, initReq?: fm.InitReq): Promise<CreateVMByCRResponse> {
252
+ return fm.fetchReq<CreateVMByCRRequest, CreateVMByCRResponse>(`/apis/virtnest.io/v1alpha1/clusters/${req["cluster"]}/vm`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
192
253
  }
193
254
  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"})
255
+ return fm.fetchReq<DeleteVMRequest, DeleteVMResponse>(`/apis/virtnest.io/v1alpha1/clusters/${req["cluster"]}/namespaces/${req["namespace"]}/vms/${req["name"]}`, {...initReq, method: "DELETE"})
195
256
  }
196
257
  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)})
258
+ 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
259
  }
199
260
  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)})
261
+ 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
262
  }
202
263
  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"})
264
+ 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
265
  }
205
266
  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"})
267
+ 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
268
  }
208
269
  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"})
270
+ 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
271
  }
211
272
  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"})
273
+ 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"})
274
+ }
275
+ static CreateVMSnapshot(req: CreateVMSnapshotRequest, initReq?: fm.InitReq): Promise<CreateVMSnapshotResponse> {
276
+ 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)})
277
+ }
278
+ static RestoreVMSnapshot(req: RestoreVMSnapshotRequest, initReq?: fm.InitReq): Promise<RestoreVMSnapshotResponse> {
279
+ 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
280
  }
214
281
  }