Bug 1357987 - In v4, GET to /disks/{disk:id} returns property <active>
Summary: In v4, GET to /disks/{disk:id} returns property <active>
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: RestAPI
Version: 4.0.1.1
Hardware: Unspecified
OS: Unspecified
high
low
Target Milestone: ovirt-4.0.2
: 4.0.2.4
Assignee: Idan Shaby
QA Contact: Raz Tamir
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-07-19 18:16 UTC by Carlos Mestre González
Modified: 2016-08-12 14:30 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-08-12 14:30:51 UTC
oVirt Team: Storage
Embargoed:
rule-engine: ovirt-4.0.z+
rule-engine: blocker+
ylavi: planning_ack+
amureini: devel_ack+
acanan: testing_ack+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 61737 0 master MERGED restapi: remove the "active" property from Disk 2016-08-02 07:46:42 UTC
oVirt gerrit 61738 0 master MERGED Remove the "active" property from Disk 2016-08-01 18:29:36 UTC
oVirt gerrit 61787 0 model_4.0 MERGED Remove the "active" property from Disk 2016-08-01 19:33:26 UTC
oVirt gerrit 61803 0 ovirt-engine-4.0 MERGED restapi: remove the "active" property from Disk 2016-08-02 08:09:11 UTC
oVirt gerrit 61812 0 ovirt-engine-4.0.2 MERGED restapi: remove the "active" property from Disk 2016-08-02 08:09:25 UTC

Description Carlos Mestre González 2016-07-19 18:16:39 UTC
Description of problem:
In v4, GET to  /disks/{disk:id} returns property <active> (when this is now part of /vms/{vm:id}/diskattachments/{disk:id}, what is worst, is always return as 'false' even though the disk is active.

Version-Release number of selected component (if applicable):
rhevm-4.0.1.1-0.1.el7ev.noarch

How reproducible:
100%

Steps to Reproduce:
1. Create a vm with a disk attached to it
2. GET /ovirt-engine/api/v4/vms/{vm:id}/diskattachments shows the disk as active
3. GET  /ovirt-engine/api/v4/disk/{disk:id}/

Actual results:
the values return contain the property:
<active>False</active>

Expected results:
No property <active> is returned since this is only meaningful on with the relation with the vm (diskattachments)

Comment 1 Juan Hernández 2016-07-19 18:30:43 UTC
The disk "active" and "interface" attributes have been moved to the disk attachment, so they should now be removed completely from the "Disk" type, first in the specification of the API, then in the implementation.

Comment 2 Allon Mureinik 2016-07-19 19:42:24 UTC
(In reply to Juan Hernández from comment #1)
> The disk "active" and "interface" attributes have been moved to the disk
> attachment, so they should now be removed completely from the "Disk" type,
> first in the specification of the API, then in the implementation.
Yup, agreed.
Tal?

Comment 3 Red Hat Bugzilla Rules Engine 2016-07-19 19:42:31 UTC
Bug tickets must have version flags set prior to targeting them to a release. Please ask maintainer to set the correct version flags and only then set the target milestone.

Comment 4 Tal Nisan 2016-07-20 08:20:26 UTC
(In reply to Allon Mureinik from comment #2)
> (In reply to Juan Hernández from comment #1)
> > The disk "active" and "interface" attributes have been moved to the disk
> > attachment, so they should now be removed completely from the "Disk" type,
> > first in the specification of the API, then in the implementation.
> Yup, agreed.
> Tal?

Agreed

Comment 5 Carlos Mestre González 2016-07-20 12:31:59 UTC
Hi Tal,

I encountered another issue that I think is not consistent relevant to active.

Trying to attach a disk:

<disk_attachment >
  <interface>ide</interface>
  <active>true</active>
  <disk id="5a8d9ebf-05f0-4eb7-9a73-f29ca2c1d1fd"> </disk>
</disk_attachment>
===> disk is attached but not activated

<disk_attachment >
  <interface>ide</interface>
  <disk id="5a8d9ebf-05f0-4eb7-9a73-f29ca2c1d1fd"><active>true</active> </disk>
</disk_attachment>
==> disk is attached and activated

since <active> only makes sense with disk attachment and is return in diskattachment GET, shouldn't this property be also pass as disk_attachment instead of inside the disk to make it consistent?

Comment 7 Tal Nisan 2016-07-31 10:54:40 UTC
Carlos, there's might be a point here but perhaps open another but to discuss that?

Comment 8 Carlos Mestre González 2016-08-02 08:41:29 UTC
Hi Tal,

According to Juan's comment, active attribute should be removed from Disk type, shouldn't this also 'fix' the issue I mentioned on comment 5? why open a new bug?

Comment 9 Tal Nisan 2016-08-02 12:30:46 UTC
The property was indeed removed from the disk, I meant that if it doesn't work as expected while sending it through the attachment please open a separate bug for that

Comment 10 Raz Tamir 2016-08-07 16:34:32 UTC
Verified on ovirt-engine-4.0.2.4-0.1.el7ev.noarch


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