Bug 1303346 - XSD value object requires at least 1 occurrence of datum but doesnt always have it in nic statistics
XSD value object requires at least 1 occurrence of datum but doesnt always ha...
Status: CLOSED CURRENTRELEASE
Product: ovirt-engine
Classification: oVirt
Component: RestAPI (Show other bugs)
3.6.3
Unspecified Unspecified
unspecified Severity low (vote)
: ovirt-4.1.0-beta
: 4.1.0
Assigned To: Juan Hernández
Petr Matyáš
: Automation, Reopened
: 1376078 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2016-01-31 04:20 EST by Nelly Credi
Modified: 2017-04-04 08:02 EDT (History)
5 users (show)

See Also:
Fixed In Version: ovirt 4.0.0 alpha1
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2017-02-01 09:48:54 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: Infra
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
rule-engine: ovirt‑4.1+
rule-engine: planning_ack+
juan.hernandez: devel_ack+
pstehlik: testing_ack+


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
oVirt gerrit 52916 master MERGED restapi: Avoid empty statistic values 2016-02-08 12:16 EST

  None (edit)
Description Nelly Credi 2016-01-31 04:20:23 EST
Description of problem:
XSD value object requires at least 1 occurrence of datum 


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


How reproducible:
100%

Steps to Reproduce:
1./api/vms/UUID/nics/UUID

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">
            <name>data.total.tx</name>
            <description>Total transmitted data</description>
            <values type="INTEGER">
                <value/>
            </values>
            <type>COUNTER</type>
            <unit>BYTES</unit>
            <nic href="/api/vms/08bd4c24-e5d6-450d-8f29-424f243becec/nics/b969ddf6-7ea3-4815-aeb6-96d8b1573e85" id="b969ddf6-7ea3-4815-aeb6-96d8b1573e85"/>
        </statistic>

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

Additional info:
from XSD:
<xs:complexType name="Value">
    <xs:sequence>
      <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 -->
    </xs:sequence>
  </xs:complexType>
Comment 1 Lukas Svaty 2016-07-26 07:04:41 EDT
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 10:12:46 EDT
*** Bug 1376078 has been marked as a duplicate of this bug. ***
Comment 3 Gonza 2016-09-30 05:05:34 EDT
Failed on:
rhevm-4.0.4.4-0.1.el7ev.noarch
ovirt-engine-sdk-python-3.6.8.0-1.el7ev.noarch
Comment 4 Red Hat Bugzilla Rules Engine 2016-09-30 05:05:40 EDT
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 14:05:35 EST
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">
    <name>data.total.tx</name>
    <description>Total transmitted data</description>
    <values type="INTEGER"/>
    <type>COUNTER</type>
    <unit>BYTES</unit>
    <nic href="/ovirt-engine/api/v3/vms/fccbbb48-6e04-4bc6-a8f5-c2020b6c5505/nics/b1ab9480-2250-4b7e-9015-a1b871f273a3" id="b1ab9480-2250-4b7e-9015-a1b871f273a3"/>
  </statistic>

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">
    <name>data.total.tx</name>
    <description>Total transmitted data</description>
    <kind>counter</kind>
    <type>integer</type>
    <unit>bytes</unit>
    <values/>
    <nic href="/ovirt-engine/api/vms/fccbbb48-6e04-4bc6-a8f5-c2020b6c5505/nics/b1ab9480-2250-4b7e-9015-a1b871f273a3" id="b1ab9480-2250-4b7e-9015-a1b871f273a3"/>
  </statistic>

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

Can please check again?
Comment 6 Petr Matyáš 2017-01-31 12:03:30 EST
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.