Change in ovirt-engine[ovirt-engine-3.5]: restapi: The "isattached" action should return an action object

tnisan at redhat.com tnisan at redhat.com
Tue Jun 30 10:58:55 UTC 2015


Tal Nisan has submitted this change and it was merged.

Change subject: restapi: The "isattached" action should return an action object
......................................................................


restapi: The "isattached" action should return an action object

Currently the "isattached" action of the storage domain resource returns
a storage domain object. For example, the following HTTP request:

  POST /api/storagedomains/{storagedomain:id}/isattached
  <action>
    <host id="{host:id}"/>
  </action>

Returns the following response:

  <storage_domain id="{storagedomain:id}">
    <is_attached>true</is_attached>
  </storage_domain>

This isn't correct, because all actions are expected to return an action
object. Returning something different causes issues in the SDKs. The
returned result should look like this:

  <action>
    <status>
      <state>complete</state>
    </status>
    <is_attached>true</is_attached>
  </action>

There is no need to return the storage domain object, only the
"is_attached" flag, and it should be an attribute of the action object,
not of the storage domain.

This patch modifies the storage domain resource so that this action
works as described above.

Change-Id: I4033daddfca8f6d25ee2a1efd03fa2b65a48c6f4
Bug-Url: https://bugzilla.redhat.com/1234937
Signed-off-by: Juan Hernandez <juan.hernandez at redhat.com>
Signed-off-by: Maor Lipchuk <mlipchuk at redhat.com>
---
M backend/manager/modules/restapi/interface/definition/src/main/resources/api.xsd
M backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendStorageDomainResource.java
2 files changed, 28 insertions(+), 21 deletions(-)

Approvals:
  Juan Hernandez: Looks good to me, but someone else must approve
  Jenkins CI: Passed CI tests
  Allon Mureinik: Looks good to me, approved
  Maor Lipchuk: Verified



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

Gerrit-MessageType: merged
Gerrit-Change-Id: I4033daddfca8f6d25ee2a1efd03fa2b65a48c6f4
Gerrit-PatchSet: 4
Gerrit-Project: ovirt-engine
Gerrit-Branch: ovirt-engine-3.5
Gerrit-Owner: Maor Lipchuk <mlipchuk at redhat.com>
Gerrit-Reviewer: Allon Mureinik <amureini at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Juan Hernandez <juan.hernandez at redhat.com>
Gerrit-Reviewer: Maor Lipchuk <mlipchuk at redhat.com>
Gerrit-Reviewer: Tal Nisan <tnisan at redhat.com>
Gerrit-Reviewer: automation at ovirt.org



More information about the Engine-commits mailing list