@daocloud-proto/virtnest 0.3.0-dev-1 → 0.3.0-dev-3

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-1",
3
+ "version":"0.3.0-dev-3",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "license": "ISC"
@@ -33,14 +33,6 @@ 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
-
44
36
  export class Cluster {
45
37
  static ListClusters(req: ListClustersRequest, initReq?: fm.InitReq): Promise<ListClustersResponse> {
46
38
  return fm.fetchReq<ListClustersRequest, ListClustersResponse>(`/apis/virtnest.io/v1alpha1/clusters?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
@@ -48,7 +40,4 @@ export class Cluster {
48
40
  static ListClusterNamespaces(req: ListClusterNamespacesRequest, initReq?: fm.InitReq): Promise<ListClusterNamespacesResponse> {
49
41
  return fm.fetchReq<ListClusterNamespacesRequest, ListClusterNamespacesResponse>(`/apis/virtnest.io/v1alpha1/clusters/${req["cluster"]}/namespaces?${fm.renderURLSearchParams(req, ["cluster"])}`, {...initReq, method: "GET"})
50
42
  }
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
- }
54
43
  }
@@ -106,6 +106,34 @@ export type DetectKangarooResponse = {
106
106
  enabled?: boolean
107
107
  }
108
108
 
109
+ export type ListSecretsRequest = {
110
+ cluster?: string
111
+ namespace?: string
112
+ }
113
+
114
+ export type ListSecretsResponse = {
115
+ items?: Secret[]
116
+ }
117
+
118
+ export type CheckSecretRequest = {
119
+ cluster?: string
120
+ namespace?: string
121
+ name?: string
122
+ }
123
+
124
+ export type CheckSecretResponse = {
125
+ canUse?: boolean
126
+ message?: string
127
+ }
128
+
129
+ export type Secret = {
130
+ name?: string
131
+ uid?: string
132
+ cluster?: string
133
+ namespace?: string
134
+ type?: string
135
+ }
136
+
109
137
  export class Image {
110
138
  static ListRegistries(req: ListRegistriesRequest, initReq?: fm.InitReq): Promise<ListRegistriesResponse> {
111
139
  return fm.fetchReq<ListRegistriesRequest, ListRegistriesResponse>(`/apis/virtnest.io/v1alpha1/registries?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
@@ -119,4 +147,10 @@ export class Image {
119
147
  static ListArtifacts(req: ListArtifactsRequest, initReq?: fm.InitReq): Promise<ListArtifactsResponse> {
120
148
  return fm.fetchReq<ListArtifactsRequest, ListArtifactsResponse>(`/apis/virtnest.io/v1alpha1/artifacts?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
121
149
  }
150
+ static ListSecrets(req: ListSecretsRequest, initReq?: fm.InitReq): Promise<ListSecretsResponse> {
151
+ return fm.fetchReq<ListSecretsRequest, ListSecretsResponse>(`/apis/virtnest.io/v1alpha1/clusters/${req["cluster"]}/namespaces/${req["namespace"]}/secrets?${fm.renderURLSearchParams(req, ["cluster", "namespace"])}`, {...initReq, method: "GET"})
152
+ }
153
+ static CheckSecret(req: CheckSecretRequest, initReq?: fm.InitReq): Promise<CheckSecretResponse> {
154
+ return fm.fetchReq<CheckSecretRequest, CheckSecretResponse>(`/apis/virtnest.io/v1alpha1/clusters/${req["cluster"]}/namespaces/${req["namespace"]}/secrets/${req["name"]}/check?${fm.renderURLSearchParams(req, ["cluster", "namespace", "name"])}`, {...initReq, method: "GET"})
155
+ }
122
156
  }
package/v1alpha1/vm.pb.ts CHANGED
@@ -25,6 +25,12 @@ export enum ImageSource {
25
25
  s3 = "s3",
26
26
  }
27
27
 
28
+ export enum DiskOperation {
29
+ add = "add",
30
+ delete = "delete",
31
+ edit = "edit",
32
+ }
33
+
28
34
  export enum VMOperation {
29
35
  start = "start",
30
36
  stop = "stop",
@@ -57,6 +63,13 @@ export enum SnapshotStatus {
57
63
  snapshot_unknown = "snapshot_unknown",
58
64
  }
59
65
 
66
+ export enum PersistentVolumeAccessMode {
67
+ ReadWriteOnce = "ReadWriteOnce",
68
+ ReadOnlyMany = "ReadOnlyMany",
69
+ ReadWriteMany = "ReadWriteMany",
70
+ ReadWriteOncePod = "ReadWriteOncePod",
71
+ }
72
+
60
73
  export type Pagination = {
61
74
  page?: number
62
75
  pageSize?: number
@@ -109,6 +122,7 @@ export type CreateVMRequest = {
109
122
  ssh?: SSH
110
123
  osFamily?: OSFamily
111
124
  osVersion?: string
125
+ secret?: string
112
126
  }
113
127
 
114
128
  export type SSH = {
@@ -149,6 +163,7 @@ export type UpdateVMRequest = {
149
163
  annotations?: {[key: string]: string}
150
164
  cpu?: Item
151
165
  memory?: Item
166
+ disks?: VMDisks
152
167
  }
153
168
 
154
169
  export type UpdateVMResponse = {
@@ -193,6 +208,7 @@ export type GetVMResponse = {
193
208
  imageUrl?: string
194
209
  node?: string
195
210
  allowedOperation?: AllowedOperation[]
211
+ secret?: string
196
212
  }
197
213
 
198
214
  export type VMNetwork = {
@@ -248,6 +264,7 @@ export type VMSnapshot = {
248
264
  description?: string
249
265
  createdAt?: string
250
266
  status?: SnapshotStatus
267
+ restoreTime?: string
251
268
  }
252
269
 
253
270
  export type ListVMSnapshotsResponse = {
@@ -260,6 +277,8 @@ export type VMRestore = {
260
277
  description?: string
261
278
  complete?: boolean
262
279
  createdAt?: string
280
+ restoreTime?: string
281
+ lastRestore?: boolean
263
282
  }
264
283
 
265
284
  export type ListVMRestoresRequest = {
@@ -389,6 +408,8 @@ export type SystemImageVersion = {
389
408
  export type DiskVolume = {
390
409
  storageClass?: string
391
410
  storage?: string
411
+ pvAccessMode?: PersistentVolumeAccessMode
412
+ name?: string
392
413
  }
393
414
 
394
415
  export type AddDiskVolumeToVMRequest = {
@@ -439,6 +460,19 @@ export type LiveMigrateVMRequest = {
439
460
  export type LiveMigrateVMResponse = {
440
461
  }
441
462
 
463
+ export type ListClusterStorageClassesRequest = {
464
+ cluster?: string
465
+ }
466
+
467
+ export type ListClusterStorageClassesResponse = {
468
+ items?: StorageClass[]
469
+ }
470
+
471
+ export type StorageClass = {
472
+ name?: string
473
+ supportAccessMode?: PersistentVolumeAccessMode[]
474
+ }
475
+
442
476
  export class VM {
443
477
  static ListClusterVMs(req: ListClusterVMsRequest, initReq?: fm.InitReq): Promise<ListClusterVmsResponse> {
444
478
  return fm.fetchReq<ListClusterVMsRequest, ListClusterVmsResponse>(`/apis/virtnest.io/v1alpha1/clusters/${req["cluster"]}/vms?${fm.renderURLSearchParams(req, ["cluster"])}`, {...initReq, method: "GET"})
@@ -512,4 +546,7 @@ export class VM {
512
546
  static ExpandVMDiskCapacity(req: ExpandVMDiskCapacityRequest, initReq?: fm.InitReq): Promise<ExpandVMDiskCapacityResponse> {
513
547
  return fm.fetchReq<ExpandVMDiskCapacityRequest, ExpandVMDiskCapacityResponse>(`/apis/virtnest.io/v1alpha1/clusters/${req["cluster"]}/namespaces/${req["namespace"]}/vms/${req["name"]}/disk-volume/${req["diskName"]}/expand-capacity`, {...initReq, method: "PUT", body: JSON.stringify(req, fm.replacer)})
514
548
  }
549
+ static ListClusterStorageClasses(req: ListClusterStorageClassesRequest, initReq?: fm.InitReq): Promise<ListClusterStorageClassesResponse> {
550
+ return fm.fetchReq<ListClusterStorageClassesRequest, ListClusterStorageClassesResponse>(`/apis/virtnest.io/v1alpha1/clusters/${req["cluster"]}/storageclasses?${fm.renderURLSearchParams(req, ["cluster"])}`, {...initReq, method: "GET"})
551
+ }
515
552
  }