@xen-orchestra/rest-api 0.17.0 → 0.19.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 +20 -0
- package/dist/abstract-classes/xapi-xo-controller.mjs +10 -0
- package/dist/abstract-classes/xo-controller.mjs +1 -1
- package/dist/alarms/alarm.controller.mjs +2 -1
- package/dist/backup-archives/backup-archive.controller.mjs +96 -0
- package/dist/backup-jobs/backup-job.controller.mjs +3 -1
- package/dist/backup-logs/backup-log.controller.mjs +2 -1
- package/dist/backup-repositories/backup-repositories.controller.mjs +2 -1
- package/dist/groups/group.controller.mjs +26 -1
- package/dist/hosts/host.controller.mjs +81 -2
- package/dist/index.mjs +3 -2
- package/dist/ioc/ioc.mjs +0 -5
- package/dist/messages/message.controller.mjs +3 -2
- package/dist/middlewares/authentication.middleware.mjs +44 -20
- package/dist/networks/network.controller.mjs +81 -2
- package/dist/open-api/oa-examples/backup-archive.oa-example.mjs +60 -0
- package/dist/open-api/oa-examples/pbd.oa-example.mjs +41 -0
- package/dist/open-api/oa-examples/user.oa-example.mjs +12 -0
- package/dist/open-api/routes/routes.js +2094 -538
- package/dist/pbds/pbd.controller.mjs +60 -0
- package/dist/pcis/pci.controller.mjs +2 -1
- package/dist/pgpus/pgpu.controller.mjs +2 -1
- package/dist/pifs/pif.controller.mjs +50 -1
- package/dist/pools/pool.controller.mjs +80 -3
- package/dist/proxies/proxy.controller.mjs +2 -1
- package/dist/restore-logs/restore-log.controller.mjs +3 -1
- package/dist/schedules/schedule.controller.mjs +2 -1
- package/dist/servers/server.controller.mjs +26 -2
- package/dist/sms/sm.controller.mjs +2 -1
- package/dist/srs/sr.controller.mjs +81 -2
- package/dist/tasks/task.controller.mjs +2 -1
- package/dist/users/user.controller.mjs +80 -31
- package/dist/users/user.middleware.mjs +11 -0
- package/dist/vbds/vbd.controller.mjs +50 -1
- package/dist/vdi-snapshots/vdi-snapshot.controller.mjs +81 -2
- package/dist/vdis/vdi.controller.mjs +105 -2
- package/dist/vifs/vif.controller.mjs +50 -1
- package/dist/vm-controller/vm-controller.controller.mjs +81 -2
- package/dist/vm-snapshots/vm-snapshot.controller.mjs +59 -8
- package/dist/vm-templates/vm-template.controller.mjs +59 -8
- package/dist/vms/vm.controller.mjs +38 -19
- package/dist/xoa/xoa.controller.mjs +2 -1
- package/open-api/spec/swagger.json +6380 -1008
- package/package.json +4 -4
- package/tsconfig.json +1 -0
- package/tsoa.json +19 -0
- package/dist/tasks/task.service.mjs +0 -24
package/package.json
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"main": "./dist/index.mjs",
|
|
7
7
|
"name": "@xen-orchestra/rest-api",
|
|
8
8
|
"homepage": "https://github.com/vatesfr/xen-orchestra/tree/master/@xen-orchestra/rest-api",
|
|
9
|
-
"version": "0.
|
|
9
|
+
"version": "0.19.0",
|
|
10
10
|
"description": "REST API to manage your XOA",
|
|
11
11
|
"license": "AGPL-3.0-or-later",
|
|
12
12
|
"private": false,
|
|
@@ -33,10 +33,10 @@
|
|
|
33
33
|
"typescript-eslint": "^8.23.0"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@vates/async-each": "^1.0.
|
|
36
|
+
"@vates/async-each": "^1.0.1",
|
|
37
37
|
"@vates/task": "^0.6.1",
|
|
38
|
-
"@vates/types": "^1.
|
|
39
|
-
"@xen-orchestra/backups": "^0.
|
|
38
|
+
"@vates/types": "^1.13.0",
|
|
39
|
+
"@xen-orchestra/backups": "^0.65.0",
|
|
40
40
|
"@xen-orchestra/log": "^0.7.1",
|
|
41
41
|
"complex-matcher": "^1.0.0",
|
|
42
42
|
"golike-defer": "^0.5.1",
|
package/tsconfig.json
CHANGED
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
"moduleResolution": "bundler",
|
|
10
10
|
"target": "ES2023",
|
|
11
11
|
"skipLibCheck": true,
|
|
12
|
+
"types": ["node"], // Only use types from Node.js and packages that are explicitly imported
|
|
12
13
|
"noImplicitAny": false, // otherwise it will throw an error when importing packages without type definition
|
|
13
14
|
|
|
14
15
|
/* Experimental options */
|
package/tsoa.json
CHANGED
|
@@ -11,6 +11,10 @@
|
|
|
11
11
|
"type": "apiKey",
|
|
12
12
|
"name": "authenticationToken",
|
|
13
13
|
"in": "cookie"
|
|
14
|
+
},
|
|
15
|
+
"basic": {
|
|
16
|
+
"type": "http",
|
|
17
|
+
"scheme": "basic"
|
|
14
18
|
}
|
|
15
19
|
},
|
|
16
20
|
"specMerging": "recursive",
|
|
@@ -46,6 +50,21 @@
|
|
|
46
50
|
}
|
|
47
51
|
}
|
|
48
52
|
},
|
|
53
|
+
"/vdis/{id}.{format}": {
|
|
54
|
+
"put": {
|
|
55
|
+
"requestBody": {
|
|
56
|
+
"required": true,
|
|
57
|
+
"content": {
|
|
58
|
+
"application/octet-stream": {
|
|
59
|
+
"schema": {
|
|
60
|
+
"type": "string",
|
|
61
|
+
"format": "binary"
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
},
|
|
49
68
|
"/docs/swagger.json": {
|
|
50
69
|
"get": {
|
|
51
70
|
"operationId": "swaggerSpec",
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import * as CM from 'complex-matcher';
|
|
2
|
-
export class TaskService {
|
|
3
|
-
#restApi;
|
|
4
|
-
constructor(restApi) {
|
|
5
|
-
this.#restApi = restApi;
|
|
6
|
-
}
|
|
7
|
-
async getTasks({ filter, limit = Infinity } = {}) {
|
|
8
|
-
const tasks = [];
|
|
9
|
-
let userFilter = () => true;
|
|
10
|
-
if (filter !== undefined) {
|
|
11
|
-
userFilter = typeof filter === 'string' ? CM.parse(filter).createPredicate() : filter;
|
|
12
|
-
}
|
|
13
|
-
for await (const task of this.#restApi.tasks.list()) {
|
|
14
|
-
if (limit === 0) {
|
|
15
|
-
break;
|
|
16
|
-
}
|
|
17
|
-
if (userFilter(task)) {
|
|
18
|
-
tasks.push(task);
|
|
19
|
-
limit--;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
return tasks;
|
|
23
|
-
}
|
|
24
|
-
}
|