Skip to content

Commit

Permalink
remove legacy route after rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
MathieuRA committed Feb 28, 2025
1 parent 4723c6f commit db76819
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

- **XO6**:
- [Pool/Network]: Display networks and host internal networks information in side panel (PR [#8286](https://github.com/vatesfr/xen-orchestra/pull/8286))
- **Migrated REST API endpoints**:
- `/rest/v0/vms/<vm-id>/stats` (PR [#8359](https://github.com/vatesfr/xen-orchestra/pull/8359))

> Users must be able to say: “Nice enhancement, I'm eager to test it”
Expand Down
5 changes: 2 additions & 3 deletions packages/xo-server/src/xo-mixins/rest-api.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -1357,13 +1357,12 @@ export default class RestApi {
)

api.get(
'/:collection(vms|hosts)/:object/stats',
'/:collection(hosts)/:object/stats',
wrap(async (req, res) => {
const object = req.object
const method = object.type === 'VM' ? 'getXapiVmStats' : 'getXapiHostStats'
const granularity = req.query.granularity

const result = await app[method](object.id, granularity)
const result = await app.getXapiHostStats(object.id, granularity)
return res.json(result)
})
)
Expand Down

0 comments on commit db76819

Please sign in to comment.