Change in ovirt-engine[ovirt-engine-3.5]: restapi: Replace "storage_manager" with "spm"

piotr.kliczewski at gmail.com piotr.kliczewski at gmail.com
Fri Oct 3 08:42:27 UTC 2014


Piotr Kliczewski has submitted this change and it was merged.

Change subject: restapi: Replace "storage_manager" with "spm"
......................................................................


restapi: Replace "storage_manager" with "spm"

Currently the SPM priority of a host is modeled in the RESTAPI as an
attribute of an element that also has text content:

  <host>
    <storage_manager priority="5">true</storage_manager>
  </host>

This means that it is impossible to send an udpate containing only the
priority and not the text content. For example, a document like the
following:

  <host>
    <storage_manager priority="5"/>
  </host>

Is not valid because the text is declared as xs:boolean, and an empty
text isn't a valid value.

To avoid this issue this patch removes the "storage_manager" element
from the RSDL metadata and introduces a new "spm" element that contains
inner elements for the priority and the SPM status. For example:

  <host>
    <spm>
      <priority>5</priority>
      <status>
        <state>spm</state>
      </status>
    </spm>
  </host>

This way clients can send updates for only the priority:

  <host>
    <spm>
      <priority>6</priority>
    </spm>
  </host>

The previous "storage_manager" element and its behaviour are preserved
for backwards compatibility, but removed from the RSDL metadata.

Change-Id: I9bb8dba2385b1219f6d90fa99692a79fc7cb36b7
Bug-Url: https://bugzilla.redhat.com/1146457
Related-To: https://bugzilla.redhat.com/1136061
Signed-off-by: Juan Hernandez <juan.hernandez at redhat.com>
(cherry picked from commit 978491cf412c9a33b9fb8624a7d5c4592dc73c73)
---
A backend/manager/modules/restapi/interface/definition/src/main/java/org/ovirt/engine/api/model/SpmState.java
M backend/manager/modules/restapi/interface/definition/src/main/resources/api.xsd
M backend/manager/modules/restapi/interface/definition/src/main/resources/rsdl_metadata.yaml
M backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendCapabilitiesResource.java
M backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/HostMapper.java
M backend/manager/modules/restapi/types/src/test/java/org/ovirt/engine/api/restapi/types/HostMapperTest.java
6 files changed, 120 insertions(+), 6 deletions(-)

Approvals:
  Juan Hernandez: Verified
  Daniel Erez: Looks good to me, approved



-- 
To view, visit http://gerrit.ovirt.org/33364
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I9bb8dba2385b1219f6d90fa99692a79fc7cb36b7
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: ovirt-engine-3.5
Gerrit-Owner: Juan Hernandez <juan.hernandez at redhat.com>
Gerrit-Reviewer: Daniel Erez <derez at redhat.com>
Gerrit-Reviewer: Juan Hernandez <juan.hernandez at redhat.com>
Gerrit-Reviewer: Piotr Kliczewski <piotr.kliczewski at gmail.com>
Gerrit-Reviewer: automation at ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server



More information about the Engine-commits mailing list