Change in ovirt-engine[master]: restapi: Use multiple "boot.devices.device" instead of multi...

juan.hernandez at redhat.com juan.hernandez at redhat.com
Mon Sep 28 13:27:34 UTC 2015


Juan Hernandez has submitted this change and it was merged.

Change subject: restapi: Use multiple "boot.devices.device" instead of multiple "boot"
......................................................................


restapi: Use multiple "boot.devices.device" instead of multiple "boot"

Currently the way to specify the boot sequence when starting a virtual
machine was to use multiple "boot" elements, each containing a "dev"
element. For example, to specify that the virtual machine should first
try to boot from CDROM and then from hard disk the following request was
used:

  POST /vms/{vm:id}/start
  <action>
    <vm>
      ...
      <boot>
        <dev>cdrom</dev>
      </boot>
      <boot>
        <dev>hd</dev>
      </boot>
    </vm>
  </action>

The common practice in other parts of the API is to represent arrays
with a wrapper element. In that case that wrapper element could be named
"boots", but that doesn't make much sense, as what can have multiple
values here is the boot device, not the boot sequence. To fix this
inconsistence this patch replaces that with a single "boot" element that
can contain multiple devices:

    POST /vms/{vm:id}/start
    <action>
      <vm>
        ...
        <boot>
          <devices>
            <device>cdrom</device>
            <device>hd</device>
          </devices>
        </boot>
      </vm>
    </action>

Change-Id: I63fbcef5cdfafc76cc95a3862ff8ac3457ee9074
Signed-off-by: Juan Hernandez <juan.hernandez at redhat.com>
---
M backend/manager/modules/restapi/README.md
M backend/manager/modules/restapi/interface/definition/src/main/resources/rsdl_metadata.yaml
M backend/manager/modules/restapi/interface/definition/src/main/schema/api.xsd
M backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/validation/BootValidator.java
M backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/validation/OsValidator.java
M backend/manager/modules/restapi/jaxrs/src/test/java/org/ovirt/engine/api/restapi/resource/BackendVmResourceTest.java
M backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/InstanceTypeMapper.java
M backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/TemplateMapper.java
M backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/VmBaseMapper.java
M backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/VmMapper.java
M backend/manager/modules/restapi/types/src/test/java/org/ovirt/engine/api/restapi/types/TemplateMapperTest.java
M backend/manager/modules/restapi/types/src/test/java/org/ovirt/engine/api/restapi/types/VmMapperTest.java
12 files changed, 149 insertions(+), 97 deletions(-)

Approvals:
  Juan Hernandez: Verified; Looks good to me, approved; Passed CI tests



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

Gerrit-MessageType: merged
Gerrit-Change-Id: I63fbcef5cdfafc76cc95a3862ff8ac3457ee9074
Gerrit-PatchSet: 3
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Juan Hernandez <juan.hernandez at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Juan Hernandez <juan.hernandez at redhat.com>
Gerrit-Reviewer: Ori Liel <oliel at redhat.com>
Gerrit-Reviewer: automation at ovirt.org



More information about the Engine-commits mailing list