@daocloud-proto/virtnest 0.3.0 → 0.4.0-rc1

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",
3
+ "version":"0.4.0-rc1",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "license": "ISC"
@@ -15,6 +15,8 @@ export type ClusterInfo = {
15
15
  name?: string
16
16
  status?: Status
17
17
  isKubevirtInstalled?: boolean
18
+ isInsightAgentInstalled?: boolean
19
+ isSpiderpoolInstalled?: boolean
18
20
  }
19
21
 
20
22
  export type ListClustersRequest = {
@@ -33,6 +35,29 @@ export type ListClusterNamespacesResponse = {
33
35
  items?: string[]
34
36
  }
35
37
 
38
+ export type IsInsightAgentInstalledRequest = {
39
+ cluster?: string
40
+ }
41
+
42
+ export type IsInsightAgentInstalledResponse = {
43
+ exist?: boolean
44
+ }
45
+
46
+ export type IsServiceMonitorAppliedRequest = {
47
+ cluster?: string
48
+ }
49
+
50
+ export type IsServiceMonitorAppliedResponse = {
51
+ exist?: boolean
52
+ }
53
+
54
+ export type CreateServiceMonitorRequest = {
55
+ cluster?: string
56
+ }
57
+
58
+ export type CreateServiceMonitorResponse = {
59
+ }
60
+
36
61
  export class Cluster {
37
62
  static ListClusters(req: ListClustersRequest, initReq?: fm.InitReq): Promise<ListClustersResponse> {
38
63
  return fm.fetchReq<ListClustersRequest, ListClustersResponse>(`/apis/virtnest.io/v1alpha1/clusters?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
@@ -40,4 +65,13 @@ export class Cluster {
40
65
  static ListClusterNamespaces(req: ListClusterNamespacesRequest, initReq?: fm.InitReq): Promise<ListClusterNamespacesResponse> {
41
66
  return fm.fetchReq<ListClusterNamespacesRequest, ListClusterNamespacesResponse>(`/apis/virtnest.io/v1alpha1/clusters/${req["cluster"]}/namespaces?${fm.renderURLSearchParams(req, ["cluster"])}`, {...initReq, method: "GET"})
42
67
  }
68
+ static IsInsightAgentInstalled(req: IsInsightAgentInstalledRequest, initReq?: fm.InitReq): Promise<IsInsightAgentInstalledResponse> {
69
+ return fm.fetchReq<IsInsightAgentInstalledRequest, IsInsightAgentInstalledResponse>(`/apis/virtnest.io/v1alpha1/clusters/${req["cluster"]}/insight-agent/exist?${fm.renderURLSearchParams(req, ["cluster"])}`, {...initReq, method: "GET"})
70
+ }
71
+ static IsServiceMonitorApplied(req: IsServiceMonitorAppliedRequest, initReq?: fm.InitReq): Promise<IsServiceMonitorAppliedResponse> {
72
+ return fm.fetchReq<IsServiceMonitorAppliedRequest, IsServiceMonitorAppliedResponse>(`/apis/virtnest.io/v1alpha1/clusters/${req["cluster"]}/service-monitor/exist?${fm.renderURLSearchParams(req, ["cluster"])}`, {...initReq, method: "GET"})
73
+ }
74
+ static CreateServiceMonitor(req: CreateServiceMonitorRequest, initReq?: fm.InitReq): Promise<CreateServiceMonitorResponse> {
75
+ return fm.fetchReq<CreateServiceMonitorRequest, CreateServiceMonitorResponse>(`/apis/virtnest.io/v1alpha1/clusters/${req["cluster"]}/service-monitor`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
76
+ }
43
77
  }
package/v1alpha1/vm.pb.ts CHANGED
@@ -112,6 +112,7 @@ export type ListClusterVMsRequest = {
112
112
  search?: string
113
113
  sortBy?: SortBy
114
114
  sortDir?: SortDir
115
+ namespace?: string
115
116
  }
116
117
 
117
118
  export type ListClusterVmsResponse = {
@@ -119,6 +120,17 @@ export type ListClusterVmsResponse = {
119
120
  pagination?: Pagination
120
121
  }
121
122
 
123
+ export type MultusNetwork = {
124
+ networkMode?: string
125
+ items?: MultusNetworkItem[]
126
+ }
127
+
128
+ export type MultusNetworkItem = {
129
+ interface?: string
130
+ multusConfig?: MultusConfigInfo
131
+ ipPoolNames?: string[]
132
+ }
133
+
122
134
  export type CreateVMRequest = {
123
135
  cluster?: string
124
136
  namespace?: string
@@ -135,6 +147,7 @@ export type CreateVMRequest = {
135
147
  osFamily?: string
136
148
  osVersion?: string
137
149
  secret?: string
150
+ networks?: MultusNetwork[]
138
151
  }
139
152
 
140
153
  export type SSH = {
@@ -216,6 +229,18 @@ export type GetVMResponse = {
216
229
  node?: string
217
230
  allowedOperation?: AllowedOperation[]
218
231
  secret?: string
232
+ networks?: MultusNetworkInfo[]
233
+ }
234
+
235
+ export type MultusNetworkInfo = {
236
+ networkMode?: string
237
+ multusConfig?: MultusConfigInfo
238
+ interface?: string
239
+ ip?: string
240
+ mac?: string
241
+ subnet?: string
242
+ gateway?: string
243
+ vlanId?: string
219
244
  }
220
245
 
221
246
  export type VMNetwork = {
@@ -501,6 +526,26 @@ export type CreateVMWithVMTemplateRequest = {
501
526
  export type CreateVMWithVMTemplateResponse = {
502
527
  }
503
528
 
529
+ export type MultusConfigInfo = {
530
+ name?: string
531
+ namespace?: string
532
+ cniType?: string
533
+ }
534
+
535
+ export type NetworkInterfaceInfo = {
536
+ networkInterface?: string
537
+ multusConfigs?: MultusConfigInfo[]
538
+ }
539
+
540
+ export type ListNetworkInterfacesRequest = {
541
+ cluster?: string
542
+ }
543
+
544
+ export type ListNetworkInterfacesResponse = {
545
+ ipPools?: string[]
546
+ interfaces?: NetworkInterfaceInfo[]
547
+ }
548
+
504
549
  export class VM {
505
550
  static ListClusterVMs(req: ListClusterVMsRequest, initReq?: fm.InitReq): Promise<ListClusterVmsResponse> {
506
551
  return fm.fetchReq<ListClusterVMsRequest, ListClusterVmsResponse>(`/apis/virtnest.io/v1alpha1/clusters/${req["cluster"]}/vms?${fm.renderURLSearchParams(req, ["cluster"])}`, {...initReq, method: "GET"})
@@ -580,4 +625,7 @@ export class VM {
580
625
  static CreateVMWithVMTemplate(req: CreateVMWithVMTemplateRequest, initReq?: fm.InitReq): Promise<CreateVMWithVMTemplateResponse> {
581
626
  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)})
582
627
  }
628
+ static ListNetworkInterfaces(req: ListNetworkInterfacesRequest, initReq?: fm.InitReq): Promise<ListNetworkInterfacesResponse> {
629
+ return fm.fetchReq<ListNetworkInterfacesRequest, ListNetworkInterfacesResponse>(`/apis/virtnest.io/v1alpha1/clusters/${req["cluster"]}/network-interfaces?${fm.renderURLSearchParams(req, ["cluster"])}`, {...initReq, method: "GET"})
630
+ }
583
631
  }
@@ -17,10 +17,23 @@ export enum ImageSource {
17
17
  s3 = "s3",
18
18
  }
19
19
 
20
+ export enum SortBy {
21
+ UNSPECIFIED = "UNSPECIFIED",
22
+ created_at = "created_at",
23
+ field_name = "field_name",
24
+ }
25
+
26
+ export enum SortDir {
27
+ desc = "desc",
28
+ asc = "asc",
29
+ }
30
+
20
31
  export type ListVMTemplatesRequest = {
21
32
  pageSize?: number
22
33
  page?: number
23
34
  search?: string
35
+ sortBy?: SortBy
36
+ sortDir?: SortDir
24
37
  }
25
38
 
26
39
  export type ListVMTemplatesResponse = {