@daocloud-proto/virtnest 0.2.0 → 0.3.0-dev-2
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 +0 -11
- package/v1alpha1/image.pb.ts +35 -1
- package/v1alpha1/vm.pb.ts +37 -0
package/package.json
CHANGED
package/v1alpha1/cluster.pb.ts
CHANGED
|
@@ -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
|
}
|
package/v1alpha1/image.pb.ts
CHANGED
|
@@ -22,7 +22,6 @@ export type Pagination = {
|
|
|
22
22
|
export type ListRegistriesRequest = {
|
|
23
23
|
cluster?: string
|
|
24
24
|
namespace?: string
|
|
25
|
-
global?: boolean
|
|
26
25
|
page?: number
|
|
27
26
|
pageSize?: number
|
|
28
27
|
public?: boolean
|
|
@@ -65,6 +64,7 @@ export type ListRepositoriesRequest = {
|
|
|
65
64
|
|
|
66
65
|
export type ListRepositoriesResponse = {
|
|
67
66
|
items?: Repository[]
|
|
67
|
+
pagination?: Pagination
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
export type Repository = {
|
|
@@ -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
|
|
@@ -79,6 +92,7 @@ export type ListClusterVmsInfo = {
|
|
|
79
92
|
osFamily?: OSFamily
|
|
80
93
|
vmErrorMessage?: VmErrorMessage
|
|
81
94
|
allowedOperation?: AllowedOperation[]
|
|
95
|
+
node?: string
|
|
82
96
|
}
|
|
83
97
|
|
|
84
98
|
export type ListClusterVMsRequest = {
|
|
@@ -108,6 +122,7 @@ export type CreateVMRequest = {
|
|
|
108
122
|
ssh?: SSH
|
|
109
123
|
osFamily?: OSFamily
|
|
110
124
|
osVersion?: string
|
|
125
|
+
secret?: string
|
|
111
126
|
}
|
|
112
127
|
|
|
113
128
|
export type SSH = {
|
|
@@ -148,6 +163,7 @@ export type UpdateVMRequest = {
|
|
|
148
163
|
annotations?: {[key: string]: string}
|
|
149
164
|
cpu?: Item
|
|
150
165
|
memory?: Item
|
|
166
|
+
disks?: VMDisks
|
|
151
167
|
}
|
|
152
168
|
|
|
153
169
|
export type UpdateVMResponse = {
|
|
@@ -190,6 +206,9 @@ export type GetVMResponse = {
|
|
|
190
206
|
osFamily?: OSFamily
|
|
191
207
|
osVersion?: string
|
|
192
208
|
imageUrl?: string
|
|
209
|
+
node?: string
|
|
210
|
+
allowedOperation?: AllowedOperation[]
|
|
211
|
+
secret?: string
|
|
193
212
|
}
|
|
194
213
|
|
|
195
214
|
export type VMNetwork = {
|
|
@@ -386,6 +405,8 @@ export type SystemImageVersion = {
|
|
|
386
405
|
export type DiskVolume = {
|
|
387
406
|
storageClass?: string
|
|
388
407
|
storage?: string
|
|
408
|
+
pvAccessMode?: PersistentVolumeAccessMode
|
|
409
|
+
name?: string
|
|
389
410
|
}
|
|
390
411
|
|
|
391
412
|
export type AddDiskVolumeToVMRequest = {
|
|
@@ -436,6 +457,19 @@ export type LiveMigrateVMRequest = {
|
|
|
436
457
|
export type LiveMigrateVMResponse = {
|
|
437
458
|
}
|
|
438
459
|
|
|
460
|
+
export type ListClusterStorageClassesRequest = {
|
|
461
|
+
cluster?: string
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
export type ListClusterStorageClassesResponse = {
|
|
465
|
+
items?: StorageClass[]
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
export type StorageClass = {
|
|
469
|
+
name?: string
|
|
470
|
+
supportAccessMode?: PersistentVolumeAccessMode[]
|
|
471
|
+
}
|
|
472
|
+
|
|
439
473
|
export class VM {
|
|
440
474
|
static ListClusterVMs(req: ListClusterVMsRequest, initReq?: fm.InitReq): Promise<ListClusterVmsResponse> {
|
|
441
475
|
return fm.fetchReq<ListClusterVMsRequest, ListClusterVmsResponse>(`/apis/virtnest.io/v1alpha1/clusters/${req["cluster"]}/vms?${fm.renderURLSearchParams(req, ["cluster"])}`, {...initReq, method: "GET"})
|
|
@@ -509,4 +543,7 @@ export class VM {
|
|
|
509
543
|
static ExpandVMDiskCapacity(req: ExpandVMDiskCapacityRequest, initReq?: fm.InitReq): Promise<ExpandVMDiskCapacityResponse> {
|
|
510
544
|
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)})
|
|
511
545
|
}
|
|
546
|
+
static ListClusterStorageClasses(req: ListClusterStorageClassesRequest, initReq?: fm.InitReq): Promise<ListClusterStorageClassesResponse> {
|
|
547
|
+
return fm.fetchReq<ListClusterStorageClassesRequest, ListClusterStorageClassesResponse>(`/apis/virtnest.io/v1alpha1/clusters/${req["cluster"]}/storageclasses?${fm.renderURLSearchParams(req, ["cluster"])}`, {...initReq, method: "GET"})
|
|
548
|
+
}
|
|
512
549
|
}
|