Change in ovirt-engine[ovirt-engine-4.1]: restapi + engine : handle scenarios for graphicsconsoles APIs

Code Review gerrit at ovirt.org
Thu Feb 2 12:50:17 UTC 2017


>From Piotr Kliczewski <piotr.kliczewski at gmail.com>:

Piotr Kliczewski has submitted this change and it was merged.

Change subject: restapi + engine : handle scenarios for graphicsconsoles APIs
......................................................................


restapi + engine : handle scenarios for graphicsconsoles APIs

When using /graphicsconsoles REST apis for deleting or adding a graphic
device to an existing VM, there are cases that the VM is left after the
operation with no graphic devices (all was removed) but with a video
device OR lest with one graphic devide (which was added to a headless
VM) and no video device.

This patch handle all those senrois for the /graphicsconsoles APIS (GET,
POST, DELETE) such that in case the last graphic device was removed-the
video device also removed and the entity becomes headless.

and also in case the first graphic device is added to a headless entity,
a "QXL" video device is also added.

Those changes are relevant for VMs, Templates and Instance-types:
e.g. for adding a graphic device:
POST  ..api/instancetypes/<instancetype-id>/graphicsconsoles
<graphics_console>
<protocol>spice</protocol>
</graphics_console>

POST  ..api/templates/<template-id>/graphicsconsoles
...
POST  ..api/vms/<vm-id>/graphicsconsoles
...

For removing a graphic device:
DELETE ..api/instancetypes/<instancetype-id>/graphicsconsoles/<console-id>
DELETE  ..api/templates/<template-id>/graphicsconsoles/<console-id>
DELETE  ..api/vms/<vm-id>/graphicsconsoles/<console-id>

Change-Id: I15d94b31d91d51b0319af9100fcb45f1e1984ad8
Bug-Url: https://bugzilla.redhat.com/1414086
Signed-off-by: Sharon Gratch <sgratch at redhat.com>
---
M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AbstractGraphicsDeviceCommand.java
A backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddGraphicsAndVideoDevicesCommand.java
M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddGraphicsDeviceCommand.java
A backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RemoveGraphicsAndVideoDevicesCommand.java
M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/utils/VmDeviceUtils.java
M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/action/VdcActionType.java
M backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendGraphicsConsoleHelper.java
M backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendInstanceTypeGraphicsConsolesResource.java
M backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendTemplateGraphicsConsolesResource.java
M backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendVmGraphicsConsolesResource.java
10 files changed, 159 insertions(+), 8 deletions(-)

Approvals:
  Juan Hernandez: Looks good to me, but someone else must approve
  Jenkins CI: Passed CI tests
  Sharon Gratch: Verified
  Arik Hadas: Looks good to me, approved



-- 
To view, visit https://gerrit.ovirt.org/71476
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I15d94b31d91d51b0319af9100fcb45f1e1984ad8
Gerrit-PatchSet: 2
Gerrit-Project: ovirt-engine
Gerrit-Branch: ovirt-engine-4.1
Gerrit-Owner: Sharon Gratch <sgratch at redhat.com>
Gerrit-Reviewer: Arik Hadas <ahadas at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Juan Hernandez <juan.hernandez at redhat.com>
Gerrit-Reviewer: Piotr Kliczewski <piotr.kliczewski at gmail.com>
Gerrit-Reviewer: Sharon Gratch <sgratch at redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation at ovirt.org>


More information about the Engine-commits mailing list