@xen-orchestra/rest-api 0.10.0 → 0.12.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.
Files changed (33) hide show
  1. package/dist/abstract-classes/base-controller.mjs +24 -2
  2. package/dist/alarms/alarm.controller.mjs +11 -61
  3. package/dist/alarms/alarm.service.mjs +67 -0
  4. package/dist/backup-repositories/backup-repositories.controller.mjs +61 -0
  5. package/dist/groups/group.controller.mjs +15 -2
  6. package/dist/helpers/object-wrapper.helper.mjs +8 -1
  7. package/dist/helpers/utils.helper.mjs +74 -1
  8. package/dist/hosts/host.controller.mjs +87 -3
  9. package/dist/hosts/host.service.mjs +78 -0
  10. package/dist/ioc/ioc.mjs +25 -1
  11. package/dist/messages/message.controller.mjs +2 -2
  12. package/dist/middlewares/generic-error-handler.middleware.mjs +15 -11
  13. package/dist/middlewares/tsoa-to-xo-error.middleware.mjs +1 -1
  14. package/dist/networks/network.controller.mjs +34 -2
  15. package/dist/open-api/oa-examples/alarm.oa-example.mjs +12 -0
  16. package/dist/open-api/oa-examples/backup-repository.oa-example.mjs +31 -0
  17. package/dist/open-api/oa-examples/pool.oa-example.mjs +401 -0
  18. package/dist/open-api/oa-examples/user.oa-example.mjs +1 -0
  19. package/dist/open-api/routes/routes.js +708 -113
  20. package/dist/pifs/pif.controller.mjs +34 -2
  21. package/dist/pools/pool.controller.mjs +84 -3
  22. package/dist/pools/pool.service.mjs +212 -0
  23. package/dist/rest-api/rest-api.mjs +6 -1
  24. package/dist/srs/sr.controller.mjs +34 -2
  25. package/dist/users/user.controller.mjs +32 -3
  26. package/dist/vdi-snapshots/vdi-snapshot.controller.mjs +34 -2
  27. package/dist/vdis/vdi.controller.mjs +34 -2
  28. package/dist/vm-templates/vm-template.controller.mjs +34 -2
  29. package/dist/vms/vm.controller.mjs +1 -1
  30. package/dist/vms/vm.service.mjs +40 -0
  31. package/dist/xoa/xoa.service.mjs +96 -110
  32. package/open-api/spec/swagger.json +6069 -1899
  33. package/package.json +3 -3
@@ -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
- res.status(404);
15
+ statusCode = 404;
15
16
  }
16
17
  else if (unauthorized.is(error) || forbiddenOperation.is(error)) {
17
- res.status(403);
18
+ statusCode = 403;
18
19
  }
19
20
  else if (featureUnauthorized.is(error)) {
20
- res.status(403);
21
+ statusCode = 403;
21
22
  responseError.data = error.data;
22
23
  }
23
24
  else if (invalidCredentials.is(error)) {
24
- res.status(401);
25
+ statusCode = 401;
25
26
  }
26
27
  else if (objectAlreadyExists.is(error)) {
27
- res.status(409);
28
+ statusCode = 409;
28
29
  }
29
30
  else if (invalidParameters.is(error)) {
30
- res.status(422);
31
+ statusCode = 422;
31
32
  }
32
33
  else if (notImplemented.is(error)) {
33
- res.status(501);
34
+ statusCode = 501;
34
35
  }
35
36
  else if (incorrectState.is(error)) {
36
- res.status(409);
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
- res.status(500);
44
+ statusCode = 500;
44
45
  log.error(error);
45
46
  }
46
- log.info(`[${req.method}] ${req.path} (${res.statusCode})`);
47
- res.json(responseError);
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
- /* throw */ invalidParameters(error.fields);
5
+ throw invalidParameters(error.fields);
6
6
  }
7
7
  return next(error);
8
8
  }
@@ -10,13 +10,18 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
10
10
  import { Example, Get, Path, Query, Response, Request, Route, Security, Tags, Delete, SuccessResponse } from 'tsoa';
11
11
  import { inject } from 'inversify';
12
12
  import { provide } from 'inversify-binding-decorators';
13
+ import { AlarmService } from '../alarms/alarm.service.mjs';
14
+ import { escapeUnsafeComplexMatcher } from '../helpers/utils.helper.mjs';
15
+ import { genericAlarmsExample } from '../open-api/oa-examples/alarm.oa-example.mjs';
13
16
  import { network, networkIds, partialNetworks } from '../open-api/oa-examples/network.oa-example.mjs';
