Bug 1132247 - [GUI over REST API gaps] missing GetNumberOfActiveVmsInVdsGroupByVdsGroupId
Summary: [GUI over REST API gaps] missing GetNumberOfActiveVmsInVdsGroupByVdsGroupId
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine
Version: 3.5.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ovirt-3.6.0-rc
: 3.6.0
Assignee: Juan Hernández
QA Contact: sefi litmanovich
URL:
Whiteboard:
Depends On:
Blocks: 1132506
TreeView+ depends on / blocked
 
Reported: 2014-08-21 01:51 UTC by Einav Cohen
Modified: 2016-04-20 01:10 UTC (History)
10 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-04-20 01:10:12 UTC
oVirt Team: Virt
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1132249 0 unspecified CLOSED [GUI over REST API gaps] missing GetVmTemplateCount 2021-02-22 00:41:40 UTC
oVirt gerrit 34589 0 master MERGED restapi: Add "size" support to VMs Never

Internal Links: 1132249

Description Einav Cohen 2014-08-21 01:51:12 UTC
we are missing a way to invoke the GetNumberOfActiveVmsInVdsGroupByVdsGroupId query in the rest api. 
the problematic issue here is for the rest-api to return a number, rather than a resource. 

we can work-around this particular issue by retrieving the relevant VMs and count them, but this may result in a huge response traffic (e.g. 1000 VMs) just for ultimately receiving a number (e.g. "1000").

Comment 1 Juan Hernández 2014-10-21 18:45:22 UTC
Retrieving the VMs active of a particular cluster is already, possible using a query:

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

curl \
--verbose \
--insecure \
--request GET \
--user "${user}:${password}" \
--header "Accept: application/xml" \
"${url}/vms?search=status%3Dup%20and%20cluster%3Dmycluster"

Retrieving only the size will be possible using the new "size" attribute that will be introduced to fix bug 1132249. So what remains to be done is adding support for this attribute to the top level VMs collection.

Comment 2 sefi litmanovich 2015-06-01 16:22:12 UTC
Verified with ovirt-engine-3.6.0-0.0.master.20150519172219.git9a2e2b3.el6.noarch

Have a setup with a cluster + host + 7 vms - 1 up 6 down.

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

curl \
--verbose \
--insecure \
--request GET \
--user "${user}:${password}" \
--header "Accept: application/xml" \
"${url}/vms;details=+size"

response:
<vms> 
<size>7</size> 
<vm id="..." href="..."> ... 
</vm> 
... </vms>

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

curl \
--verbose \
--insecure \
--request GET \
--user "${user}:${password}" \
--header "Accept: application/xml" \
"${url}/vms;details=+size?search=status%3Dup%20and%20cluster%3Dmycluster"

response:
<vms> 
<size>1</size> 
<vm id="..." href="..."> ... 
</vm> 
... </vms>


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