Red Hat Bugzilla – Bug 824962
REST API: hotPlugNic - update vms/id/nics/id <active></ctive> doesn't work
Last modified: 2016-04-22 00:59:42 EDT
Created attachment 586674 [details]
Description of problem:
Using PUT command to update vm nic active state doesn't work.
Try to move active False to True
<vm href="/api/vms/84f4d03b-5a4e-4558-9fc6-c9a06cdd7426" id="84f4d03b-5a4e-4558-9fc6-c9a06cdd7426"/>
<network href="/api/networks/6806a25c-532d-4bf2-a298-8a6ecfc43319" id="6806a25c-532d-4bf2-a298-8a6ecfc43319"/>
2012-05-24 20:12:52,582 INFO [org.ovirt.engine.core.bll.UpdateVmInterfaceCommand] (ajp--0.0.0.0-8009-1)  Running command: UpdateVmInterfaceCommand internal: false. Entities affected : ID: 84f4d03b-5a4e-4558-9fc6-c9a06cdd7426 Type: VM
REST API behavior is not to change the resource state by updating the status field, but rather by actions.
This is true for all other areas, so it is also what happens here.
There are actions to activate/deactivate the vNIC, so that's the correct way to do it.
It is no clear if you don't have <action> element inside <nic>!
As for the "state", it is true that rest doesn't allow to update state but in this case it doesn't represent as a "state" field.
Please go to <host> or any other element that holds state filed and see the it displayed as followed:
So please decide if you like to add actions to hotplugnic and if so, add an <action> element. other then that, decide if you'd like to display the state and if so, follow the REST API behavior.
I understand that bug 825499 is just about the actions elements.
Regarding the state, it is only a boolean value so it cannot be anything other than true or false. It is the same modelling which is used for other devices (Please look at Disk) so if you think this should change then it should change across the API.
moving 825499 to TestBlocker and open discussion on upstream
Colsing since the other bug is the real issue.
If the active field needs to be changed then it should be a new bug which also covers disks (since this field is on the VM device level).