Bug 1096497

Summary: [restapi] Display image size and type for glance images missing in RESTAPI
Product: [oVirt] ovirt-engine Reporter: Gadi Ickowicz <gickowic>
Component: RestAPIAssignee: shani <sleviim>
Status: CLOSED CURRENTRELEASE QA Contact: Raz Tamir <ratamir>
Severity: medium Docs Contact:
Priority: high    
Version: 3.4.0CC: acanan, amureini, bazulay, bugs, nlevinki, oramraz, rbalakri, Rhev-m-bugs, sleviim, srevivo, ylavi
Target Milestone: ovirt-4.2.0Flags: rule-engine: ovirt-4.2+
Target Release: 4.2.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Glance images returned by the REST API now list their size and type (iso/disk).
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-12-20 10:51:28 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:

Description Gadi Ickowicz 2014-05-11 08:48:39 UTC
Description of problem:
Currently Glance images returned by RESTAPI do not list their size or type (iso/disk), however the webadmin does list this information.

Currently the only following information is returned:

<image href="/api/images/25c5e604-c517-457b-9142-2a6cdfdfefe0" id="25c5e604-c517-457b-9142-2a6cdfdfefe0">
 <actions>
  <link href="/api/images/25c5e604-c517-457b-9142-2a6cdfdfefe0/import" rel="import"/>
 </actions>
 <name>RHEL-ACTIVE</name>
</image>

Comment 3 Yaniv Lavi 2016-12-05 11:08:31 UTC
I consider gaps in REST API bugs, not feature. We should try to tackle this.

Comment 4 shani 2017-08-10 14:36:22 UTC
Bug is still valid.

Steps to Reproduce:
Using the REST API, run the following:

Method:
-------
GET

URL:
----
http://xxxxx:8080/ovirt-engine/api/storagedomains/<ovirt-image-repository-id>/images/<glance-image-id>

Response:
Response Body (Raw):
--------------------
<image href="/ovirt-engine/api/storagedomains/072fbaa1-08f3-4a40-9f34-a5ca22dd1d74/images/b393fde0-5a67-4323-a1ab-9031dd2f9b97" id="b393fde0-5a67-4323-a1ab-9031dd2f9b97">
    <actions>
        <link href="/ovirt-engine/api/storagedomains/072fbaa1-08f3-4a40-9f34-a5ca22dd1d74/images/b393fde0-5a67-4323-a1ab-9031dd2f9b97/import" rel="import"/>
    </actions>
    <name>CentOS 6 Generic Cloud Image v1604 for x86_64</name>
    <storage_domain href="/ovirt-engine/api/storagedomains/072fbaa1-08f3-4a40-9f34-a5ca22dd1d74" id="072fbaa1-08f3-4a40-9f34-a5ca22dd1d74"/>
</image>

Comment 5 Allon Mureinik 2017-09-03 09:01:19 UTC
All the patches seem to be merged, moving to MODIFIED.
Shani, if something is missing here, please advise and return the BZ to POST.

Comment 6 Raz Tamir 2017-09-04 15:15:01 UTC
Verified on ovirt-engine-4.2.0-0.0.master.20170903205106.gitb17261a.el7.centos


<size>3623878656</size>
<type>disk</type>

Are now part of image object in api/storagedomains/{sd_id}/images/{img_id}

Comment 7 Sandro Bonazzola 2017-12-20 10:51:28 UTC
This bugzilla is included in oVirt 4.2.0 release, published on Dec 20th 2017.

Since the problem described in this bug report should be
resolved in oVirt 4.2.0 release, published on Dec 20th 2017, it has been closed with a resolution of CURRENT RELEASE.

If the solution does not work for you, please open a new bug report.