14
17
  import { noContentResp, notFoundResp, unauthorizedResp } from '../open-api/common/response.common.mjs';
15
18
  import { RestApi } from '../rest-api/rest-api.mjs';
16
19
  import { XapiXoController } from '../abstract-classes/xapi-xo-controller.mjs';
17
20
  let NetworkController = class NetworkController extends XapiXoController {
18
- constructor(restApi) {
21
+ #alarmService;
22
+ constructor(restApi, alarmService) {
19
23
  super('network', restApi);
24
+ this.#alarmService = alarmService;
20
25
  }
21
26
  /**
22
27
  * @example fields "nbd,name_label,id"
@@ -39,6 +44,20 @@ let NetworkController = class NetworkController extends XapiXoController {
39
44
  const networkId = id;
40
45
  await this.getXapiObject(networkId).$xapi.deleteNetwork(networkId);
41
46
  }
47
+ /**
48
+ * @example id "9fe12ca3-d75d-cfb0-492e-cfd2bc6c568f"
49
+ * @example fields "id,time"
50
+ * @example filter "time:>1747053793"
51
+ * @example limit 42
52
+ */
53
+ getNetworkAlarms(req, id, fields, ndjson, filter, limit) {
54
+ const network = this.getObject(id);
55
+ const alarms = this.#alarmService.getAlarms({
56
+ filter: `${escapeUnsafeComplexMatcher(filter) ?? ''} object:uuid:${network.uuid}`,
57
+ limit,
58
+ });
59
+ return this.sendObjects(Object.values(alarms), req, 'alarms');
60
+ }
42
61
  };
