Bug 1132493

Summary: [GUI over REST API gaps] missing GetVmsByStorageDomain
Product: Red Hat Enterprise Virtualization Manager Reporter: Einav Cohen <ecohen>
Component: ovirt-engine-restapiAssignee: Allon Mureinik <amureini>
Status: CLOSED CURRENTRELEASE QA Contact: Aharon Canan <acanan>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 3.5.0CC: amureini, bazulay, derez, ecohen, gklein, iheim, juan.hernandez, lsurette, oramraz, rbalakri, Rhev-m-bugs, scohen, tnisan, yeylon, ykaul
Target Milestone: ---   
Target Release: 3.5.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: storage
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-10-21 18:32:34 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Storage RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1132506    

Description Einav Cohen 2014-08-21 12:44:55 UTC
we are missing a way to invoke the GetVmsByStorageDomain query in the REST API. 
this query is being used in the GUI in the 'Storage -> VMs' sub-tab. 

[I assume that this query returns all of the VMs that contain disks/snapshots that reside on the specified Storage Domain, including that disks/snapshots information; not sure if we have a way to represent all of this data in a rest api response]

Comment 1 Juan Hernández 2014-10-21 18:32:34 UTC
This is already possible combining a query, the "All-Content" header and the "detail" parameter of the "Accept" header:

#!/bin/sh -ex

url="https://ovirt.example.com/ovirt-engine/api"
user="admin@internal"
password="******"

curl \
--verbose \
--insecure \
--user "${user}:${password}" \
--header "Accept: application/xml; detail=disks" \
--header "All-Content: true" \
"${url}/vms?search=storage.name%3Dmydata"

Note the "detail=disks" parameter of the "Accept" header, this is what trigges population of the disks collection inline. It is also already implemented for "nics", "statistics" and "tags".

Also note that the query used is "storage.name=mydata". It would be more convenient to use identifiers instead of names, but this isn't currently implemented in the backend search engine.