mirror of
https://github.com/vatesfr/xen-orchestra.git
synced 2026-09-10 22:14:48 -05:00
feat(@xen-orchestra/rest-api): expose pools/:id/tags/:tag (#9088)
This commit is contained in:
@@ -167,6 +167,8 @@ export interface XenApiEvent {
|
||||
timestamp?: string
|
||||
}
|
||||
|
||||
type XenApiPoolCallMethods = TagCallMethods & {}
|
||||
|
||||
export interface XenApiPool {
|
||||
$ref: Branded<'pool'>
|
||||
allowed_operations: POOL_ALLOWED_OPERATIONS[]
|
||||
@@ -229,7 +231,7 @@ export interface XenApiPool {
|
||||
/** @deprecated */
|
||||
wlb_verify_cert?: boolean
|
||||
}
|
||||
export type XenApiPoolWrapped = WrapperXenApi<XenApiPool, 'pool'>
|
||||
export type XenApiPoolWrapped = WrapperXenApi<XenApiPool, 'pool', XenApiPoolCallMethods>
|
||||
|
||||
/** @deprecated */
|
||||
export interface XenApiPoolPatch {
|
||||
|
||||
@@ -12,6 +12,8 @@ import {
|
||||
Middlewares,
|
||||
Body,
|
||||
SuccessResponse,
|
||||
Put,
|
||||
Delete,
|
||||
} from 'tsoa'
|
||||
import { inject } from 'inversify'
|
||||
import { PassThrough } from 'node:stream'
|
||||
@@ -433,4 +435,28 @@ export class PoolController extends XapiXoController<XoPool> {
|
||||
|
||||
return this.sendObjects(Object.values(messages), req, 'messages')
|
||||
}
|
||||
|
||||
/**
|
||||
* @example id "355ee47d-ff4c-4924-3db2-fd86ae629676"
|
||||
* @example tag "from-rest-api"
|
||||
*/
|
||||
@Put('{id}/tags/{tag}')
|
||||
@SuccessResponse(noContentResp.status, noContentResp.description)
|
||||
@Response(notFoundResp.status, notFoundResp.description)
|
||||
async putPoolTag(@Path() id: string, @Path() tag: string): Promise<void> {
|
||||
const pool = this.getXapiObject(id as XoPool['id'])
|
||||
await pool.$call('add_tags', tag)
|
||||
}
|
||||
|
||||
/**
|
||||
* @example id "355ee47d-ff4c-4924-3db2-fd86ae629676"
|
||||
* @example tag "from-rest-api"
|
||||
*/
|
||||
@Delete('{id}/tags/{tag}')
|
||||
@SuccessResponse(noContentResp.status, noContentResp.description)
|
||||
@Response(notFoundResp.status, notFoundResp.description)
|
||||
async deletePoolTag(@Path() id: string, @Path() tag: string): Promise<void> {
|
||||
const pool = this.getXapiObject(id as XoPool['id'])
|
||||
await pool.$call('remove_tags', tag)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,6 +35,8 @@
|
||||
- `DELETE /rest/v0/hosts/<host-id>/tags/:tag` (PR [#9037](https://github.com/vatesfr/xen-orchestra/pull/9037))
|
||||
- `PUT /rest/v0/networks/<network-id>/tags/:tag` (PR [#9087](https://github.com/vatesfr/xen-orchestra/pull/9087))
|
||||
- `DELETE /rest/v0/networks/<network-id>/tags/:tag` (PR [#9087](https://github.com/vatesfr/xen-orchestra/pull/9087))
|
||||
- `PUT /rest/v0/pools/<pool-id>/tags/:tag` (PR [#9088](https://github.com/vatesfr/xen-orchestra/pull/9088))
|
||||
- `DELETE /rest/v0/pools/<pool-id>/tags/:tag` (PR [#9088](https://github.com/vatesfr/xen-orchestra/pull/9088))
|
||||
|
||||
### Bug fixes
|
||||
|
||||
|
||||
@@ -252,6 +252,7 @@ export default class RestApi {
|
||||
alarms: true,
|
||||
missing_patches: true,
|
||||
messages: true,
|
||||
tags: true,
|
||||
},
|
||||
},
|
||||
groups: {
|
||||
|
||||
Reference in New Issue
Block a user