43
62
  __decorate([
44
63
  Example(networkIds),
@@ -62,12 +81,25 @@ __decorate([
62
81
  Response(notFoundResp.status, notFoundResp.description),
63
82
  __param(0, Path())
64
83
  ], NetworkController.prototype, "deleteNetwork", null);
84
+ __decorate([
85
+ Example(genericAlarmsExample),
86
+ Get('{id}/alarms'),
87
+ Tags('alarms'),
88
+ Response(notFoundResp.status, notFoundResp.description),
89
+ __param(0, Request()),
90
+ __param(1, Path()),
91
+ __param(2, Query()),
92
+ __param(3, Query()),
93
+ __param(4, Query()),
94
+ __param(5, Query())
95
+ ], NetworkController.prototype, "getNetworkAlarms", null);
65
96
  NetworkController = __decorate([
66
97
  Route('networks'),
67
98
  Security('*'),
68
99
  Response(unauthorizedResp.status, unauthorizedResp.description),
69
100
  Tags('networks'),
70
101
  provide(NetworkController),
71
- __param(0, inject(RestApi))
102
+ __param(0, inject(RestApi)),
103
+ __param(1, inject(AlarmService))
72
104
  ], NetworkController);
73
105
  export { NetworkController };
@@ -47,3 +47,15 @@ export const alarm = {
47
47
  uuid: '3f607494-26f1-b328-b626-d81cf007de37',
48
48
  },
49
49
  };
50
+ export const genericAlarmsExample = [
51
+ {
52
+ id: '7e87b95e-8ebb-31c5-30ad-ff2eb079604b',
53
+ time: 1747053794,
54
+ href: '/rest/v0/alarms/7e87b95e-8ebb-31c5-30ad-ff2eb079604b',
55
+ },
56
+ {
57
+ id: '7e87b95e-8ebb-31c5-30ad-ff2eb079604c',
58
+ time: 1747053795,
59
+ href: '/rest/v0/alarms/7e87b95e-8ebb-31c5-30ad-ff2eb079604c',
60
+ },
61
+ ];
@@ -0,0 +1,31 @@
1
+ export const backupRepositoryIds = [
2
+ '/rest/v0/backup-repositories/7497c970-6780-4462-a452-fcb8a406ee64',
3
+ '/rest/v0/backup-repositories/f681cef1-617e-4650-ac31-ffdaead076bf',
4
+ ];
5
+ export const partialBackupRepositories = [
6
+ {
7
+ id: '7497c970-6780-4462-a452-fcb8a406ee64',
8
+ name: 'test',
9
+ enabled: true,
10
+ href: '/rest/v0/backup-repositories/7497c970-6780-4462-a452-fcb8a406ee64',
11
+ },
12
+ {
13
+ id: 'f681cef1-617e-4650-ac31-ffdaead076bf',
14
+ name: 'S3_Remote',
15
+ enabled: true,
16
+ href: '/rest/v0/backup-repositories/f681cef1-617e-4650-ac31-ffdaead076bf',
17
+ },
18
+ ];
19
+ export const backupRepository = {
20
+ enabled: true,
21
+ name: 'S3_Remote',
22
+ benchmarks: [
23
+ {
24
+ readRate: 7999965.197905305,
25
+ timestamp: 1751469269245,
26
+ writeRate: 7767798.704316632,
27
+ },
28
+ ],
29
+ id: '677e50c5-8d8a-4c89-b1ac-e2f4593d0ebb',
30
+ url: 's3://FOIS5DY532RGXD62TJ52:obfuscated-q3oi6d9X8uenGvdLnHk2@s3.us-east-2.amazonaws.com/with-lock/backup?useVhdDirectory=true',
31
+ };
@@ -72,3 +72,404 @@ 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, 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, 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
+ };
275
+ export const poolDashboard = {
276
+ hosts: {
277
+ status: {
278
+ running: 3,
279
+ disabled: 0,
280
+ halted: 0,
281
+ total: 3,
282
+ },
283
+ topFiveUsage: {
284
+ ram: [
285
+ {
286
+ name_label: 'XCP XO 8.3.0 master',
287
+ id: 'b61a5c92-700e-4966-a13b-00633f03eea8',
288
+ size: 34359738368,
289
+ usage: 6254059520,
290
+ percent: 18.201708793640137,
291
+ },
292
+ {
293
+ name_label: 'XCP XO 8.3.0 slave',
294
+ id: '84e555d8-267a-4720-aa5f-fd19035aadae',
295
+ size: 34359738368,
296
+ usage: 3544117248,
297
+ percent: 10.314738750457764,
298
+ },
299
+ {
300
+ name_label: 'XCP XO 8.3.0 slave 2',
301
+ id: '669df518-4e5d-4d84-b93a-9be2cdcdfca1',
302
+ size: 34359738368,
303
+ usage: 3544117248,
304
+ percent: 10.314738750457764,
305
+ },
306
+ ],
307
+ cpu: [
308
+ {
309
+ percent: 6.471593483001921,
310
+ id: 'b61a5c92-700e-4966-a13b-00633f03eea8',
311
+ name_label: 'XCP XO 8.3.0 master',
312
+ },
313
+ {
314
+ percent: 2.340522127838084,
315
+ id: '84e555d8-267a-4720-aa5f-fd19035aadae',
316
+ name_label: 'XCP XO 8.3.0 slave',
317
+ },
318
+ {
319
+ percent: 1.5935676943627188,
320
+ id: '669df518-4e5d-4d84-b93a-9be2cdcdfca1',
321
+ name_label: 'XCP XO 8.3.0 slave 2',
322
+ },
323
+ ],
324
+ },
325
+ missingPatches: {
326
+ hasAuthorization: true,
327
+ missingPatches: [
328
+ {
329
+ url: 'http://www.xen.org',
330
+ version: '25.6.0',
331
+ name: 'xenopsd-xc',
332
+ license: 'LGPL-2.1-or-later WITH OCaml-LGPL-linking-exception',
333
+ changelog: {
334
+ date: 1750852800,
335
+ description: '- Fix remote syslog configuration being broken on updates',
336
+ author: 'Andrii Sultanov <andriy.sultanov@vates.tech> - 25.6.0-1.9',
337
+ },
338
+ release: '1.9.xcpng8.3',
339
+ size: 5421696,
340
+ description: 'Xenopsd using xc',
341
+ },
342
+ {
343
+ url: 'http://www.xen.org',
344
+ version: '25.6.0',
345
+ name: 'forkexecd',
346
+ license: 'LGPL-2.1-or-later WITH OCaml-LGPL-linking-exception',
347
+ changelog: {
348
+ date: 1750852800,
349
+ description: '- Fix remote syslog configuration being broken on updates',
350
+ author: 'Andrii Sultanov <andriy.sultanov@vates.tech> - 25.6.0-1.9',
351
+ },
352
+ release: '1.9.xcpng8.3',
353
+ size: 2498124,
354
+ description: 'A subprocess management service',
355
+ },
356
+ ],
357
+ },
358
+ },
359
+ vms: {
360
+ status: {
361
+ running: 2,
362
+ halted: 38,
363
+ paused: 0,
364
+ total: 40,
365
+ suspended: 0,
366
+ },
367
+ topFiveUsage: {
368
+ ram: [
369
+ {
370
+ id: 'db822c15-6f7d-8920-10bd-68d40fb12ac6',
371
+ name_label: 'MRA alpine',
372
+ memory: 536858624,
373
+ memoryFree: 423256064,
374
+ percent: 21.160610060349892,
375
+ },
376
+ {
377
+ id: 'fe10b378-db7b-d2a4-eef6-0f1cde75d409',
378
+ name_label: 'pbt_test',
379
+ memory: 2147471360,
380
+ memoryFree: 1813676032,
381
+ percent: 15.54364515482991,
382
+ },
383
+ ],
384
+ cpu: [
385
+ {
386
+ id: 'db822c15-6f7d-8920-10bd-68d40fb12ac6',
387
+ name_label: 'MRA alpine',
388
+ percent: 1.04830558411777,
389
+ },
390
+ {
391
+ id: 'fe10b378-db7b-d2a4-eef6-0f1cde75d409',
392
+ name_label: 'pbt_test',
393
+ percent: 0.3743608540389682,
394
+ },
395
+ ],
396
+ },
397
+ },
398
+ srs: {
399
+ topFiveUsage: [
400
+ {
401
+ name_label: 'Local storage',
402
+ id: '4cb0d74e-a7c1-0b7d-46e3-09382c012abb',
403
+ percent: 45.51916716586373,
404
+ physical_usage: 33539653632,
405
+ size: 73682485248,
406
+ },
407
+ {
408
+ name_label: 'Local storage',
409
+ id: 'c4284e12-37c9-7967-b9e8-83ef229c3e03',
410
+ percent: 23.527768920458005,
411
+ physical_usage: 17335844864,
412
+ size: 73682485248,
413
+ },
414
+ {
415
+ name_label: 'XOSTOR NVME',
416
+ id: 'c787b75c-3e0d-70fa-d0c3-cbfd382d7e33',
417
+ percent: 18.56945625131877,
418
+ physical_usage: 95048891392,
419
+ size: 511856082944,
420
+ },
421
+ {
422
+ name_label: 'Local storage',
423
+ id: '8aa2fb4a-143e-c2bc-05d4-c68bbb101d41',
424
+ percent: 16.016159531372924,
425
+ physical_usage: 11801104384,
426
+ size: 73682485248,
427
+ },
428
+ ],
429
+ },
430
+ alarms: [
431
+ {
432
+ name: 'ALARM',
433
+ time: 1749572297,
434
+ id: '71ef8836-56e4-97ca-02d1-e118ee1aad98',
435
+ type: 'message',
436
+ uuid: '71ef8836-56e4-97ca-02d1-e118ee1aad98',
437
+ $pool: 'b7569d99-30f8-178a-7d94-801de3e29b5b',
438
+ $poolId: 'b7569d99-30f8-178a-7d94-801de3e29b5b',
439
+ _xapiRef: 'OpaqueRef:fed2a9e5-6c72-dada-6f27-7475583ff3e7',
440
+ body: {
441
+ value: '1.054742',
442
+ name: 'mem_usage',
443
+ },
444
+ object: {
445
+ type: 'VM-controller',
446
+ uuid: '9b4775bd-9493-490a-9afa-f786a44caa4f',
447
+ href: '/rest/v0/vm-controllers/9b4775bd-9493-490a-9afa-f786a44caa4f',
448
+ },
449
+ },
450
+ {
451
+ name: 'ALARM',
452
+ time: 1748688413,
453
+ id: 'ef9008da-e244-9875-4b83-12de733c8aa9',
454
+ type: 'message',
455
+ uuid: 'ef9008da-e244-9875-4b83-12de733c8aa9',
456
+ $pool: 'b7569d99-30f8-178a-7d94-801de3e29b5b',
457
+ $poolId: 'b7569d99-30f8-178a-7d94-801de3e29b5b',
458
+ _xapiRef: 'OpaqueRef:d03c24dc-037d-ac8b-80ea-c5a1106cd678',
459
+ body: {
460
+ value: '0.962104',
461
+ name: 'mem_usage',
462
+ },
463
+ object: {
464
+ type: 'VM-controller',
465
+ uuid: '9b4775bd-9493-490a-9afa-f786a44caa4f',
466
+ href: '/rest/v0/vm-controllers/9b4775bd-9493-490a-9afa-f786a44caa4f',
467
+ },
468
+ },
469
+ ],
470
+ cpuProvisioning: {
471
+ total: 48,
472
+ assigned: 4,
473
+ percent: 8.333333333333334,
474
+ },
475
+ };
@@ -24,3 +24,4 @@ export const user = {
24
24
  preferences: {},
25
25
  id: '722d17b9-699b-49d2-8193-be1ac573d3de',
26
26
  };
27
+ export const userId = { id: '722d17b9-699b-49d2-8193-be1ac573d3de' };