Bug 1132493 - [GUI over REST API gaps] missing GetVmsByStorageDomain
Summary: [GUI over REST API gaps] missing GetVmsByStorageDomain
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine-restapi
Version: 3.5.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: 3.5.0
Assignee: Allon Mureinik
QA Contact: Aharon Canan
URL:
Whiteboard: storage
Depends On:
Blocks: 1132506
TreeView+ depends on / blocked
 
Reported: 2014-08-21 12:44 UTC by Einav Cohen
Modified: 2016-02-10 20:22 UTC (History)
15 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-10-21 18:32:34 UTC
oVirt Team: Storage
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

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.


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