Bug 817793 - REST API: an Empty <usage/> element shouldn't be displayed
Summary: REST API: an Empty <usage/> element shouldn't be displayed
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine-restapi
Version: 3.0.0
Hardware: x86_64
OS: Linux
low
medium
Target Milestone: ---
: ---
Assignee: Mike Kolesnik
QA Contact: Yaniv Kaul
URL:
Whiteboard: network
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-05-01 10:23 UTC by Avi Tal
Modified: 2016-04-22 05:00 UTC (History)
11 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-08-26 11:26:41 UTC
oVirt Team: Network
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Avi Tal 2012-05-01 10:23:51 UTC
Description of problem:
Logical network element shouldn't display an empty <usage/> element.
          <network href="/api/networks/b3f8dc81-7ae5-4d65-91e1-3ac03c43a27c" id="b3f8dc81-7ae5-4d65-91e1-3ac03c43a27c">
                    <name>sw2</name>
                    <description>my desc</description>
                    <data_center href="/api/datacenters/d1a3aa09-15d4-4131-9dc6-6575925c8177" id="d1a3aa09-15d4-4131-9dc6-6575925c8177"/>
                    <stp>false</stp>
                    <status>
                            <state>non_operational</state>
                    </status>
                    <mtu>900</mtu>
                    <usages/>
                    <required>false</required>
            </network>

Comment 2 Simon Grinberg 2012-08-26 09:25:45 UTC
What I fail to understand is what does 'Empty' stands for in the first place.
Does it mean bridge-less non display network? 

In any case a network always has a usage - if no usage is provided then it should be clearly stated: Maybe General-Purpose is a good term

What is the default value if this field is not sent during creation? This should be VM-network if you want to preserve backward compatibility with 3.0.

Comment 3 lpeer 2012-08-26 10:32:16 UTC
After discussing with QE we think the best approach is:

- If the user does not specify 'usages' in: 
 * update (PUT) we leave the values unchanged
 * new (Post) we use defaults (VM network, non display)

- If the user sends empty xml element (<usages/>) for both update and new we use NON-VM non display network.


This is the current behaviour, please reopen if you think this behaviour is problematic/ not intuitive to our users.

Comment 4 Simon Grinberg 2012-08-26 11:03:38 UTC
(In reply to comment #3)
> - If the user sends empty xml element (<usages/>) for both update and new we
> use NON-VM non display network.

So 'Empty' ==  "NON-VM non display network".
And in the future? Non-VM, non-Storage, non-migration, non display, non-something else?

Some more questions:
1. If he does not send this at all what does it defaults too?
2. Is management network (rhevm) also a usage?
3. Is this field mandatory? - If so then yes this is confusing, to send empty to indicate no specific usage. I don't think it's done anywhere except for actions.

Reopening to keep discussion going.

Comment 5 Simon Grinberg 2012-08-26 11:26:41 UTC
(In reply to comment #4)
> (In reply to comment #3)
> > - If the user sends empty xml element (<usages/>) for both update and new we
> > use NON-VM non display network.
> 
Answering my own questions since I misunderstood the response on comment #3

> So 'Empty' ==  "NON-VM non display network".
> And in the future? Non-VM, non-Storage, non-migration, non display,
> non-something else?

Yes.
 
> Some more questions:
> 1. If he does not send this at all what does it defaults too?

(VM network, non display) On POST, No-Change on PUT

> 2. Is management network (rhevm) also a usage?

No, but should be in the future.

> 3. Is this field mandatory? - If so then yes this is confusing, to send
> empty to indicate no specific usage. I don't think it's done anywhere except
> for actions.

No.

> 
> Reopening to keep discussion going.

I'm still not happy with that but it makes sense not to change it for the near version. I would say that we probably need to explicitly state 'None'. In the future when more meaningful usages be available (like storage, it may the indication of a network that is managed by the engine but has from any reason has no specific usage by the RHEV system.


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