Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1077678 - Inconsistency in Snapshot collections links and Snapshot object
Summary: Inconsistency in Snapshot collections links and Snapshot object
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine-restapi
Version: 3.4.0
Hardware: Unspecified
OS: Unspecified
medium
high
Target Milestone: ---
: 3.5.0
Assignee: Liron Aravot
QA Contact: Raz Tamir
URL:
Whiteboard: storage
Depends On:
Blocks: rhev3.5beta 1156165
TreeView+ depends on / blocked
 
Reported: 2014-03-18 12:04 UTC by Raz Tamir
Modified: 2016-02-10 18:20 UTC (History)
16 users (show)

Fixed In Version: org.ovirt.engine-root-3.5.0-4
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-02-16 19:11:10 UTC
oVirt Team: Storage
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
oVirt gerrit 28739 master MERGED core: correct path for snapshot links Never
oVirt gerrit 29927 ovirt-engine-3.5 MERGED core: correct path for snapshot links Never

Description Raz Tamir 2014-03-18 12:04:14 UTC
Description of problem:
The <snapshot> XML that you receive from the API is currently looks like:

<snapshot href="/api/vms/086b5092-71d6-4cfa-b73d-d32bff2890cb/snapshots/93d8fc6e-bdcf-4726-b1c5-8c5c24f8a783" id="93d8fc6e-bdcf-4726-b1c5-8c5c24f8a783">
  <description>1</description>
  <type>regular</type>
  <vm id="086b5092-71d6-4cfa-b73d-d32bff2890cb">
     <name>elad2-3</name>
     <description/>
     <link href="/api/vms/086b5092-71d6-4cfa-b73d-d32bff2890cb/snapshots/93d8fc6e-bdcf-4726-b1c5-8c5c24f8a783/cdroms" rel="cdroms"/>
     <link href="/api/vms/086b5092-71d6-4cfa-b73d-d32bff2890cb/snapshots/93d8fc6e-bdcf-4726-b1c5-8c5c24f8a783/disks" rel="disks"/>
     <link href="/api/vms/086b5092-71d6-4cfa-b73d-d32bff2890cb/snapshots/93d8fc6e-bdcf-4726-b1c5-8c5c24f8a783/nics" rel="nics"/>
     <type>server</type>
     ... *more stuff not relevant for this bug*
  </vm>
</snapshot>

The links points directly with the URL to the collections (i.e. cdroms, disks, nics) being under the snapshot object, which is not consistence with the xml object which is <snapshot>....<vm><link ....=/collection/></vm></snapshot>.


Version-Release number of selected component (if applicable):
rhevm-3.4.0-0.3.master.el6ev.noarch
rhevm-restapi-3.4.0-0.3.master.el6ev.noarch

How reproducible:
100%

Steps to Reproduce:
1. Create a snapshot of vm with disk
2. from REST api go to: /api/vms/<vm_id>/snapshots/<snapshot_id>/
3. The links are located under <vm> ... </vm>

Actual results:
The links are found under vm: <snapshot>....<vm><link ....=/collection/></vm></snapshot>.
And a link to disks collection (for example) is:
<link href="/api/vms/086b5092-71d6-4cfa-b73d-d32bff2890cb/snapshots/93d8fc6e-bdcf-4726-b1c5-8c5c24f8a783/disks" rel="disks"/>
which is not consistence with the xml object

Expected results:
All links should be directly under snapshot and not under vm

Additional info:

Comment 1 Allon Mureinik 2014-03-18 22:54:32 UTC
Liron, any thoughts on the matter?

Comment 2 Michael Pasternak 2014-06-23 13:05:42 UTC
i don't think this is a bug, URI structure does not have to be 1:1 with
object representation,

(also there is no much sense in mentioning vm in url once again cause it already represented by 086b5092-71d6-4cfa-b73d-d32bff2890cb identifier)

as long as representation self descriptive and let accessing related resources
via links it holds, it's okay from the REST PoV,

so bottom line IMHO it's not a bug.

Comment 3 Allon Mureinik 2014-06-23 22:15:28 UTC
Ori/Michael - up to you guys.
Please either close this bug or move forward with the proposed patch.

Thanks!

Comment 4 Allon Mureinik 2014-07-10 18:30:16 UTC
What's the verdict on this one?

Comment 5 Raz Tamir 2014-07-17 14:36:24 UTC
Verified on:
ovirt-engine-3.5.0-0.0.master.20140715172116.git4687dc1.el6.noarch
ovirt-engine-restapi-3.5.0-0.0.master.20140715172116.git4687dc1.el6.noarch

Comment 7 Allon Mureinik 2015-02-16 19:11:10 UTC
RHEV-M 3.5.0 has been released, closing this bug.

Comment 8 Allon Mureinik 2015-02-16 19:11:23 UTC
RHEV-M 3.5.0 has been released, closing this bug.


Note You need to log in before you can comment on or make changes to this bug.