mirror of
https://github.com/vatesfr/xen-orchestra.git
synced 2026-11-25 08:18:12 -06:00
Compare commits
47 Commits
rest-api/p
...
release
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
905d9db85b | ||
|
|
9576b6e7e7 | ||
|
|
891ce89817 | ||
|
|
34c8aede24 | ||
|
|
ce5a2cfa2a | ||
|
|
95452a9d42 | ||
|
|
5af68c643b | ||
|
|
0f268ce3dd | ||
|
|
dcc578dc8d | ||
|
|
0ae26cfebb | ||
|
|
0d75531890 | ||
|
|
166a49ab26 | ||
|
|
1c2717a7af | ||
|
|
0ea8c18fd0 | ||
|
|
b654011208 | ||
|
|
d26add5ff9 | ||
|
|
b69133c2b8 | ||
|
|
98dd59bbb4 | ||
|
|
288abdd02a | ||
|
|
7a06c6ccee | ||
|
|
2e5ac8a282 | ||
|
|
12b97f3060 | ||
|
|
09737a54eb | ||
|
|
7055f1654c | ||
|
|
ab38f89b5b | ||
|
|
15a4caed96 | ||
|
|
e8169b08c9 | ||
|
|
96eac01241 | ||
|
|
f718219c98 | ||
|
|
e050216be5 | ||
|
|
2a308c2304 | ||
|
|
c9edc6ee55 | ||
|
|
9c8aad12f1 | ||
|
|
a374b5afd1 | ||
|
|
e6b3a96151 | ||
|
|
944fa4d238 | ||
|
|
531d48cb76 | ||
|
|
d11566831b | ||
|
|
03d3e3b7cc | ||
|
|
089da636ed | ||
|
|
c09b9cb820 | ||
|
|
f19126cd93 | ||
|
|
8b5512afe6 | ||
|
|
5a993f204a | ||
|
|
cb85c863fc | ||
|
|
6012db2bad | ||
|
|
cdcd61dadc |
@@ -466,8 +466,6 @@ export type XoApp = EventEmitter & {
|
||||
opts?: { bypassAuthorization?: boolean; fromGroup?: boolean; fromUser?: boolean }
|
||||
): Promise<XoAclRole[]>
|
||||
getAllGroups(): Promise<XoGroup[]>
|
||||
/** Also destroys the VM of the proxy, if any */
|
||||
destroyProxy(id: XoProxy['id']): Promise<void>
|
||||
getAllProxies(): Promise<XoProxy[]>
|
||||
getAllJobs<T extends AnyXoJob['type']>(type: T): Promise<Extract<AnyXoJob, { type: T }>[]>
|
||||
getAllJobs(type?: string): Promise<AnyXoJob[]>
|
||||
@@ -505,7 +503,10 @@ export type XoApp = EventEmitter & {
|
||||
* `assertBrowserMediaInsertable` reports the predictable failures synchronously, e.g. before
|
||||
* starting a task.
|
||||
*/
|
||||
insertBrowserMedia(params: { id: XoBrowserMediaSession['id']; vmId: XoVm['id'] }): Promise<{ vdiId: XoVdi['id'] }>
|
||||
insertBrowserMedia(params: {
|
||||
id: XoBrowserMediaSession['id']
|
||||
vmId: XoVm['id']
|
||||
}): Promise<{ vdiId: XoVdi['id'] }>
|
||||
assertBrowserMediaInsertable(params: { id: XoBrowserMediaSession['id']; vmId: XoVm['id'] }): void
|
||||
/** Eject the ISO of a browser media session, release its storage, and disconnect the browser */
|
||||
ejectBrowserMedia(id: XoBrowserMediaSession['id']): Promise<void>
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
export default {
|
||||
read: true,
|
||||
delete: true,
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import {
|
||||
Delete,
|
||||
Example,
|
||||
Extension,
|
||||
Get,
|
||||
@@ -24,7 +23,6 @@ import {
|
||||
badRequestResp,
|
||||
forbiddenOperationResp,
|
||||
internalServerErrorResp,
|
||||
noContentResp,
|
||||
notFoundResp,
|
||||
proxyUnreachableResp,
|
||||
unauthorizedResp,
|
||||
@@ -148,34 +146,4 @@ export class ProxyController extends XoController<XoProxy> {
|
||||
|
||||
return { success: true }
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes a proxy
|
||||
*
|
||||
* Destroys the VM of the proxy, if it has one, with its disks and snapshots, then removes the proxy from Xen Orchestra.
|
||||
*
|
||||
* Required privilege:
|
||||
* - resource: proxy, action: delete
|
||||
*
|
||||
* This privilege is enough to destroy the VM of the proxy: no privilege on that VM is checked.
|
||||
*
|
||||
* @example id "e625ea0c-a876-405a-b838-109d762efe88"
|
||||
*/
|
||||
@Extension('x-mcp-exposure', 'confirm')
|
||||
@Delete('{id}')
|
||||
@Middlewares(
|
||||
acl({
|
||||
resource: 'proxy',
|
||||
action: 'delete',
|
||||
objectId: 'params.id',
|
||||
getObject: ({ restApi }) => restApi.xoApp.getProxy,
|
||||
})
|
||||
)
|
||||
@SuccessResponse(noContentResp.status, noContentResp.description)
|
||||
@Response(forbiddenOperationResp.status, forbiddenOperationResp.description)
|
||||
@Response(notFoundResp.status, notFoundResp.description)
|
||||
@Response(internalServerErrorResp.status, internalServerErrorResp.description)
|
||||
async deleteProxy(@Path() id: string): Promise<void> {
|
||||
await this.restApi.xoApp.destroyProxy(id as XoProxy['id'])
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,21 +49,3 @@ describe('ProxyController.getProxyHealth', () => {
|
||||
await assert.rejects(controller.getProxyHealth(proxyId), error => error === unrelatedError)
|
||||
})
|
||||
})
|
||||
|
||||
describe('ProxyController.deleteProxy', () => {
|
||||
it('forwards the id to destroyProxy', async () => {
|
||||
const calls: unknown[] = []
|
||||
const restApi = {
|
||||
xoApp: {
|
||||
destroyProxy: async (id: string) => {
|
||||
calls.push(['destroyProxy', id])
|
||||
},
|
||||
},
|
||||
} as unknown as RestApi
|
||||
const controller = new ProxyController(restApi)
|
||||
|
||||
await controller.deleteProxy(proxyId)
|
||||
|
||||
assert.deepEqual(calls, [['destroyProxy', proxyId]])
|
||||
})
|
||||
})
|
||||
|
||||
@@ -9,8 +9,6 @@
|
||||
|
||||
> Users must be able to say: "Nice enhancement, I'm eager to test it"
|
||||
|
||||
- [REST API] Delete a proxy: `DELETE /rest/v0/proxies/:id` (PR [#10900](https://github.com/vatesfr/xen-orchestra/pull/10900))
|
||||
|
||||
### Bug fixes
|
||||
|
||||
> Users must be able to say: "I had this issue, happy to know it's fixed"
|
||||
@@ -31,7 +29,4 @@
|
||||
|
||||
<!--packages-start-->
|
||||
|
||||
- @xen-orchestra/acl minor
|
||||
- @xen-orchestra/rest-api minor
|
||||
|
||||
<!--packages-end-->
|
||||
|
||||
@@ -190,7 +190,7 @@ This action makes the XO server send a GET request to the given URL, so the hold
|
||||
| | `reclaim-space`, |
|
||||
| `schedule` | `read`, `run` |
|
||||
| `restore-log` | `read` |
|
||||
| `proxy` | `read`, `delete` |
|
||||
| `proxy` | `read` |
|
||||
| `server` | `read`, `create`, `delete`, `connect`, `disconnect` |
|
||||
| `task` | `read`, `abort`, `delete` |
|
||||
| `alarm` | `read` |
|
||||
|
||||
Reference in New Issue
Block a user