Bug 1303346 - XSD value object requires at least 1 occurrence of datum but doesnt always have it in nic statistics
Summary: XSD value object requires at least 1 occurrence of datum but doesnt always ha...
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: RestAPI
Version: 3.6.3
Hardware: Unspecified
OS: Unspecified
Target Milestone: ovirt-4.1.0-beta
: 4.1.0
Assignee: Juan Hernández
QA Contact: Petr Matyáš
: 1376078 (view as bug list)
Depends On:
TreeView+ depends on / blocked
Reported: 2016-01-31 09:20 UTC by Nelly Credi
Modified: 2017-04-04 12:02 UTC (History)
5 users (show)

Fixed In Version: ovirt 4.0.0 alpha1
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2017-02-01 14:48:54 UTC
oVirt Team: Infra
rule-engine: ovirt-4.1+
rule-engine: planning_ack+
juan.hernandez: devel_ack+
pstehlik: testing_ack+

Attachments (Terms of Use)

System ID Private Priority Status Summary Last Updated
oVirt gerrit 52916 0 master MERGED restapi: Avoid empty statistic values 2016-02-08 17:16:24 UTC

Description Nelly Credi 2016-01-31 09:20:23 UTC
Description of problem:
XSD value object requires at least 1 occurrence of datum 

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:

Actual results:
only some statistics objects have the datum

<statistic href="/api/vms/08bd4c24-e5d6-450d-8f29-424f243becec/nics/b969ddf6-7ea3-4815-aeb6-96d8b1573e85/statistics/4d75baca-1fc9-3b19-b44f-6d32abda3888" id="4d75baca-1fc9-3b19-b44f-6d32abda3888">
            <description>Total transmitted data</description>
            <values type="INTEGER">
            <nic href="/api/vms/08bd4c24-e5d6-450d-8f29-424f243becec/nics/b969ddf6-7ea3-4815-aeb6-96d8b1573e85" id="b969ddf6-7ea3-4815-aeb6-96d8b1573e85"/>

Expected results:
all should have datum or the minOccurs should change to "0"

Additional info:
from XSD:
<xs:complexType name="Value">
      <xs:element name="datum" type="xs:decimal" minOccurs="1" maxOccurs="1"/>
      <xs:element name="detail" type="xs:string" minOccurs="0" maxOccurs="1"/>
      <!-- will in the future also include a timestamp element,
           when historical data is supported -->

Comment 1 Lukas Svaty 2016-07-26 11:04:41 UTC
This bug was fixed and is slated to be in the upcoming version. As we
are focusing our testing at this phase on severe bugs, this bug was
closed without going through its verification step. If you think this
bug should be verified by QE, please set its severity to high and move
it back to ON_QA

Comment 2 Juan Hernández 2016-09-15 14:12:46 UTC
*** Bug 1376078 has been marked as a duplicate of this bug. ***

Comment 3 Gonza 2016-09-30 09:05:34 UTC
Failed on:

Comment 4 Red Hat Bugzilla Rules Engine 2016-09-30 09:05:40 UTC
Target release should be placed once a package build is known to fix a issue. Since this bug is not modified, the target version has been reset. Please use target milestone to plan a fix for a oVirt release.

Comment 5 Juan Hernández 2016-12-13 19:05:35 UTC
Unfortunately I can't reproduce this. I installed exactly the same version of the engine, and this is what I get:

  <statistic href="/ovirt-engine/api/v3/vms/fccbbb48-6e04-4bc6-a8f5-c2020b6c5505/nics/b1ab9480-2250-4b7e-9015-a1b871f273a3/statistics/4d75baca-1fc9-3b19-b44f-6d32abda3888" id="4d75baca-1fc9-3b19-b44f-6d32abda3888">
    <description>Total transmitted data</description>
    <values type="INTEGER"/>
    <nic href="/ovirt-engine/api/v3/vms/fccbbb48-6e04-4bc6-a8f5-c2020b6c5505/nics/b1ab9480-2250-4b7e-9015-a1b871f273a3" id="b1ab9480-2250-4b7e-9015-a1b871f273a3"/>

That is with version 3 of the API. Note the empty <values .../> tag, no empty <datum/> inside.

With version 4 of the API is very similar:

  <statistic href="/ovirt-engine/api/vms/fccbbb48-6e04-4bc6-a8f5-c2020b6c5505/nics/b1ab9480-2250-4b7e-9015-a1b871f273a3/statistics/4d75baca-1fc9-3b19-b44f-6d32abda3888" id="4d75baca-1fc9-3b19-b44f-6d32abda3888">
    <description>Total transmitted data</description>
    <nic href="/ovirt-engine/api/vms/fccbbb48-6e04-4bc6-a8f5-c2020b6c5505/nics/b1ab9480-2250-4b7e-9015-a1b871f273a3" id="b1ab9480-2250-4b7e-9015-a1b871f273a3"/>

Note the empty <values/> element, no empty <datum/> inside.

Can please check again?

Comment 6 Petr Matyáš 2017-01-31 17:03:30 UTC
Verified on 4.1.0-9 using RESTApi v3 and v4, datum is always present on my setup

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