feat(xo-server): ability to manage VIFs using REST API when creating a VM #8137
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Previously, we destroyed all VIFs then
xo-web
sent the VIFs created by the user + the template VIFs and xo-server creates all the VIFs sent by the user. This behavior was a bit weird, but since we mainly use xo-server with xo-web, it wasn't a problem.This behavior meant that creating a VM from the REST API did not create the VIFs of the VM template.
This PR changes the handling of VIFs when creating a VM.
Instead of deleting all VIFs and only creating the VIFs sent by the client, the VIFs template are not removed. There is always the possibility of removing a VIF from the template by passing the remove parameter with the VIF's device.
{device: <vif-device>, remove: true}
To edit a VIF of the template, simply pass the device the information:
{device: <vif-device>, ...all other vif fields
Checklist
Fixes #007
,See xoa-support#42
,See https://...
)Introduced by
CHANGELOG.unreleased.md
Review process
Notes: