Bug 1303346

Summary: XSD value object requires at least 1 occurrence of datum but doesnt always have it in nic statistics
Product: [oVirt] ovirt-engine Reporter: Nelly Credi <ncredi>
Component: RestAPIAssignee: Juan Hernández <juan.hernandez>
Status: CLOSED CURRENTRELEASE QA Contact: Petr Matyáš <pmatyas>
Severity: low Docs Contact:
Priority: unspecified    
Version: 3.6.3CC: bugs, gklein, grafuls, lsvaty, oourfali
Target Milestone: ovirt-4.1.0-betaKeywords: Automation, Reopened
Target Release: 4.1.0Flags: rule-engine: ovirt-4.1+
rule-engine: planning_ack+
juan.hernandez: devel_ack+
pstehlik: testing_ack+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ovirt 4.0.0 alpha1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-02-01 14:48:54 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Infra RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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:
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 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:
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 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">
    <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 17:03:30 UTC
Verified on 4.1.0-9 using RESTApi v3 and v4, datum is always present on my setup