Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1104085 - add new DataCenter mandatory/optional arguments discrepancy.
Summary: add new DataCenter mandatory/optional arguments discrepancy.
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine-restapi
Version: 3.5.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: 3.5.0
Assignee: Juan Hernández
QA Contact: Raz Tamir
URL:
Whiteboard: storage
Depends On:
Blocks: rhev3.5beta 1156165
TreeView+ depends on / blocked
 
Reported: 2014-06-03 09:08 UTC by Martin Mucha
Modified: 2016-02-10 16:40 UTC (History)
13 users (show)

Fixed In Version: ovirt-3.5.0-beta2
Doc Type: Bug Fix
Doc Text:
Cause: The concept of the type of storage of a Data Center has been removed, and replaced by the concept of "local" or "shared" Data Centers. A "local" Data Center may use any kind of locally attached storage. A "shared" Data Center may use any kind of network attached storage (NFS, for example) or storage are network (iSCSI or Fibre Channel, for example). In the RESTAPI this new concept is represented by a new "local" element inside the "data_center" element. Its value should be "true" or "false". This new "local" element isn't correctly documented in the RSDL of the RESTAPI, it should be documented as mandatory for creating a new Data Center but it is documented as optional. Consequence: Calls to the RESTAPI that don't include the new "local" element will unexpectedly fail. Fix: Document the new "local" element as mandatory. Result: The RSDL will explicitly indicate that the new "local" element is mandatory.
Clone Of:
Environment:
Last Closed:
oVirt Team: Storage
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
oVirt gerrit 29938 master MERGED restapi: Fix parameters of add DataCenter Never
oVirt gerrit 30092 ovirt-engine-3.5 MERGED restapi: Fix parameters of add DataCenter Never

Description Martin Mucha 2014-06-03 09:08:17 UTC
Description of problem:

following operation definition from rsdl_metadata.yaml is not valid.
* datacenter.version.major: 'xs:int' and datacenter.version.minor: 'xs:int' isn't actually mandatory — when called without them, code will neigher complaint nor fail.
*  datacenter.local: xs:boolean  is actually mandatory, since call will fail when not specified. That makes it mandatory argument *and* probably corrupts backward compatibility, since formerly optional argument is now mandatory.


- name: /datacenters|rel=add
  description: add a new data center to the system
  request:
    body:
      parameterType: DataCenter
      signatures:
      - mandatoryArguments: {datacenter.name: 'xs:string', datacenter.version.major: 'xs:int', datacenter.version.minor: 'xs:int'}
        optionalArguments:
          datacenter.storage_type--DEPRECATED: xs:string
          datacenter.local: xs:boolean
          datacenter.description: xs:string
          datacenter.comment: xs:string
          datacenter.storage_format: xs:string
        description: add a new data center to the system
    urlparams: {}
    headers:
      Content-Type: {value: application/xml|json, required: true}
      Expect: {value: 201-created, required: false}
      Correlation-Id: {value: 'any string', required: false}
Version-Release number of selected component (if applicable):


How reproducible:
100%

Steps to Reproduce:
1. issue respective posts (which probably should be puts) to .../api/datacenters

Comment 1 Juan Hernández 2014-06-03 18:18:46 UTC
Eli, I think that the version has been made optional in the backend recently. Can you update the RESTAPI metadata as well?

Comment 2 Juan Hernández 2014-06-03 18:20:37 UTC
Tal, I'm not sure about the "local" property, we are explicitly checking it, but only if not present, that is a bit strange. I guess that it is mandatory in the backend. Can you confirm?

Comment 3 Juan Hernández 2014-06-03 18:22:06 UTC
I'm changing the bug to the storage whiteboard because I think that the more relevant issue here is the mandatory/optional status of the "local" property.

Comment 4 Tal Nisan 2014-06-05 08:54:25 UTC
It is mandatory basically since we need to know whether it's a local DC or a shared one, we can have a default behavior and then make it optional

Comment 5 Juan Hernández 2014-06-05 09:02:05 UTC
Then we need to fix the RSDL metadata, something like this:

diff --git a/backend/manager/modules/restapi/interface/definition/src/main/resources/rsdl_metadata.yaml b/backend/manager/modules/restapi/interface/definition/src/main/resources/rsdl_metadata.yaml
index 40b331f..8091876 100644
--- a/backend/manager/modules/restapi/interface/definition/src/main/resources/rsdl_metadata.yaml
+++ b/backend/manager/modules/restapi/interface/definition/src/main/resources/rsdl_metadata.yaml
@@ -1937,10 +1937,9 @@ actions:
     body:
       parameterType: DataCenter
       signatures:
-      - mandatoryArguments: {datacenter.name: 'xs:string', datacenter.version.major: 'xs:int', datacenter.version.minor: 'xs:int'}
+      - mandatoryArguments: {datacenter.name: 'xs:string', datacenter.version.major: 'xs:int', datacenter.version.minor: 'xs:int', datacenter.local: 'xs:boolean'}
         optionalArguments:
           datacenter.storage_type--DEPRECATED: xs:string
-          datacenter.local: xs:boolean
           datacenter.description: xs:string
           datacenter.comment: xs:string
           datacenter.storage_format: xs:string

Comment 6 Juan Hernández 2014-07-11 11:11:36 UTC
According to the previous comments the version number is optional and the "local" attribute is mandatory.

Comment 7 Raz Tamir 2014-07-29 08:58:32 UTC
Verified - 
POST body: (No local)

<data_center>
<name>dc1</name>
<storage_format>v3</storage_format>
</data_center>

Response body:

<fault>
<reason>Incomplete parameters</reason>
<detail>DataCenter [local] required for add</detail>
</fault>

Comment 8 Tal Nisan 2014-11-26 11:39:54 UTC
Please supply doc text

Comment 9 Allon Mureinik 2015-02-16 19:13:27 UTC
RHEV-M 3.5.0 has been released, closing this bug.

Comment 10 Allon Mureinik 2015-02-16 19:13:28 UTC
RHEV-M 3.5.0 has been released, closing this bug.


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