Bug 822631 - REST API: unable to set cluster network as display
Summary: REST API: unable to set cluster network as display
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine-restapi
Version: 3.1.0
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: ---
: ---
Assignee: Mike Kolesnik
QA Contact: Yaniv Kaul
URL:
Whiteboard: network
: 815855 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-05-17 16:23 UTC by Avi Tal
Modified: 2016-04-22 04:59 UTC (History)
9 users (show)

Fixed In Version: si10
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-12-04 20:00:18 UTC
oVirt Team: Network
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
engine log (39.18 KB, application/x-compressed-tar)
2012-05-17 16:23 UTC, Avi Tal
no flags Details

Description Avi Tal 2012-05-17 16:23:23 UTC
Created attachment 585267 [details]
engine log

Unable to update clusters/id/networks/id <usages> collection.

existing: <usages><usage>DISPLAY</usage><usage>VM</usage></usages>
sending: <usages><usage>VM</usage></usages>
the purpose is to remove DISPLAY by not sending it in the collection 

using PUT /api/clusters/id/networks/id

received 200 but without removing the DISPLAY
<usages><usage>DISPLAY</usage><usage>VM</usage></usages>

the only way i can remove the DISPLAY usage is to update the old property 
<display>true</display> 
moving from true to false and send with PUT will return:
            <display>false</display>
            <usages>
                    <usage>VM</usage>
            </usages>

Comment 1 Avi Tal 2012-05-17 16:26:51 UTC
it is true also for adding DISPLAY. working only when using the old property <display>

Comment 2 Mike Kolesnik 2012-06-13 08:05:53 UTC
Seems related to this commit: 6c3a4563be178fe9ec178ff18f4b4730fde80349

By that logic, <display> tag takes precedence over the <usages> tag.

If you only use <usages> tag, is there still a bug?

Comment 4 Avi Tal 2012-06-13 09:21:15 UTC
Two scenarios:
1. unset Cluster Network display:

PUT http://<rhevm address>/api/clusters/<id>/networks/<id>
<network>
        <name>sw1</name>
        <usages>
                <usage>VM</usage>
        </usages>
</network>

Response: 200 PUT
    <network ...>
            <name>sw1</name>
            <data_center ...\>
            <cluster .../>
            <stp>false</stp>
            <status>
                    <state>non_operational</state>
            </status>
            <display>true</display>
            <mtu>0</mtu>
            <usages>
                    <usage>DISPLAY</usage>
                    <usage>VM</usage>
            </usages>
            <required>true</required>
    </network>
==========================
2. set  cluster as display:
PUT http://<rhevm address>/api/clusters/<id>/networks/<id>
<network>
        <name>sw1</name>
        <usages>
                <usage>VM</usage>
                <usage>DISPLAY</usage>
        </usages>
</network>

Response: 200 PUT
    <network ...>
            <name>sw1</name>
            <data_center ...\>
            <cluster .../>
            <stp>false</stp>
            <status>
                    <state>non_operational</state>
            </status>
            <display>false</display>
            <mtu>0</mtu>
            <usages>
                    <usage>VM</usage>
            </usages>
            <required>true</required>
    </network>



Note: the problem is that the old <display></display>  element takes over usages  collection settings and in order to configure display we must set the <display> element.

Comment 5 Mike Kolesnik 2012-07-09 07:19:47 UTC
http://gerrit.ovirt.org/#/c/5513

Comment 7 Avi Tal 2012-07-17 10:30:46 UTC
Verify on SI19 - PASS

i was able to set and unset display network only by using <usages> collection 

set display:
<network>
        <usages>
                <usage>DISPLAY</usage>
        </usages>
</network>

unset display:
<network>
        <usages>
                <usage>VM</usage>
        </usages>
</network>

BTW, is automatically configure <display> attribute which is great.

Comment 8 Avi Tal 2012-07-18 16:08:32 UTC
*** Bug 815855 has been marked as a duplicate of this bug. ***


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