Bug 1104085
| Summary: | add new DataCenter mandatory/optional arguments discrepancy. | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Virtualization Manager | Reporter: | Martin Mucha <mmucha> |
| Component: | ovirt-engine-restapi | Assignee: | Juan Hernández <juan.hernandez> |
| Status: | CLOSED CURRENTRELEASE | QA Contact: | Raz Tamir <ratamir> |
| Severity: | unspecified | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 3.5.0 | CC: | acanan, amureini, bazulay, emesika, gklein, iheim, juan.hernandez, oramraz, rbalakri, Rhev-m-bugs, scohen, tnisan, yeylon |
| Target Milestone: | --- | ||
| Target Release: | 3.5.0 | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | storage | ||
| 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.
|
Story Points: | --- |
| Clone Of: | Environment: | ||
| Last Closed: | Type: | Bug | |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | Storage | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
| Bug Depends On: | |||
| Bug Blocks: | 1142923, 1156165 | ||
Eli, I think that the version has been made optional in the backend recently. Can you update the RESTAPI metadata as well? 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? 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. 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 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
According to the previous comments the version number is optional and the "local" attribute is mandatory. 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> Please supply doc text RHEV-M 3.5.0 has been released, closing this bug. RHEV-M 3.5.0 has been released, closing this bug. |
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