Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 878900

Summary: REST API: discrepancy in responses between GET like api/vms and api/vms/?serach={vm_name}
Product: Red Hat Enterprise Virtualization Manager Reporter: Tareq Alayan <talayan>
Component: ovirt-engine-restapiAssignee: Michael Pasternak <mpastern>
Status: CLOSED NOTABUG QA Contact: Oded Ramraz <oramraz>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 3.1.0CC: bazulay, dyasny, ecohen, iheim, mpastern, Rhev-m-bugs, ykaul
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: virt
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-11-22 08:21:59 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
query_response
none
api/vms/id none

Description Tareq Alayan 2012-11-21 13:42:11 UTC
Description of problem:
Payloads element is missing from xml response when using ?search={query}



Steps to Reproduce:
1. Create a vm via restapi, XML:
 <vm>
    <name>vmp10</name>
    <cluster>
        <name>Default</name>
    </cluster>
    <template>
        <name>Blank</name>
     </template>
     <memory>536870912</memory>
     <os>
         <boot dev="hd"/>
     </os>
     <payloads>
         <payload type='cdrom'>
             <file name='my.txt'>
                <content>some content</content>
             </file>
         </payload>
     </payloads>
</vm>
2. GET /api/vms/{id}
3. GET /api/vms/?search={vm_name}
  
Actual results:
Result of step 2 will contain the payloads section
Result of step 3 won't contain the payloads section

Expected results:
Both should contain the payloads section

Additional info:
attached responses

Comment 1 Tareq Alayan 2012-11-21 13:42:54 UTC
Created attachment 649232 [details]
query_response

Comment 2 Tareq Alayan 2012-11-21 13:43:29 UTC
Created attachment 649233 [details]
api/vms/id

Comment 3 Itamar Heim 2012-11-21 20:54:14 UTC
not even sure this is a bug. search returns more than a single object, and in colelction mode i don't think we return all vm properties.
michael?

Comment 4 Michael Pasternak 2012-11-22 08:21:59 UTC
this is not a bug, in 3.1 on /list of entities we show entities in "reduced"
mode, on /get of entity, we show it in "extended" mode, this is done to save
traffic and backend load, 3.2 will have dedicated header (Bug 868626) to list
entities in "extended" mode.