@xen-orchestra/rest-api 0.5.0 → 0.7.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/README.md +1 -0
- package/dist/groups/group.controller.mjs +60 -0
- package/dist/middlewares/generic-error-handler.middleware.mjs +8 -1
- package/dist/networks/network.controller.mjs +59 -0
- package/dist/open-api/common/response.common.mjs +12 -0
- package/dist/open-api/oa-examples/group.oa-example.mjs +23 -0
- package/dist/open-api/oa-examples/network.oa-example.mjs +50 -0
- package/dist/open-api/oa-examples/server.oa-example.mjs +1 -0
- package/dist/open-api/routes/routes.js +362 -0
- package/dist/servers/server.controller.mjs +75 -3
- package/dist/servers/server.type.mjs +1 -0
- package/dist/vms/vm.controller.mjs +106 -0
- package/open-api/spec/swagger.json +1087 -9
- package/package.json +2 -2
|
@@ -70,6 +70,76 @@ let VmController = class VmController extends XapiXoController {
|
|
|
70
70
|
},
|
|
71
71
|
});
|
|
72
72
|
}
|
|
73
|
+
/**
|
|
74
|
+
* Requires guest tools to be installed
|
|
75
|
+
* @example id "f07ab729-c0e8-721c-45ec-f11276377030"
|
|
76
|
+
*/
|
|
77
|
+
async cleanShutdownVm(id, sync) {
|
|
78
|
+
const vmId = id;
|
|
79
|
+
const action = async () => {
|
|
80
|
+
await this.getXapiObject(vmId).$callAsync('clean_shutdown');
|
|
81
|
+
};
|
|
82
|
+
return this.createAction(action, {
|
|
83
|
+
sync,
|
|
84
|
+
statusCode: noContentResp.status,
|
|
85
|
+
taskProperties: {
|
|
86
|
+
name: 'clean shutdown VM',
|
|
87
|
+
objectId: vmId,
|
|
88
|
+
},
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Requires guest tools to be installed
|
|
93
|
+
* @example id "f07ab729-c0e8-721c-45ec-f11276377030"
|
|
94
|
+
*/
|
|
95
|
+
async cleanRebootVm(id, sync) {
|
|
96
|
+
const vmId = id;
|
|
97
|
+
const action = async () => {
|
|
98
|
+
await this.getXapiObject(vmId).$callAsync('clean_reboot');
|
|
99
|
+
};
|
|
100
|
+
return this.createAction(action, {
|
|
101
|
+
sync,
|
|
102
|
+
statusCode: noContentResp.status,
|
|
103
|
+
taskProperties: {
|
|
104
|
+
name: 'clean reboot VM',
|
|
105
|
+
objectId: vmId,
|
|
106
|
+
},
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* @example id "f07ab729-c0e8-721c-45ec-f11276377030"
|
|
111
|
+
*/
|
|
112
|
+
async hardShutdownVm(id, sync) {
|
|
113
|
+
const vmId = id;
|
|
114
|
+
const action = async () => {
|
|
115
|
+
await this.getXapiObject(vmId).$callAsync('hard_shutdown');
|
|
116
|
+
};
|
|
117
|
+
return this.createAction(action, {
|
|
118
|
+
sync,
|
|
119
|
+
statusCode: noContentResp.status,
|
|
120
|
+
taskProperties: {
|
|
121
|
+
name: 'hard shutdown VM',
|
|
122
|
+
objectId: vmId,
|
|
123
|
+
},
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* @example id "f07ab729-c0e8-721c-45ec-f11276377030"
|
|
128
|
+
*/
|
|
129
|
+
async hardRebootVm(id, sync) {
|
|
130
|
+
const vmId = id;
|
|
131
|
+
const action = async () => {
|
|
132
|
+
await this.getXapiObject(vmId).$callAsync('hard_reboot');
|
|
133
|
+
};
|
|
134
|
+
return this.createAction(action, {
|
|
135
|
+
sync,
|
|
136
|
+
statusCode: noContentResp.status,
|
|
137
|
+
taskProperties: {
|
|
138
|
+
name: 'hard reboot VM',
|
|
139
|
+
objectId: vmId,
|
|
140
|
+
},
|
|
141
|
+
});
|
|
142
|
+
}
|
|
73
143
|
};
|
|
74
144
|
__decorate([
|
|
75
145
|
Example(vmIds),
|
|
@@ -104,6 +174,42 @@ __decorate([
|
|
|
104
174
|
__param(0, Path()),
|
|
105
175
|
__param(1, Query())
|
|
106
176
|
], VmController.prototype, "startVm", null);
|
|
177
|
+
__decorate([
|
|
178
|
+
Example(taskLocation),
|
|
179
|
+
Post('{id}/actions/clean_shutdown'),
|
|
180
|
+
SuccessResponse(actionAsyncroneResp.status, actionAsyncroneResp.description, actionAsyncroneResp.produce),
|
|
181
|
+
Response(noContentResp.status, noContentResp.description),
|
|
182
|
+
Response(notFoundResp.status, notFoundResp.description),
|
|
183
|
+
Response(internalServerErrorResp.status, internalServerErrorResp.description),
|
|
184
|
+
__param(0, Path()),
|
|
185
|
+
__param(1, Query())
|
|
186
|
+
], VmController.prototype, "cleanShutdownVm", null);
|
|
187
|
+
__decorate([
|
|
188
|
+
Example(taskLocation),
|
|
189
|
+
Post('{id}/actions/clean_reboot'),
|
|
190
|
+
__param(0, Path()),
|
|
191
|
+
__param(1, Query())
|
|
192
|
+
], VmController.prototype, "cleanRebootVm", null);
|
|
193
|
+
__decorate([
|
|
194
|
+
Example(taskLocation),
|
|
195
|
+
Post('{id}/actions/hard_shutdown'),
|
|
196
|
+
SuccessResponse(actionAsyncroneResp.status, actionAsyncroneResp.description, actionAsyncroneResp.produce),
|
|
197
|
+
Response(noContentResp.status, noContentResp.description),
|
|
198
|
+
Response(notFoundResp.status, notFoundResp.description),
|
|
199
|
+
Response(internalServerErrorResp.status, internalServerErrorResp.description),
|
|
200
|
+
__param(0, Path()),
|
|
201
|
+
__param(1, Query())
|
|
202
|
+
], VmController.prototype, "hardShutdownVm", null);
|
|
203
|
+
__decorate([
|
|
204
|
+
Example(taskLocation),
|
|
205
|
+
Post('{id}/actions/hard_reboot'),
|
|
206
|
+
SuccessResponse(actionAsyncroneResp.status, actionAsyncroneResp.description, actionAsyncroneResp.produce),
|
|
207
|
+
Response(noContentResp.status, noContentResp.description),
|
|
208
|
+
Response(notFoundResp.status, notFoundResp.description),
|
|
209
|
+
Response(internalServerErrorResp.status, internalServerErrorResp.description),
|
|
210
|
+
__param(0, Path()),
|
|
211
|
+
__param(1, Query())
|
|
212
|
+
], VmController.prototype, "hardRebootVm", null);
|
|
107
213
|
VmController = __decorate([
|
|
108
214
|
Route('vms'),
|
|
109
215
|
Security('*'),
|