@xen-orchestra/rest-api 0.10.0 → 0.11.0
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/dist/abstract-classes/base-controller.mjs +22 -0
- package/dist/alarms/alarm.controller.mjs +1 -1
- package/dist/hosts/host.controller.mjs +30 -1
- package/dist/messages/message.controller.mjs +1 -1
- package/dist/middlewares/generic-error-handler.middleware.mjs +15 -11
- package/dist/middlewares/tsoa-to-xo-error.middleware.mjs +1 -1
- package/dist/open-api/oa-examples/pool.oa-example.mjs +200 -0
- package/dist/open-api/routes/routes.js +101 -15
- package/dist/pools/pool.controller.mjs +15 -1
- package/dist/vms/vm.controller.mjs +1 -1
- package/open-api/spec/swagger.json +2350 -295
- package/package.json +2 -2
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { Controller } from 'tsoa';
|
|
2
|
+
import { createGzip } from 'node:zlib';
|
|
3
|
+
import { pipeline } from 'node:stream/promises';
|
|
2
4
|
import { Readable } from 'node:stream';
|
|
3
5
|
import { BASE_URL } from '../index.mjs';
|
|
4
6
|
import { makeNdJsonStream } from '../helpers/stream.helper.mjs';
|
|
@@ -49,4 +51,24 @@ export class BaseController extends Controller {
|
|
|
49
51
|
getXapi(maybeId) {
|
|
50
52
|
return this.restApi.xoApp.getXapi(maybeId);
|
|
51
53
|
}
|
|
54
|
+
maybeCompressResponse(req, res) {
|
|
55
|
+
let transform;
|
|
56
|
+
let acceptEncoding = req.headers['accept-encoding'];
|
|
57
|
+
acceptEncoding = Array.isArray(acceptEncoding) ? acceptEncoding : acceptEncoding?.split(',');
|
|
58
|
+
if (acceptEncoding !== undefined &&
|
|
59
|
+
acceptEncoding.some(encoding => {
|
|
60
|
+
const value = encoding.split(';')[0].trim().toLowerCase();
|
|
61
|
+
// support `x-gzip` as an alias for `gzip`
|
|
62
|
+
// https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Content-Encoding#gzip
|
|
63
|
+
return value === 'gzip' || value === 'x-gzip';
|
|
64
|
+
})) {
|
|
65
|
+
res.setHeader('Content-Encoding', 'gzip');
|
|
66
|
+
transform = createGzip();
|
|
67
|
+
}
|
|
68
|
+
if (transform !== undefined) {
|
|
69
|
+
pipeline(transform, res).catch(noop);
|
|
70
|
+
return transform;
|
|
71
|
+
}
|
|
72
|
+
return res;
|
|
73
|
+
}
|
|
52
74
|
}
|
|
@@ -85,7 +85,7 @@ let AlarmController = class AlarmController extends XapiXoController {
|
|
|
85
85
|
getObject(id) {
|
|
86
86
|
const maybeAlarm = this.restApi.getObject(id, 'message');
|
|
87
87
|
if (!alarmPredicate(maybeAlarm)) {
|
|
88
|
-
|
|
88
|
+
throw noSuchObject(id, 'alarm');
|
|
89
89
|
}
|
|
90
90
|
return this.#parseAlarm(maybeAlarm);
|
|
91
91
|
}
|
|
@@ -7,8 +7,9 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
8
8
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
9
9
|
};
|
|
10
|
-
import { Example, Get, Path, Query, Request, Response, Route, Security, Tags } from 'tsoa';
|
|
10
|
+
import { Example, Get, Path, Query, Request, Response, Route, Security, SuccessResponse, Tags } from 'tsoa';
|
|
11
11
|
import { inject } from 'inversify';
|
|
12
|
+
import { pipeline } from 'node:stream/promises';
|
|
12
13
|
import { provide } from 'inversify-binding-decorators';
|
|
13
14
|
import { host, hostIds, hostStats, partialHosts } from '../open-api/oa-examples/host.oa-example.mjs';
|
|
14
15
|
import { RestApi } from '../rest-api/rest-api.mjs';
|
|
@@ -39,6 +40,26 @@ let HostController = class HostController extends XapiXoController {
|
|
|
39
40
|
getHostStats(id, granularity) {
|
|
40
41
|
return this.restApi.xoApp.getXapiHostStats(id, granularity);
|
|
41
42
|
}
|
|
43
|
+
/**
|
|
44
|
+
* Host must be running
|
|
45
|
+
*
|
|
46
|
+
* Download the audit log of a host.
|
|
47
|
+
*
|
|
48
|
+
* @example id "b61a5c92-700e-4966-a13b-00633f03eea8"
|
|
49
|
+
*
|
|
50
|
+
*/
|
|
51
|
+
async getAuditLog(req, id) {
|
|
52
|
+
const xapiHost = this.getXapiObject(id);
|
|
53
|
+
const res = req.res;
|
|
54
|
+
const response = await xapiHost.$xapi.getResource('/audit_log', { host: xapiHost });
|
|
55
|
+
const date = new Date().toISOString();
|
|
56
|
+
const headers = new Headers({
|
|
57
|
+
'Content-Type': 'application/octet-stream',
|
|
58
|
+
'Content-Disposition': `attachment; filename="${host.name_label}-${date}-audit.txt"`,
|
|
59
|
+
});
|
|
60
|
+
res.setHeaders(headers);
|
|
61
|
+
await pipeline(response.body, this.maybeCompressResponse(req, res));
|
|
62
|
+
}
|
|
42
63
|
};
|
|
43
64
|
__decorate([
|
|
44
65
|
Example(hostIds),
|
|
@@ -65,6 +86,14 @@ __decorate([
|
|
|
65
86
|
__param(0, Path()),
|
|
66
87
|
__param(1, Query())
|
|
67
88
|
], HostController.prototype, "getHostStats", null);
|
|
89
|
+
__decorate([
|
|
90
|
+
Get('{id}/audit.txt'),
|
|
91
|
+
SuccessResponse(200, 'Download started', 'application/octet-stream'),
|
|
92
|
+
Response(notFoundResp.status, notFoundResp.description),
|
|
93
|
+
Response(internalServerErrorResp.status, internalServerErrorResp.description),
|
|
94
|
+
__param(0, Request()),
|
|
95
|
+
__param(1, Path())
|
|
96
|
+
], HostController.prototype, "getAuditLog", null);
|
|
68
97
|
HostController = __decorate([
|
|
69
98
|
Route('hosts'),
|
|
70
99
|
Security('*'),
|
|
@@ -38,7 +38,7 @@ let MessageController = class MessageController extends XapiXoController {
|
|
|
38
38
|
getObject(id) {
|
|
39
39
|
const message = super.getObject(id);
|
|
40
40
|
if (alarmPredicate(message)) {
|
|
41
|
-
|
|
41
|
+
throw noSuchObject(id, 'message');
|
|
42
42
|
}
|
|
43
43
|
return message;
|
|
44
44
|
}
|
|
@@ -10,39 +10,43 @@ export default function genericErrorHandler(error, req, res, _next) {
|
|
|
10
10
|
return;
|
|
11
11
|
}
|
|
12
12
|
const responseError = { error: error.message };
|
|
13
|
+
let statusCode;
|
|
13
14
|
if (noSuchObject.is(error)) {
|
|
14
|
-
|
|
15
|
+
statusCode = 404;
|
|
15
16
|
}
|
|
16
17
|
else if (unauthorized.is(error) || forbiddenOperation.is(error)) {
|
|
17
|
-
|
|
18
|
+
statusCode = 403;
|
|
18
19
|
}
|
|
19
20
|
else if (featureUnauthorized.is(error)) {
|
|
20
|
-
|
|
21
|
+
statusCode = 403;
|
|
21
22
|
responseError.data = error.data;
|
|
22
23
|
}
|
|
23
24
|
else if (invalidCredentials.is(error)) {
|
|
24
|
-
|
|
25
|
+
statusCode = 401;
|
|
25
26
|
}
|
|
26
27
|
else if (objectAlreadyExists.is(error)) {
|
|
27
|
-
|
|
28
|
+
statusCode = 409;
|
|
28
29
|
}
|
|
29
30
|
else if (invalidParameters.is(error)) {
|
|
30
|
-
|
|
31
|
+
statusCode = 422;
|
|
31
32
|
}
|
|
32
33
|
else if (notImplemented.is(error)) {
|
|
33
|
-
|
|
34
|
+
statusCode = 501;
|
|
34
35
|
}
|
|
35
36
|
else if (incorrectState.is(error)) {
|
|
36
|
-
|
|
37
|
+
statusCode = 409;
|
|
37
38
|
responseError.data = error.data;
|
|
38
39
|
}
|
|
39
40
|
else {
|
|
40
41
|
if (error.name === 'XapiError') {
|
|
41
42
|
responseError.info = 'This is a XenServer/XCP-ng error, not an XO error';
|
|
42
43
|
}
|
|
43
|
-
|
|
44
|
+
statusCode = 500;
|
|
44
45
|
log.error(error);
|
|
45
46
|
}
|
|
46
|
-
log.info(`[${req.method}] ${req.path} (${
|
|
47
|
-
res.
|
|
47
|
+
log.info(`[${req.method}] ${req.path} (${statusCode})`);
|
|
48
|
+
if (res.headersSent) {
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
res.status(statusCode).json(responseError);
|
|
48
52
|
}
|
|
@@ -2,7 +2,7 @@ import { invalidParameters } from 'xo-common/api-errors.js';
|
|
|
2
2
|
import { ValidateError } from 'tsoa';
|
|
3
3
|
export default function tsoaToXoErrorHandler(error, _req, _res, next) {
|
|
4
4
|
if (error instanceof ValidateError) {
|
|
5
|
-
|
|
5
|
+
throw invalidParameters(error.fields);
|
|
6
6
|
}
|
|
7
7
|
return next(error);
|
|
8
8
|
}
|
|
@@ -72,3 +72,203 @@ export const importVm = { id: '9fe12ca3-d75d-cfb0-492e-cfd2bc6c568f' };
|
|
|
72
72
|
export const createVm = {
|
|
73
73
|
id: '8279e670-cb58-c048-7007-230f075becfb',
|
|
74
74
|
};
|
|
75
|
+
export const poolStats = {
|
|
76
|
+
'6278d39b-f972-43b0-a1f8-d31dc2beb923': {
|
|
77
|
+
error: {
|
|
78
|
+
code: 'HOST_OFFLINE',
|
|
79
|
+
params: ['OpaqueRef:9a9b0a02-e888-4eaf-9d8c-127cfd8e5d9e'],
|
|
80
|
+
call: {
|
|
81
|
+
duration: 158,
|
|
82
|
+
method: 'host.get_servertime',
|
|
83
|
+
params: ['* session id *', 'OpaqueRef:9a9b0a02-e888-4eaf-9d8c-127cfd8e5d9e'],
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
'0e21d25b-4487-4f63-b0d1-2d0f6bf5aa7f': {
|
|
88
|
+
endTimestamp: 1751031135,
|
|
89
|
+
interval: 5,
|
|
90
|
+
stats: {
|
|
91
|
+
memory: [
|
|
92
|
+
4286177280, 4286177280, 4286177280, 4286177280, 4286177280, 4286177280, 4286177280, 4286177280, 4286177280,
|
|
93
|
+
4286177280, 4286177280, 4286177280, 4286177280, 4286177280, 4286177280, 4286177280, 4286177280, 4286177280,
|
|
94
|
+
4286177280, 4286177280, 4286177280, 4286177280, 4286177280, 4286177280, 4286177280, 4286177280, 4286177280,
|
|
95
|
+
4286177280, 4286177280, 4286177280, 4286177280, 4286177280, 4286177280, 4286177280, 4286177280, 4286177280,
|
|
96
|
+
4286177280, 4286177280, 4286177280, 4286177280, 4286177280, 4286177280, 4286177280, 4286177280, 4286177280,
|
|
97
|
+
4286177280, 4286177280, 4286177280, 4286177280, 4286177280, 4286177280, 4286177280, 4286177280, 4286177280,
|
|
98
|
+
4286177280, 4286177280, 4286177280, 4286177280, 4286177280, 4286177280, 4286177280, 4286177280, 4286177280,
|
|
99
|
+
4286177280, 4286177280, 4286177280, 4286177280, 4286177280, 4286177280, 4286177280, 4286177280, 4286177280,
|
|
100
|
+
4286177280, 4286177280, 4286177280, 4286177280, 4286177280, 4286177280, 4286177280, 4286177280, 4286177280,
|
|
101
|
+
4286177280, 4286177280, 4286177280, 4286177280, 4286177280, 4286177280, 4286177280, 4286177280, 4286177280,
|
|
102
|
+
4286177280, 4286177280, 4286177280, 4286177280, 4286177280, 4286177280, 4286177280, 4286177280, 4286177280,
|
|
103
|
+
4286177280, 4286177280, 4286177280, 4286177280, 4286177280, 4286177280, 4286177280, 4286177280, 4286177280,
|
|
104
|
+
4286177280, 4286177280, 4286177280, 4286177280, 4286177280, 4286177280, 4286177280, 4286177280, 4286177280,
|
|
105
|
+
4286177280,
|
|
106
|
+
],
|
|
107
|
+
memoryFree: [
|
|
108
|
+
2670882816, 2670882816, 2670882816, 2670882816, 2670882816, 2670882816, 2670882816, 2670882816, 2670882816,
|
|
109
|
+
2670882816, 2670882816, 2670882816, 2670882816, 2670882816, 2670882816, 2670882816, 2670882816, 2670882816,
|
|
110
|
+
2670882816, 2670882816, 2670882816, 2670882816, 2670882816, 2670882816, 2670882816, 2670882816, 2670882816,
|
|
111
|
+
2670882816, 2670882816, 2670882816, 2670882816, 2670882816, 2670882816, 2670882816, 2670882816, 2670882816,
|
|
112
|
+
2670882816, 2670882816, 2670882816, 2670882816, 2670882816, 2670882816, 2670882816, 2670882816, 2670882816,
|
|
113
|
+
2670882816, 2670882816, 2670882816, 2670882816, 2670882816, 2670882816, 2670882816, 2670882816, 2670882816,
|
|
114
|
+
2670882816, 2670882816, 2670882816, 2670882816, 2670882816, 2670882816, 2670882816, 2670882816, 2670882816,
|
|
115
|
+
2670882816, 2670882816, 2670882816, 2670882816, 2670882816, 2670882816, 2670882816, 2670882816, 2670882816,
|
|
116
|
+
2670882816, 2670882816, 2670882816, 2670882816, 2670882816, 2670882816, 2670882816, 2670882816, 2670882816,
|
|
117
|
+
2670882816, 2670882816, 2670882816, 2670882816, 2670882816, 2670882816, 2670882816, 2670882816, 2670882816,
|
|
118
|
+
2670882816, 2670882816, 2670882816, 2670882816, 2670882816, 2670882816, 2670882816, 2670882816, 2670882816,
|
|
119
|
+
2670882816, 2670882816, 2670882816, 2670882816, 2670882816, 2670882816, 2670882816, 2670882816, 2670882816,
|
|
120
|
+
2670882816, 2670882816, 2670882816, 2670882816, 2670882816, 2670882816, 2670882816, 2670882816, 2670882816,
|
|
121
|
+
2670882816,
|
|
122
|
+
],
|
|
123
|
+
cpus: {
|
|
124
|
+
'0': [
|
|
125
|
+
10.07, 9.56, 8.88, 9.6, 10.31, 8.88, 9.36, 9.84, 10.459999999999999, 10.299999999999999, 11.48,
|
|
126
|
+
9.719999999999999, 8.35, 8.63, 9.44, 10.059999999999999, 10.34, 8.81, 8.5, 8.89, 10, 11.12,
|
|
127
|
+
12.120000000000001, 9.92, 9.21, 9.58, 9.719999999999999, 9.85, 10.979999999999999, 9.950000000000001, 10.54,
|
|
128
|
+
10.84, 10.290000000000001, 11.74, 12.18, 10.22, 8.559999999999999, 9.25, 9.53, 11.64, 15.24, 9.82, 9.78, 9.19,
|
|
129
|
+
9.71, 10.040000000000001, 11.129999999999999, 9.06, 9.28, 9.53, 9.629999999999999, 9.77, 10.96, 10.32, 9.3,
|
|
130
|
+
9.65, 14.41, 26.479999999999997, 30.159999999999997, 20.29, 17.09, 15.43, 14.37, 11.23, 10.27, 9.4,
|
|
131
|
+
8.649999999999999, 13.020000000000001, 18.86, 9.27, 11.27, 10.81, 11.23, 12.85, 11.19, 9.370000000000001,
|
|
132
|
+
10.59, 10.39, 10.82, 10.79, 14.04, 10.83, 11.83, 9.5, 9.77, 9.48, 9.59, 13.36, 20.49, 8.57, 11.03, 17.01,
|
|
133
|
+
18.05, 10.549999999999999, 13.100000000000001, 10.18, 10.38, 9.27, 10.93, 11.05, 11.59, 12.11,
|
|
134
|
+
15.459999999999999, 10.290000000000001, 11.469999999999999, 20.5, 12.36, 10.31, 9.27, 8.97, 10.51,
|
|
135
|
+
9.959999999999999, 11.4, 10.65, 8.82, 8.67, 9.93, 16.12,
|
|
136
|
+
],
|
|
137
|
+
'1': [
|
|
138
|
+
9.04, 8.57, 8.52, 9.44, 10.15, 9.790000000000001, 9.53, 9.120000000000001, 8.75, 9.47, 9.8, 8.82,
|
|
139
|
+
9.959999999999999, 10.03, 9.01, 9.36, 10.23, 10.36, 10.68, 9.62, 9.25, 9.26, 9.29, 9.34, 9.120000000000001,
|
|
140
|
+
9.139999999999999, 9.520000000000001, 9.47, 9.78, 8.09, 7.7299999999999995, 7.430000000000001, 8.35, 8.73,
|
|
141
|
+
9.85, 9.6, 9.82, 9.04, 8.93, 11.12, 14.17, 7.86, 8.59, 9.35, 8.34, 9.47, 10.620000000000001, 9.75,
|
|
142
|
+
9.629999999999999, 9.34, 9.94, 9.73, 9.86, 8.57, 9.04, 9.22, 12.24, 21.93, 21.59, 13.19, 18.529999999999998,
|
|
143
|
+
12, 11.200000000000001, 10.94, 10.26, 9.87, 9.879999999999999, 9.83, 15.18, 9.520000000000001,
|
|
144
|
+
11.129999999999999, 11.84, 11.05, 9.66, 8.18, 7.91, 10.33, 9.120000000000001, 9.3, 9.92, 15.290000000000001,
|
|
145
|
+
9.049999999999999, 9.17, 9.180000000000001, 8.37, 9.11, 9.54, 11, 18.32, 9.049999999999999, 11.51,
|
|
146
|
+
15.939999999999998, 11.08, 9.41, 10.780000000000001, 9.51, 8.37, 9.180000000000001, 9.39, 8.03, 9.85, 10.36,
|
|
147
|
+
13.98, 9.39, 9.950000000000001, 10.84, 10.280000000000001, 8.12, 9.69, 8.780000000000001, 9.69, 9.48, 9.34,
|
|
148
|
+
7.79, 9.47, 9.29, 10.7, 17.66,
|
|
149
|
+
],
|
|
150
|
+
},
|
|
151
|
+
load: [
|
|
152
|
+
0.1463, 0.1364, 0.1264, 0.1164, 0.135, 0.1729, 0.1565, 0.1465, 0.1365, 0.1265, 0.1165, 0.1065, 0.0966, 0.0866,
|
|
153
|
+
0.08, 0.0766, 0.0666, 0.06, 0.0567, 0.05, 0.0467, 0.04, 0.04, 0.0368, 0.03, 0.03, 0.03, 0.0268, 0.02, 0.02,
|
|
154
|
+
0.02, 0.02, 0.0169, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.0332, 0.1101, 0.1571, 0.1443, 0.1272,
|
|
155
|
+
0.1172, 0.1072, 0.1, 0.0972, 0.131, 0.2346, 0.2146, 0.1973, 0.1846, 0.1886, 0.2347, 0.2358, 0.2748, 0.2548,
|
|
156
|
+
0.2555, 0.2923, 0.2649, 0.245, 0.225, 0.2274, 0.2726, 0.2451, 0.2446, 0.2851, 0.2652, 0.2452, 0.2253, 0.2053,
|
|
157
|
+
0.1877, 0.1754, 0.1554, 0.156, 0.2055, 0.1855, 0.1678, 0.1578, 0.1478, 0.1356, 0.1178, 0.1079, 0.1, 0.0979,
|
|
158
|
+
0.0879, 0.0779, 0.07, 0.0843, 0.138, 0.128, 0.118, 0.108, 0.0981, 0.0881, 0.08, 0.0781, 0.07, 0.0682, 0.06,
|
|
159
|
+
0.0582, 0.05, 0.0482, 0.04, 0.04, 0.0383, 0.03, 0.03, 0.0283, 0.02, 0.033, 0.0984, 0.0884, 0.08, 0.1033,
|
|
160
|
+
],
|
|
161
|
+
pifs: {
|
|
162
|
+
rx: {
|
|
163
|
+
'0': [
|
|
164
|
+
177.1505, 146.0538, 65.197, 161.1729, 140.153, 133.3197, 95.6565, 254.4575, 622.2478, 613.8387, 154.9934,
|
|
165
|
+
124.0258, 187.5361, 198.7337, 166.6895, 197.9211, 159.0272, 138.8176, 177.7427, 138.8519, 138.6663,
|
|
166
|
+
149.9577, 156.1524, 165.8935, 173.4432, 160.3388, 233.173, 260.8957, 139.7597, 169.8137, 113.6127, 421.4655,
|
|
167
|
+
817.7339, 266.2525, 520.4689, 150.6032, 190.2794, 193.0448, 160.5704, 182.0646, 110.6279, 62.0256, 237.651,
|
|
168
|
+
297.4287, 248.6124, 124.6001, 135.1613, 127.4922, 137.3023, 186.3178, 215.8744, 176.2602, 166.0728,
|
|
169
|
+
177.0399, 122.5788, 225.3141, 622.6523, 548.8357, 122.3089, 195.4243, 276.8979, 193.8274, 190.4752,
|
|
170
|
+
156.2348, 199.6902, 156.4138, 136.0526, 149.4206, 142.098, 165.8939, 112.3953, 125.9506, 178.4714, 262.318,
|
|
171
|
+
207.2666, 200.2995, 174.3736, 205.5677, 18.7483, 97.1194, 370.3324, 917.407, 128.3314, 175.9807, 112.3198,
|
|
172
|
+
111.9657, 145.1591, 140.079, 218.2649, 214.8196, 192.7014, 175.0843, 119.3893, 121.1903, 144.0656, 188.201,
|
|
173
|
+
120.877, 157.461, 133.2787, 168.9598, 166.4183, 193.7425, 218.7006, 312.7589, 965.4944, 155.9674, 342.8991,
|
|
174
|
+
296.6323, 591.9749, 166.365, 112.7707, 167.502, 160.8092, 223.3223, 211.1992, 177.7079, 20.2051, 127.1545,
|
|
175
|
+
],
|
|
176
|
+
'1': [
|
|
177
|
+
189.4876, 116.8431, 63.3135, 181.0414, 553.2811, 838.5921, 192.277, 199.4739, 177.2014, 184.4713, 513.2862,
|
|
178
|
+
757.6664, 177.6102, 180.5172, 191.3914, 263.0015, 591.4913, 791.7061, 298.3245, 419.0697, 231.2719,
|
|
179
|
+
223.6201, 489.2033, 780.8646, 183.6428, 204.0968, 230.1329, 239.0858, 655.997, 980.0488, 180.0527, 192.8379,
|
|
180
|
+
282.7487, 656.5881, 784.7719, 183.571, 186.4121, 190.1587, 208.6954, 611.2658, 1019.4175, 55.8925, 187.4972,
|
|
181
|
+
179.731, 192.0186, 188.1511, 479.8468, 952.6181, 216.3036, 233.8062, 240.7673, 272.0145, 512.7843, 687.7659,
|
|
182
|
+
224.8852, 217.9776, 206.3708, 8436.2803, 26685.4648, 12811.7305, 10669.3057, 6786.4961, 7084.0381,
|
|
183
|
+
4580.3521, 545.4028, 864.8164, 202.1622, 505.0804, 1147.189, 452.3743, 1086.2987, 894.4191, 1005.7607,
|
|
184
|
+
2717.6548, 245.2338, 451.8658, 987.2057, 163.0364, 1074.0902, 3796.7485, 784.3134, 1258.4941, 430.8885,
|
|
185
|
+
887.2435, 218.9164, 206.8704, 191.4602, 330.3448, 809.7494, 883.0421, 194.0328, 208.9014, 484.3492,
|
|
186
|
+
1186.8184, 440.232, 987.4225, 220.3967, 218.6031, 212.9356, 246.0948, 520.4993, 1043.0072, 194.5119,
|
|
187
|
+
198.7182, 419.5035, 1362.4612, 680.6985, 555.4032, 201.996, 206.6911, 220.3556, 352.4922, 1076.2238,
|
|
188
|
+
200.6009, 189.8869, 146.8022, 27.4213, 365.4701,
|
|
189
|
+
],
|
|
190
|
+
},
|
|
191
|
+
tx: {
|
|
192
|
+
'0': [
|
|
193
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
194
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
195
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
196
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
197
|
+
],
|
|
198
|
+
'1': [
|
|
199
|
+
0, 0, 0, 0, 558.8698, 1005.7303, 6.3661, 11.6339, 0, 0, 541.6819, 1022.9182, 0, 0, 0, 0, 643.691, 1278.509,
|
|
200
|
+
0, 0, 0, 0, 516.5421, 1075.058, 0, 0, 0, 0, 766.8823, 1675.5177, 0, 0, 0, 474.9793, 1089.6207, 0, 0, 0, 0,
|
|
201
|
+
473.7006, 1144.8994, 0, 0, 0, 0, 0, 619.1703, 1591.2296, 0, 0, 0, 0, 454.2817, 1231.9594, 13.159, 0, 0,
|
|
202
|
+
54619.0508, 191640.25, 150561.125, 138005.5469, 74966.125, 85759.9531, 56211.7656, 390.0007, 1174.5992, 0,
|
|
203
|
+
400.7921, 1237.8263, 376.2454, 1520.9313, 1188.0049, 3194.2131, 10315.5859, 20.2006, 355.7656, 1181.8344, 0,
|
|
204
|
+
4256.373, 14544.3926, 454.6388, 1551.9141, 347.2362, 1200.6456, 0, 0, 0, 0, 326.7213, 1237.8787, 3.6863,
|
|
205
|
+
14.3137, 335.0124, 1330.0206, 376.2695, 1487.8975, 0, 0, 0, 0, 368.2305, 1615.5696, 0, 0, 347.7944,
|
|
206
|
+
1874.757, 1260.453, 21.7956, 0, 0, 0, 258.9554, 1305.6447, 0, 0, 0, 0, 266.3527,
|
|
207
|
+
],
|
|
208
|
+
},
|
|
209
|
+
},
|
|
210
|
+
ioThroughput: {
|
|
211
|
+
r: {
|
|
212
|
+
a152347d: [
|
|
213
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
214
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
215
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
216
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
217
|
+
],
|
|
218
|
+
},
|
|
219
|
+
w: {
|
|
220
|
+
a152347d: [
|
|
221
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
222
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
223
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
224
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
225
|
+
],
|
|
226
|
+
},
|
|
227
|
+
},
|
|
228
|
+
iops: {
|
|
229
|
+
r: {
|
|
230
|
+
a152347d: [
|
|
231
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
232
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
233
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
234
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
235
|
+
],
|
|
236
|
+
},
|
|
237
|
+
w: {
|
|
238
|
+
a152347d: [
|
|
239
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
240
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
241
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
242
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
243
|
+
],
|
|
244
|
+
},
|
|
245
|
+
},
|
|
246
|
+
iowait: {
|
|
247
|
+
a152347d: [
|
|
248
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
249
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
250
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
251
|
+
0, 0, 0, 0, 0, 0, 0,
|
|
252
|
+
],
|
|
253
|
+
},
|
|
254
|
+
latency: {
|
|
255
|
+
r: {
|
|
256
|
+
a152347d: [
|
|
257
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
258
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
259
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
260
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
261
|
+
],
|
|
262
|
+
},
|
|
263
|
+
w: {
|
|
264
|
+
a152347d: [
|
|
265
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
266
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
267
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
268
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
269
|
+
],
|
|
270
|
+
},
|
|
271
|
+
},
|
|
272
|
+
},
|
|
273
|
+
},
|
|
274
|
+
};
|
|
@@ -121,19 +121,34 @@ const models = {
|
|
|
121
121
|
"type": { "dataType": "nestedObjectLiteral", "nestedProperties": { "$pool": { "dataType": "string", "required": true }, "$poolId": { "dataType": "string", "required": true }, "_xapiRef": { "dataType": "string", "required": true }, "uuid": { "dataType": "string", "required": true }, "$VBDs": { "dataType": "array", "array": { "dataType": "string" }, "required": true }, "$VGPUs": { "dataType": "array", "array": { "dataType": "string" }, "required": true }, "$container": { "dataType": "string", "required": true }, "CPUs": { "dataType": "nestedObjectLiteral", "nestedProperties": { "number": { "dataType": "double", "required": true }, "max": { "dataType": "double", "required": true } }, "required": true }, "PV_args": { "dataType": "union", "subSchemas": [{ "dataType": "string" }, { "dataType": "undefined" }] }, "VGPUs": { "dataType": "array", "array": { "dataType": "string" }, "required": true }, "VIFs": { "dataType": "array", "array": { "dataType": "string" }, "required": true }, "VTPMs": { "dataType": "array", "array": { "dataType": "string" }, "required": true }, "addresses": { "ref": "Record_string.string_", "required": true }, "affinityHost": { "dataType": "union", "subSchemas": [{ "dataType": "string" }, { "dataType": "undefined" }] }, "attachedPcis": { "dataType": "union", "subSchemas": [{ "dataType": "array", "array": { "dataType": "string" } }, { "dataType": "undefined" }] }, "auto_poweron": { "dataType": "boolean", "required": true }, "bios_strings": { "ref": "Record_string.string_", "required": true }, "blockedOperations": { "ref": "Record_VM_OPERATIONS.string_", "required": true }, "boot": { "ref": "Record_string.string_", "required": true }, "coresPerSocket": { "dataType": "union", "subSchemas": [{ "dataType": "double" }, { "dataType": "undefined" }] }, "cpuCap": { "dataType": "union", "subSchemas": [{ "dataType": "double" }, { "dataType": "undefined" }] }, "cpuMask": { "dataType": "union", "subSchemas": [{ "dataType": "array", "array": { "dataType": "double" } }, { "dataType": "undefined" }] }, "cpuWeight": { "dataType": "union", "subSchemas": [{ "dataType": "double" }, { "dataType": "undefined" }] }, "creation": { "ref": "Record_string.string_", "required": true }, "current_operations": { "ref": "Record_string.VM_OPERATIONS_", "required": true }, "docker": { "dataType": "union", "subSchemas": [{ "dataType": "nestedObjectLiteral", "nestedProperties": { "version": { "dataType": "union", "subSchemas": [{ "dataType": "string" }, { "dataType": "undefined" }] }, "process": { "dataType": "union", "subSchemas": [{ "dataType": "string" }, { "dataType": "undefined" }] }, "info": { "dataType": "union", "subSchemas": [{ "dataType": "string" }, { "dataType": "undefined" }] }, "enabled": { "dataType": "boolean", "required": true }, "containers": { "dataType": "union", "subSchemas": [{ "dataType": "array", "array": { "dataType": "string" } }, { "dataType": "undefined" }] } } }, { "dataType": "undefined" }] }, "expNestedHvm": { "dataType": "boolean", "required": true }, "isNestedVirtEnabled": { "dataType": "boolean", "required": true }, "hasVendorDevice": { "dataType": "boolean", "required": true }, "high_availability": { "dataType": "string", "required": true }, "installTime": { "dataType": "union", "subSchemas": [{ "dataType": "double" }, { "dataType": "enum", "enums": [null] }, { "dataType": "undefined" }] }, "isFirmwareSupported": { "dataType": "boolean", "required": true }, "memory": { "dataType": "nestedObjectLiteral", "nestedProperties": { "usage": { "dataType": "union", "subSchemas": [{ "dataType": "double" }, { "dataType": "undefined" }] }, "static": { "dataType": "array", "array": { "dataType": "double" }, "required": true }, "size": { "dataType": "double", "required": true }, "dynamic": { "dataType": "array", "array": { "dataType": "double" }, "required": true } }, "required": true }, "mainIpAddress": { "dataType": "union", "subSchemas": [{ "dataType": "string" }, { "dataType": "undefined" }] }, "managementAgentDetected": { "dataType": "union", "subSchemas": [{ "dataType": "boolean" }, { "dataType": "undefined" }] }, "name_description": { "dataType": "string", "required": true }, "name_label": { "dataType": "string", "required": true }, "needsVtpm": { "dataType": "boolean", "required": true }, "nicType": { "dataType": "union", "subSchemas": [{ "dataType": "string" }, { "dataType": "undefined" }] }, "notes": { "dataType": "union", "subSchemas": [{ "dataType": "string" }, { "dataType": "undefined" }] }, "os_version": { "dataType": "union", "subSchemas": [{ "ref": "Record_string.string_" }, { "dataType": "enum", "enums": [null] }], "required": true }, "other": { "ref": "Record_string.string_", "required": true }, "parent": { "dataType": "union", "subSchemas": [{ "dataType": "string" }, { "dataType": "undefined" }] }, "power_state": { "ref": "VM_POWER_STATE", "required": true }, "pvDriversDetected": { "dataType": "union", "subSchemas": [{ "dataType": "boolean" }, { "dataType": "undefined" }] }, "pvDriversUpToDate": { "dataType": "union", "subSchemas": [{ "dataType": "boolean" }, { "dataType": "undefined" }] }, "pvDriversVersion": { "dataType": "union", "subSchemas": [{ "dataType": "string" }, { "dataType": "undefined" }] }, "resourceSet": { "dataType": "union", "subSchemas": [{ "dataType": "string" }, { "dataType": "undefined" }] }, "secureBoot": { "dataType": "boolean", "required": true }, "snapshots": { "dataType": "array", "array": { "dataType": "string" }, "required": true }, "startDelay": { "dataType": "double", "required": true }, "startTime": { "dataType": "union", "subSchemas": [{ "dataType": "double" }, { "dataType": "enum", "enums": [null] }, { "dataType": "undefined" }] }, "suspendSr": { "dataType": "union", "subSchemas": [{ "dataType": "string" }, { "dataType": "undefined" }] }, "tags": { "dataType": "array", "array": { "dataType": "string" }, "required": true }, "vga": { "dataType": "union", "subSchemas": [{ "dataType": "string" }, { "dataType": "undefined" }] }, "videoram": { "dataType": "union", "subSchemas": [{ "dataType": "double" }, { "dataType": "undefined" }] }, "viridian": { "dataType": "boolean", "required": true }, "virtualizationMode": { "ref": "DOMAIN_TYPE", "required": true }, "xenStoreData": { "ref": "Record_string.string_", "required": true }, "xentools": { "dataType": "union", "subSchemas": [{ "dataType": "enum", "enums": [false] }, { "dataType": "nestedObjectLiteral", "nestedProperties": { "version": { "dataType": "union", "subSchemas": [{ "dataType": "string" }, { "dataType": "enum", "enums": [null] }], "required": true }, "minor": { "dataType": "union", "subSchemas": [{ "dataType": "double" }, { "dataType": "enum", "enums": [null] }], "required": true }, "major": { "dataType": "union", "subSchemas": [{ "dataType": "double" }, { "dataType": "enum", "enums": [null] }], "required": true } } }, { "dataType": "undefined" }] }, "id": { "dataType": "string", "required": true }, "type": { "dataType": "enum", "enums": ["VM"], "required": true }, "vulnerabilities": { "dataType": "nestedObjectLiteral", "nestedProperties": { "xsa468": { "dataType": "union", "subSchemas": [{ "dataType": "boolean" }, { "dataType": "nestedObjectLiteral", "nestedProperties": { "version": { "dataType": "union", "subSchemas": [{ "dataType": "string" }, { "dataType": "undefined" }] }, "driver": { "dataType": "union", "subSchemas": [{ "dataType": "string" }, { "dataType": "undefined" }] }, "reason": { "dataType": "string", "required": true } } }], "required": true } }, "required": true } }, "validators": {} },
|
|
122
122
|
},
|
|
123
123
|
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
|
|
124
|
-
"
|
|
124
|
+
"StatValues": {
|
|
125
125
|
"dataType": "refAlias",
|
|
126
|
-
"type": { "dataType": "
|
|
126
|
+
"type": { "dataType": "array", "array": { "dataType": "union", "subSchemas": [{ "dataType": "double" }, { "dataType": "enum", "enums": [null] }] }, "validators": {} },
|
|
127
127
|
},
|
|
128
128
|
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
|
|
129
|
-
"
|
|
129
|
+
"Record_string.StatValues_": {
|
|
130
130
|
"dataType": "refAlias",
|
|
131
|
-
"type": { "dataType": "nestedObjectLiteral", "nestedProperties": {
|
|
131
|
+
"type": { "dataType": "nestedObjectLiteral", "nestedProperties": {}, "additionalProperties": { "ref": "StatValues" }, "validators": {} },
|
|
132
|
+
},
|
|
133
|
+
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
|
|
134
|
+
"RecordStatValues": {
|
|
135
|
+
"dataType": "refAlias",
|
|
136
|
+
"type": { "ref": "Record_string.StatValues_", "validators": {} },
|
|
137
|
+
},
|
|
138
|
+
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
|
|
139
|
+
"XapiVmStatsRaw": {
|
|
140
|
+
"dataType": "refAlias",
|
|
141
|
+
"type": { "dataType": "nestedObjectLiteral", "nestedProperties": { "vbdAvgquSz": { "ref": "RecordStatValues" }, "vbdInflight": { "ref": "RecordStatValues" }, "vbdIowait": { "ref": "RecordStatValues" }, "vbdLatency": { "dataType": "nestedObjectLiteral", "nestedProperties": { "r": { "ref": "RecordStatValues", "required": true }, "w": { "ref": "RecordStatValues", "required": true } } }, "xvds": { "dataType": "nestedObjectLiteral", "nestedProperties": { "total": { "ref": "RecordStatValues" }, "r": { "ref": "RecordStatValues" }, "w": { "ref": "RecordStatValues" } } }, "vifErrors": { "dataType": "nestedObjectLiteral", "nestedProperties": { "tx": { "ref": "RecordStatValues", "required": true }, "rx": { "ref": "RecordStatValues", "required": true } } }, "vifs": { "dataType": "nestedObjectLiteral", "nestedProperties": { "tx": { "ref": "RecordStatValues", "required": true }, "rx": { "ref": "RecordStatValues", "required": true } } }, "memoryTarget": { "ref": "StatValues" }, "memoryFree": { "ref": "StatValues" }, "memory": { "ref": "StatValues" }, "iops": { "dataType": "nestedObjectLiteral", "nestedProperties": { "w": { "ref": "RecordStatValues", "required": true }, "r": { "ref": "RecordStatValues", "required": true } } }, "runstateBlocked": { "ref": "StatValues" }, "runstateConcurrencyHazard": { "ref": "StatValues" }, "runstatePartialContention": { "ref": "StatValues" }, "runstatePartialRun": { "ref": "StatValues" }, "runstateFullContention": { "ref": "StatValues" }, "runstateFullrun": { "ref": "StatValues" }, "cpuUsage": { "ref": "StatValues" }, "cpus": { "ref": "RecordStatValues" } }, "validators": {} },
|
|
142
|
+
},
|
|
143
|
+
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
|
|
144
|
+
"XapiStatsResponse_XapiVmStatsRaw_": {
|
|
145
|
+
"dataType": "refAlias",
|
|
146
|
+
"type": { "dataType": "nestedObjectLiteral", "nestedProperties": { "stats": { "ref": "XapiVmStatsRaw", "required": true }, "interval": { "dataType": "double", "required": true }, "endTimestamp": { "dataType": "double", "required": true } }, "validators": {} },
|
|
132
147
|
},
|
|
133
148
|
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
|
|
134
149
|
"XapiVmStats": {
|
|
135
150
|
"dataType": "refAlias",
|
|
136
|
-
"type": { "ref": "
|
|
151
|
+
"type": { "ref": "XapiStatsResponse_XapiVmStatsRaw_", "validators": {} },
|
|
137
152
|
},
|
|
138
153
|
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
|
|
139
154
|
"XapiStatsGranularity": {
|
|
@@ -472,6 +487,31 @@ const models = {
|
|
|
472
487
|
"type": { "dataType": "nestedObjectLiteral", "nestedProperties": { "name_label": { "dataType": "string", "required": true }, "clone": { "dataType": "union", "subSchemas": [{ "dataType": "boolean" }, { "dataType": "undefined" }] }, "vifs": { "dataType": "union", "subSchemas": [{ "dataType": "array", "array": { "dataType": "union", "subSchemas": [{ "dataType": "nestedObjectLiteral", "nestedProperties": { "network": { "dataType": "string", "required": true }, "mtu": { "dataType": "union", "subSchemas": [{ "dataType": "double" }, { "dataType": "undefined" }] }, "mac": { "dataType": "union", "subSchemas": [{ "dataType": "string" }, { "dataType": "undefined" }] }, "ipv6_allowed": { "dataType": "union", "subSchemas": [{ "dataType": "array", "array": { "dataType": "string" } }, { "dataType": "undefined" }] }, "ipv4_allowed": { "dataType": "union", "subSchemas": [{ "dataType": "array", "array": { "dataType": "string" } }, { "dataType": "undefined" }] }, "device": { "dataType": "union", "subSchemas": [{ "dataType": "string" }, { "dataType": "undefined" }] } } }, { "dataType": "nestedObjectLiteral", "nestedProperties": { "device": { "dataType": "string", "required": true }, "destroy": { "dataType": "enum", "enums": [true], "required": true } } }] } }, { "dataType": "undefined" }] }, "vgpuType": { "dataType": "union", "subSchemas": [{ "dataType": "string" }, { "dataType": "undefined" }] }, "gpuGroup": { "dataType": "union", "subSchemas": [{ "dataType": "string" }, { "dataType": "undefined" }] }, "copyHostBiosStrings": { "dataType": "union", "subSchemas": [{ "dataType": "boolean" }, { "dataType": "undefined" }] }, "template": { "dataType": "string", "required": true }, "affinity": { "dataType": "union", "subSchemas": [{ "dataType": "string" }, { "dataType": "undefined" }] }, "vdis": { "dataType": "union", "subSchemas": [{ "dataType": "array", "array": { "dataType": "union", "subSchemas": [{ "dataType": "nestedObjectLiteral", "nestedProperties": { "name_description": { "dataType": "union", "subSchemas": [{ "dataType": "string" }, { "dataType": "undefined" }] }, "sr": { "dataType": "union", "subSchemas": [{ "dataType": "string" }, { "dataType": "undefined" }] }, "size": { "dataType": "double", "required": true }, "name_label": { "dataType": "string", "required": true } } }, { "dataType": "nestedObjectLiteral", "nestedProperties": { "name_description": { "dataType": "union", "subSchemas": [{ "dataType": "string" }, { "dataType": "undefined" }] }, "sr": { "dataType": "union", "subSchemas": [{ "dataType": "string" }, { "dataType": "undefined" }] }, "size": { "dataType": "union", "subSchemas": [{ "dataType": "double" }, { "dataType": "undefined" }] }, "name_label": { "dataType": "union", "subSchemas": [{ "dataType": "string" }, { "dataType": "undefined" }] }, "userdevice": { "dataType": "string", "required": true } } }, { "dataType": "nestedObjectLiteral", "nestedProperties": { "userdervice": { "dataType": "string", "required": true }, "destroy": { "dataType": "enum", "enums": [true], "required": true } } }] } }, { "dataType": "undefined" }] }, "install": { "dataType": "union", "subSchemas": [{ "dataType": "nestedObjectLiteral", "nestedProperties": { "repository": { "dataType": "string", "required": true }, "method": { "dataType": "union", "subSchemas": [{ "dataType": "enum", "enums": ["network"] }, { "dataType": "enum", "enums": ["cdrom"] }], "required": true } } }, { "dataType": "undefined" }] }, "cloud_config": { "dataType": "union", "subSchemas": [{ "dataType": "string" }, { "dataType": "undefined" }] }, "network_config": { "dataType": "union", "subSchemas": [{ "dataType": "string" }, { "dataType": "undefined" }] }, "boot": { "dataType": "union", "subSchemas": [{ "dataType": "boolean" }, { "dataType": "undefined" }] }, "destroy_cloud_config_vdi": { "dataType": "union", "subSchemas": [{ "dataType": "boolean" }, { "dataType": "undefined" }] } }, "validators": {} },
|
|
473
488
|
},
|
|
474
489
|
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
|
|
490
|
+
"XapiHostStatsRaw": {
|
|
491
|
+
"dataType": "refAlias",
|
|
492
|
+
"type": { "dataType": "nestedObjectLiteral", "nestedProperties": { "pifs": { "dataType": "nestedObjectLiteral", "nestedProperties": { "tx": { "ref": "RecordStatValues", "required": true }, "rx": { "ref": "RecordStatValues", "required": true } } }, "memoryFree": { "ref": "StatValues" }, "memory": { "ref": "StatValues" }, "load": { "ref": "StatValues" }, "latency": { "dataType": "nestedObjectLiteral", "nestedProperties": { "w": { "ref": "RecordStatValues", "required": true }, "r": { "ref": "RecordStatValues", "required": true } } }, "iowait": { "ref": "RecordStatValues" }, "iops": { "dataType": "nestedObjectLiteral", "nestedProperties": { "w": { "ref": "RecordStatValues", "required": true }, "r": { "ref": "RecordStatValues", "required": true } } }, "ioThroughput": { "dataType": "nestedObjectLiteral", "nestedProperties": { "w": { "ref": "RecordStatValues", "required": true }, "r": { "ref": "RecordStatValues", "required": true } } }, "cpus": { "ref": "RecordStatValues" } }, "validators": {} },
|
|
493
|
+
},
|
|
494
|
+
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
|
|
495
|
+
"XapiStatsResponse_XapiHostStatsRaw_": {
|
|
496
|
+
"dataType": "refAlias",
|
|
497
|
+
"type": { "dataType": "nestedObjectLiteral", "nestedProperties": { "stats": { "ref": "XapiHostStatsRaw", "required": true }, "interval": { "dataType": "double", "required": true }, "endTimestamp": { "dataType": "double", "required": true } }, "validators": {} },
|
|
498
|
+
},
|
|
499
|
+
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
|
|
500
|
+
"XapiHostStats": {
|
|
501
|
+
"dataType": "refAlias",
|
|
502
|
+
"type": { "ref": "XapiStatsResponse_XapiHostStatsRaw_", "validators": {} },
|
|
503
|
+
},
|
|
504
|
+
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
|
|
505
|
+
"Record_XoHost-at-id.XapiHostStats-or-_error-Record_string.unknown___": {
|
|
506
|
+
"dataType": "refAlias",
|
|
507
|
+
"type": { "dataType": "nestedObjectLiteral", "nestedProperties": {}, "additionalProperties": { "dataType": "union", "subSchemas": [{ "ref": "XapiHostStats" }, { "dataType": "nestedObjectLiteral", "nestedProperties": { "error": { "ref": "Record_string.unknown_", "required": true } } }] }, "validators": {} },
|
|
508
|
+
},
|
|
509
|
+
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
|
|
510
|
+
"XapiPoolStats": {
|
|
511
|
+
"dataType": "refAlias",
|
|
512
|
+
"type": { "ref": "Record_XoHost-at-id.XapiHostStats-or-_error-Record_string.unknown___", "validators": {} },
|
|
513
|
+
},
|
|
514
|
+
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
|
|
475
515
|
"Branded_PIF_": {
|
|
476
516
|
"dataType": "refAlias",
|
|
477
517
|
"type": { "dataType": "intersection", "subSchemas": [{ "dataType": "string" }, { "dataType": "nestedObjectLiteral", "nestedProperties": { "undefined": { "dataType": "enum", "enums": ["PIF"], "required": true } } }], "validators": {} },
|
|
@@ -677,16 +717,6 @@ const models = {
|
|
|
677
717
|
"type": { "dataType": "nestedObjectLiteral", "nestedProperties": { "$pool": { "dataType": "string", "required": true }, "$poolId": { "dataType": "string", "required": true }, "_xapiRef": { "dataType": "string", "required": true }, "uuid": { "dataType": "string", "required": true }, "$PBDs": { "dataType": "array", "array": { "dataType": "string" }, "required": true }, "$PCIs": { "dataType": "array", "array": { "dataType": "string" }, "required": true }, "$PGPUs": { "dataType": "array", "array": { "dataType": "string" }, "required": true }, "$PIFs": { "dataType": "array", "array": { "dataType": "string" }, "required": true }, "PCIs": { "dataType": "array", "array": { "dataType": "string" }, "required": true }, "PGPUs": { "dataType": "array", "array": { "dataType": "string" }, "required": true }, "PIFs": { "dataType": "array", "array": { "dataType": "string" }, "required": true }, "CPUs": { "ref": "Record_string.string_", "required": true }, "address": { "dataType": "string", "required": true }, "agentStartTime": { "dataType": "union", "subSchemas": [{ "dataType": "double" }, { "dataType": "enum", "enums": [null] }], "required": true }, "bios_string": { "ref": "Record_string.string_", "required": true }, "build": { "dataType": "string", "required": true }, "certificates": { "dataType": "union", "subSchemas": [{ "dataType": "array", "array": { "dataType": "nestedObjectLiteral", "nestedProperties": { "notAfter": { "dataType": "double", "required": true }, "fingerprint": { "dataType": "string", "required": true } } } }, { "dataType": "undefined" }] }, "chipset_info": { "dataType": "nestedObjectLiteral", "nestedProperties": { "iommu": { "dataType": "union", "subSchemas": [{ "dataType": "boolean" }, { "dataType": "undefined" }] } }, "required": true }, "controlDomain": { "dataType": "union", "subSchemas": [{ "dataType": "string" }, { "dataType": "undefined" }] }, "cpus": { "dataType": "nestedObjectLiteral", "nestedProperties": { "sockets": { "dataType": "union", "subSchemas": [{ "dataType": "double" }, { "dataType": "undefined" }] }, "cores": { "dataType": "union", "subSchemas": [{ "dataType": "double" }, { "dataType": "undefined" }] } }, "required": true }, "current_operations": { "ref": "Record_string.HOST_ALLOWED_OPERATIONS_", "required": true }, "enabled": { "dataType": "boolean", "required": true }, "hostname": { "dataType": "string", "required": true }, "hvmCapable": { "dataType": "boolean", "required": true }, "id": { "dataType": "string", "required": true }, "iscsiIqn": { "dataType": "string", "required": true }, "license_expiry": { "dataType": "union", "subSchemas": [{ "dataType": "double" }, { "dataType": "enum", "enums": [null] }], "required": true }, "license_params": { "ref": "Record_string.string_", "required": true }, "license_server": { "ref": "Record_string.string_", "required": true }, "logging": { "ref": "Record_string.string_", "required": true }, "memory": { "dataType": "nestedObjectLiteral", "nestedProperties": { "usage": { "dataType": "double", "required": true }, "total": { "dataType": "union", "subSchemas": [{ "dataType": "double" }, { "dataType": "undefined" }] }, "size": { "dataType": "double", "required": true } }, "required": true }, "multipathing": { "dataType": "boolean", "required": true }, "name_description": { "dataType": "string", "required": true }, "name_label": { "dataType": "string", "required": true }, "otherConfig": { "ref": "Record_string.string_", "required": true }, "patches": { "dataType": "array", "array": { "dataType": "string" }, "required": true }, "power_state": { "ref": "HOST_POWER_STATE", "required": true }, "powerOnMode": { "dataType": "string", "required": true }, "productBrand": { "dataType": "string", "required": true }, "rebootRequired": { "dataType": "boolean", "required": true }, "residentVms": { "dataType": "array", "array": { "dataType": "string" }, "required": true }, "startTime": { "dataType": "union", "subSchemas": [{ "dataType": "double" }, { "dataType": "enum", "enums": [null] }], "required": true }, "supplementalPacks": { "dataType": "union", "subSchemas": [{ "dataType": "array", "array": { "dataType": "nestedObjectLiteral", "nestedProperties": { "vdi": { "ref": "Branded_VDI_", "required": true }, "version": { "dataType": "string", "required": true }, "size": { "dataType": "double", "required": true }, "name": { "dataType": "string", "required": true }, "hosts": { "dataType": "array", "array": { "dataType": "refAlias", "ref": "Branded_host_" }, "required": true }, "guidance": { "dataType": "string", "required": true }, "description": { "dataType": "string", "required": true }, "author": { "dataType": "string", "required": true } } } }, { "dataType": "array", "array": { "dataType": "nestedObjectLiteral", "nestedProperties": { "version": { "dataType": "string", "required": true }, "name": { "dataType": "string", "required": true }, "description": { "dataType": "string", "required": true }, "author": { "dataType": "string", "required": true } } } }], "required": true }, "tags": { "dataType": "array", "array": { "dataType": "string" }, "required": true }, "type": { "dataType": "enum", "enums": ["host"], "required": true }, "version": { "dataType": "string", "required": true }, "zstdSupported": { "dataType": "boolean", "required": true } }, "validators": {} },
|
|
678
718
|
},
|
|
679
719
|
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
|
|
680
|
-
"XapiStatsResponse__cpus_63_-Record_string.number-Array_--ioThroughput_63__58__r-Record_string.number-Array_--w-Record_string.number-Array__--iops_63__58__r-Record_string.number-Array_--w-Record_string.number-Array__--iowait_63_-Record_string.number-Array_--latency_63__58__r-Record_string.number-Array_--w-Record_string.number-Array__--load_63_-number-Array--memory_63_-number-Array--memoryFree_63_-number-Array--pifs_63__58__rx-Record_string.number-Array_--tx-Record_string.number-Array____": {
|
|
681
|
-
"dataType": "refAlias",
|
|
682
|
-
"type": { "dataType": "nestedObjectLiteral", "nestedProperties": { "stats": { "dataType": "nestedObjectLiteral", "nestedProperties": { "pifs": { "dataType": "nestedObjectLiteral", "nestedProperties": { "tx": { "ref": "Record_string.number-Array_", "required": true }, "rx": { "ref": "Record_string.number-Array_", "required": true } } }, "memoryFree": { "dataType": "array", "array": { "dataType": "double" } }, "memory": { "dataType": "array", "array": { "dataType": "double" } }, "load": { "dataType": "array", "array": { "dataType": "double" } }, "latency": { "dataType": "nestedObjectLiteral", "nestedProperties": { "w": { "ref": "Record_string.number-Array_", "required": true }, "r": { "ref": "Record_string.number-Array_", "required": true } } }, "iowait": { "ref": "Record_string.number-Array_" }, "iops": { "dataType": "nestedObjectLiteral", "nestedProperties": { "w": { "ref": "Record_string.number-Array_", "required": true }, "r": { "ref": "Record_string.number-Array_", "required": true } } }, "ioThroughput": { "dataType": "nestedObjectLiteral", "nestedProperties": { "w": { "ref": "Record_string.number-Array_", "required": true }, "r": { "ref": "Record_string.number-Array_", "required": true } } }, "cpus": { "ref": "Record_string.number-Array_" } }, "required": true }, "interval": { "dataType": "double", "required": true }, "endTimestamp": { "dataType": "double", "required": true } }, "validators": {} },
|
|
683
|
-
},
|
|
684
|
-
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
|
|
685
|
-
"XapiHostStats": {
|
|
686
|
-
"dataType": "refAlias",
|
|
687
|
-
"type": { "ref": "XapiStatsResponse__cpus_63_-Record_string.number-Array_--ioThroughput_63__58__r-Record_string.number-Array_--w-Record_string.number-Array__--iops_63__58__r-Record_string.number-Array_--w-Record_string.number-Array__--iowait_63_-Record_string.number-Array_--latency_63__58__r-Record_string.number-Array_--w-Record_string.number-Array__--load_63_-number-Array--memory_63_-number-Array--memoryFree_63_-number-Array--pifs_63__58__rx-Record_string.number-Array_--tx-Record_string.number-Array____", "validators": {} },
|
|
688
|
-
},
|
|
689
|
-
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
|
|
690
720
|
"Partial_Unbrand_XoGroup__": {
|
|
691
721
|
"dataType": "refAlias",
|
|
692
722
|
"type": { "dataType": "nestedObjectLiteral", "nestedProperties": { "id": { "dataType": "union", "subSchemas": [{ "dataType": "string" }, { "dataType": "undefined" }] }, "name": { "dataType": "union", "subSchemas": [{ "dataType": "string" }, { "dataType": "undefined" }] }, "provider": { "dataType": "union", "subSchemas": [{ "dataType": "string" }, { "dataType": "undefined" }] }, "providerGroupId": { "dataType": "union", "subSchemas": [{ "dataType": "string" }, { "dataType": "undefined" }] }, "users": { "dataType": "union", "subSchemas": [{ "dataType": "array", "array": { "dataType": "string" } }, { "dataType": "undefined" }] } }, "validators": {} },
|
|
@@ -2230,6 +2260,34 @@ export function RegisterRoutes(app) {
|
|
|
2230
2260
|
}
|
|
2231
2261
|
});
|
|
2232
2262
|
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
|
|
2263
|
+
const argsPoolController_getStats = {
|
|
2264
|
+
id: { "in": "path", "name": "id", "required": true, "dataType": "string" },
|
|
2265
|
+
granularity: { "in": "query", "name": "granularity", "ref": "XapiStatsGranularity" },
|
|
2266
|
+
};
|
|
2267
|
+
app.get('/rest/v0/pools/:id/stats', authenticateMiddleware([{ "*": [] }]), ...(fetchMiddlewares(PoolController)), ...(fetchMiddlewares(PoolController.prototype.getStats)), async function PoolController_getStats(request, response, next) {
|
|
2268
|
+
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
|
|
2269
|
+
let validatedArgs = [];
|
|
2270
|
+
try {
|
|
2271
|
+
validatedArgs = templateService.getValidatedArgs({ args: argsPoolController_getStats, request, response });
|
|
2272
|
+
const container = typeof iocContainer === 'function' ? iocContainer(request) : iocContainer;
|
|
2273
|
+
const controller = await container.get(PoolController);
|
|
2274
|
+
if (typeof controller['setStatus'] === 'function') {
|
|
2275
|
+
controller.setStatus(undefined);
|
|
2276
|
+
}
|
|
2277
|
+
await templateService.apiHandler({
|
|
2278
|
+
methodName: 'getStats',
|
|
2279
|
+
controller,
|
|
2280
|
+
response,
|
|
2281
|
+
next,
|
|
2282
|
+
validatedArgs,
|
|
2283
|
+
successStatus: undefined,
|
|
2284
|
+
});
|
|
2285
|
+
}
|
|
2286
|
+
catch (err) {
|
|
2287
|
+
return next(err);
|
|
2288
|
+
}
|
|
2289
|
+
});
|
|
2290
|
+
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
|
|
2233
2291
|
const argsPifController_getPifs = {
|
|
2234
2292
|
req: { "in": "request", "name": "req", "required": true, "dataType": "object" },
|
|
2235
2293
|
fields: { "in": "query", "name": "fields", "dataType": "string" },
|
|
@@ -2691,6 +2749,34 @@ export function RegisterRoutes(app) {
|
|
|
2691
2749
|
}
|
|
2692
2750
|
});
|
|
2693
2751
|
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
|
|
2752
|
+
const argsHostController_getAuditLog = {
|
|
2753
|
+
req: { "in": "request", "name": "req", "required": true, "dataType": "object" },
|
|
2754
|
+
id: { "in": "path", "name": "id", "required": true, "dataType": "string" },
|
|
2755
|
+
};
|
|
2756
|
+
app.get('/rest/v0/hosts/:id/audit.txt', authenticateMiddleware([{ "*": [] }]), ...(fetchMiddlewares(HostController)), ...(fetchMiddlewares(HostController.prototype.getAuditLog)), async function HostController_getAuditLog(request, response, next) {
|
|
2757
|
+
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
|
|
2758
|
+
let validatedArgs = [];
|
|
2759
|
+
try {
|
|
2760
|
+
validatedArgs = templateService.getValidatedArgs({ args: argsHostController_getAuditLog, request, response });
|
|
2761
|
+
const container = typeof iocContainer === 'function' ? iocContainer(request) : iocContainer;
|
|
2762
|
+
const controller = await container.get(HostController);
|
|
2763
|
+
if (typeof controller['setStatus'] === 'function') {
|
|
2764
|
+
controller.setStatus(undefined);
|
|
2765
|
+
}
|
|
2766
|
+
await templateService.apiHandler({
|
|
2767
|
+
methodName: 'getAuditLog',
|
|
2768
|
+
controller,
|
|
2769
|
+
response,
|
|
2770
|
+
next,
|
|
2771
|
+
validatedArgs,
|
|
2772
|
+
successStatus: 200,
|
|
2773
|
+
});
|
|
2774
|
+
}
|
|
2775
|
+
catch (err) {
|
|
2776
|
+
return next(err);
|
|
2777
|
+
}
|
|
2778
|
+
});
|
|
2779
|
+
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
|
|
2694
2780
|
const argsGroupController_getGroups = {
|
|
2695
2781
|
req: { "in": "request", "name": "req", "required": true, "dataType": "object" },
|
|
2696
2782
|
fields: { "in": "query", "name": "fields", "dataType": "string" },
|