@daocloud-proto/virtnest 0.3.0-dev-5 → 0.3.0-dev-7

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.3.0-dev-5",
3
+ "version":"0.3.0-dev-7",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "license": "ISC"
package/v1alpha1/vm.pb.ts CHANGED
@@ -19,6 +19,16 @@ export enum AllowedOperation {
19
19
  allowed_operation_live_migration = "allowed_operation_live_migration",
20
20
  }
21
21
 
22
+ export enum SortBy {
23
+ created_at = "created_at",
24
+ field_name = "field_name",
25
+ }
26
+
27
+ export enum SortDir {
28
+ desc = "desc",
29
+ asc = "asc",
30
+ }
31
+
22
32
  export enum ImageSource {
23
33
  docker = "docker",
24
34
  http = "http",
@@ -86,10 +96,10 @@ export type ListClusterVmsInfo = {
86
96
  status?: VMStatus
87
97
  namespace?: string
88
98
  ips?: string[]
89
- cpu?: string
99
+ cpu?: number
90
100
  memory?: string
91
101
  createdAt?: string
92
- osFamily?: OSFamily
102
+ osFamily?: string
93
103
  vmErrorMessage?: VmErrorMessage
94
104
  allowedOperation?: AllowedOperation[]
95
105
  node?: string
@@ -100,6 +110,8 @@ export type ListClusterVMsRequest = {
100
110
  page?: number
101
111
  cluster?: string
102
112
  search?: string
113
+ sortBy?: SortBy
114
+ sortDir?: SortDir
103
115
  }
104
116
 
105
117
  export type ListClusterVmsResponse = {
@@ -117,10 +129,10 @@ export type CreateVMRequest = {
117
129
  imageSource?: ImageSource
118
130
  imageUrl?: string
119
131
  disks?: VMDisks
120
- cpu?: Item
121
- memory?: Item
132
+ cpu?: number
133
+ memory?: string
122
134
  ssh?: SSH
123
- osFamily?: OSFamily
135
+ osFamily?: string
124
136
  osVersion?: string
125
137
  secret?: string
126
138
  }
@@ -131,11 +143,6 @@ export type SSH = {
131
143
  sshKey?: string
132
144
  }
133
145
 
134
- export type Item = {
135
- request?: string
136
- limit?: string
137
- }
138
-
139
146
  export type Network = {
140
147
  name?: string
141
148
  subnet?: string
@@ -161,8 +168,8 @@ export type UpdateVMRequest = {
161
168
  aliasName?: string
162
169
  labels?: {[key: string]: string}
163
170
  annotations?: {[key: string]: string}
164
- cpu?: Item
165
- memory?: Item
171
+ cpu?: number
172
+ memory?: string
166
173
  disks?: VMDisks
167
174
  }
168
175
 
@@ -199,11 +206,11 @@ export type GetVMResponse = {
199
206
  username?: string
200
207
  password?: string
201
208
  sshKey?: string
202
- cpu?: Item
203
- memory?: Item
209
+ cpu?: number
210
+ memory?: string
204
211
  vmErrorMessage?: VmErrorMessage
205
212
  imageSource?: ImageSource
206
- osFamily?: OSFamily
213
+ osFamily?: string
207
214
  osVersion?: string
208
215
  imageUrl?: string
209
216
  node?: string
@@ -397,7 +404,7 @@ export type ListSystemImagesResponse = {
397
404
  }
398
405
 
399
406
  export type SystemImage = {
400
- osFamily?: OSFamily
407
+ osFamily?: string
401
408
  version?: SystemImageVersion[]
402
409
  }
403
410
 
@@ -474,8 +481,8 @@ export type StorageClass = {
474
481
  supportAccessMode?: PersistentVolumeAccessMode[]
475
482
  }
476
483
 
477
- export type CreateVMWithTemplateRequest = {
478
- templateName?: string
484
+ export type CreateVMWithVMTemplateRequest = {
485
+ vmtemplateName?: string
479
486
  cluster?: string
480
487
  namespace?: string
481
488
  name?: string
@@ -483,11 +490,15 @@ export type CreateVMWithTemplateRequest = {
483
490
  cpu?: number
484
491
  memory?: string
485
492
  disks?: VMDisks
486
- username?: string
487
- password?: string
493
+ ssh?: SSH
494
+ imageSource?: ImageSource
495
+ imageUrl?: string
496
+ osFamily?: string
497
+ osVersion?: string
498
+ secret?: string
488
499
  }
489
500
 
490
- export type CreateVMWithTemplateResponse = {
501
+ export type CreateVMWithVMTemplateResponse = {
491
502
  }
492
503
 
493
504
  export class VM {
@@ -566,7 +577,7 @@ export class VM {
566
577
  static ListClusterStorageClasses(req: ListClusterStorageClassesRequest, initReq?: fm.InitReq): Promise<ListClusterStorageClassesResponse> {
567
578
  return fm.fetchReq<ListClusterStorageClassesRequest, ListClusterStorageClassesResponse>(`/apis/virtnest.io/v1alpha1/clusters/${req["cluster"]}/storageclasses?${fm.renderURLSearchParams(req, ["cluster"])}`, {...initReq, method: "GET"})
568
579
  }
569
- static CreateVMWithTemplate(req: CreateVMWithTemplateRequest, initReq?: fm.InitReq): Promise<CreateVMWithTemplateResponse> {
570
- return fm.fetchReq<CreateVMWithTemplateRequest, CreateVMWithTemplateResponse>(`/apis/virtnest.io/v1alpha1/clusters/${req["cluster"]}/namespaces/${req["namespace"]}/vm-with-template/${req["templateName"]}`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
580
+ static CreateVMWithVMTemplate(req: CreateVMWithVMTemplateRequest, initReq?: fm.InitReq): Promise<CreateVMWithVMTemplateResponse> {
581
+ return fm.fetchReq<CreateVMWithVMTemplateRequest, CreateVMWithVMTemplateResponse>(`/apis/virtnest.io/v1alpha1/clusters/${req["cluster"]}/namespaces/${req["namespace"]}/vm-with-vmtemplate/${req["vmtemplateName"]}`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
571
582
  }
572
583
  }
@@ -11,13 +11,6 @@ export enum TemplateType {
11
11
  internal = "internal",
12
12
  }
13
13
 
14
- export enum OSFamily {
15
- Unknown = "Unknown",
16
- Debian = "Debian",
17
- CentOS = "CentOS",
18
- Ubuntu = "Ubuntu",
19
- }
20
-
21
14
  export type ListVMTemplatesRequest = {
22
15
  pageSize?: number
23
16
  page?: number
@@ -38,10 +31,10 @@ export type Pagination = {
38
31
  export type VMTemplateInfo = {
39
32
  name?: string
40
33
  type?: TemplateType
41
- cpu?: string
34
+ cpu?: number
42
35
  memory?: string
43
36
  createdAt?: string
44
- osFamily?: OSFamily
37
+ osFamily?: string
45
38
  }
46
39
 
47
40
  export type GetVMTemplateRequest = {
@@ -53,21 +46,33 @@ export type GetVMTemplateResponse = {
53
46
  description?: string
54
47
  labels?: {[key: string]: string}
55
48
  annotations?: {[key: string]: string}
56
- cpu?: string
49
+ cpu?: number
57
50
  memory?: string
58
51
  createdAt?: string
59
- osFamily?: OSFamily
52
+ osFamily?: string
60
53
  imageUrl?: string
54
+ type?: TemplateType
55
+ systemDiskCapacity?: string
61
56
  }
62
57
 
63
58
  export type CreateVMTemplateByVMRequest = {
59
+ cluster?: string
60
+ namespace?: string
64
61
  vmName?: string
65
- templateName?: string
62
+ vmtemplateName?: string
63
+ description?: string
66
64
  }
67
65
 
68
66
  export type CreateVMTemplateByVMResponse = {
69
67
  }
70
68
 
69
+ export type DeleteVMTemplateRequest = {
70
+ name?: string
71
+ }
72
+
73
+ export type DeleteVMTemplateResponse = {
74
+ }
75
+
71
76
  export class VMTemplate {
72
77
  static ListVMTemplates(req: ListVMTemplatesRequest, initReq?: fm.InitReq): Promise<ListVMTemplatesResponse> {
73
78
  return fm.fetchReq<ListVMTemplatesRequest, ListVMTemplatesResponse>(`/apis/virtnest.io/v1alpha1/vmtemplates?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
@@ -75,7 +80,10 @@ export class VMTemplate {
75
80
  static GetVMTemplate(req: GetVMTemplateRequest, initReq?: fm.InitReq): Promise<GetVMTemplateResponse> {
76
81
  return fm.fetchReq<GetVMTemplateRequest, GetVMTemplateResponse>(`/apis/virtnest.io/v1alpha1/vmtemplates/${req["name"]}?${fm.renderURLSearchParams(req, ["name"])}`, {...initReq, method: "GET"})
77
82
  }
78
- static CreateTemplateByVM(req: CreateVMTemplateByVMRequest, initReq?: fm.InitReq): Promise<CreateVMTemplateByVMResponse> {
79
- return fm.fetchReq<CreateVMTemplateByVMRequest, CreateVMTemplateByVMResponse>(`/apis/virtnest.io/v1alpha1/vmtemplatebyvm`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
83
+ static DeleteVMTemplate(req: DeleteVMTemplateRequest, initReq?: fm.InitReq): Promise<DeleteVMTemplateResponse> {
84
+ return fm.fetchReq<DeleteVMTemplateRequest, DeleteVMTemplateResponse>(`/apis/virtnest.io/v1alpha1/vmtemplates/${req["name"]}`, {...initReq, method: "DELETE"})
85
+ }
86
+ static CreateVMTemplateByVM(req: CreateVMTemplateByVMRequest, initReq?: fm.InitReq): Promise<CreateVMTemplateByVMResponse> {
87
+ return fm.fetchReq<CreateVMTemplateByVMRequest, CreateVMTemplateByVMResponse>(`/apis/virtnest.io/v1alpha1/vmtemplate-by-vm`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
80
88
  }
81
89
  }