On Thu, Jun 21, 2018 at 7:05 AM Hari Prasanth Loganathan <
[email protected]> wrote:

> the problem is, I can't write different client codes for the different
> version.
>

Well, you *can* with an if {} else {}
It just sounds like you are choosing not too :)


> Consider my case, I developed my script considering the oVirt version 4.2,
> If my client is using 4.1 then he needs the same script to be supported.
> What If the client is using further older version say 4.0, So do you want
> me to write the script for every version of oVirt. It is not correct.
>

I respectfully disagree. It's quite common for clients to adapt to multiple
versions of a library.


>
> So could you let me know, Is there a way to ignore extra properties in
> oVirt Rest API?
>

Nope. We can consider an RFE. If you are interested in submitting one,
https://bugzilla.redhat.com/enter_bug.cgi?product=ovirt-engine

We can also help you build an adaptive client if you share your source code.

Best wishes :)
Greg


>
> On Thu, Jun 21, 2018 at 4:30 PM, Ondra Machacek <[email protected]>
> wrote:
>
>> Well, I don't know what are you using to generate the JSON,
>> but you just need to check if engine is v4.1 and then send the JSON
>> without the field and if version is v4.2 and higher you can use that
>> field.
>>
>> If you share you script maybe I can advice, or if you are using any SDK.
>> It would be even simpler as you just set the field to None/null/nil and
>> it won't be generated to the XML body which SDK send.
>>
>> On 06/21/2018 12:52 PM, Hari Prasanth Loganathan wrote:
>>
>>> Thanks, Ondra for confirming.
>>>
>>> You need to handle this situation client side.
>>>
>>> So you are saying there is a work-around in client side, I didn't get
>>> this point, Could you explain, please.
>>>
>>> On Thu, Jun 21, 2018 at 4:20 PM, Ondra Machacek <[email protected]
>>> <mailto:[email protected]>> wrote:
>>>
>>>     We do not support this.
>>>
>>>     For xml we use event handler, which takes unknown fields as error:
>>>
>>>
>>>
>>> https://github.com/oVirt/ovirt-engine/blob/68753f46f09419ddcdbb632453501273697d1a20/backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/xml/JAXBProvider.java#L182
>>>     <
>>> https://github.com/oVirt/ovirt-engine/blob/68753f46f09419ddcdbb632453501273697d1a20/backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/xml/JAXBProvider.java#L182
>>> >
>>>
>>>     For json we don't have turn of the feature
>>> FAIL_ON_UNKNOWN_PROPERTIES,
>>>     you would need to put it on line 29 to make it working:
>>>
>>>
>>>
>>> https://github.com/oVirt/ovirt-engine/blob/e06859fef6c38a955a4e0e1f6b0ddaa1e8eae8fb/backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/json/CustomObjectMapper.java#L28
>>>     <
>>> https://github.com/oVirt/ovirt-engine/blob/e06859fef6c38a955a4e0e1f6b0ddaa1e8eae8fb/backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/json/CustomObjectMapper.java#L28
>>> >
>>>
>>>     You need to handle this situation client side.
>>>
>>>     On 06/21/2018 11:21 AM, Hari Prasanth Loganathan wrote:
>>>
>>>         Could somebody explain this please?
>>>
>>>         On Thu, Jun 21, 2018 at 7:41 AM, Hari Prasanth Loganathan
>>>         <[email protected]
>>>         <mailto:[email protected]>
>>>         <mailto:[email protected]
>>>         <mailto:[email protected]>>> wrote:
>>>
>>>              *Hi Ondra / Ori,*
>>>
>>>
>>> https://github.com/oVirt/ovirt-engine/search?q=FAIL_ON_UNKNOWN_PROPERTIES%2C+false%29%3B&unscoped_q=FAIL_ON_UNKNOWN_PROPERTIES%2C+false%29%3B
>>>         <
>>> https://github.com/oVirt/ovirt-engine/search?q=FAIL_ON_UNKNOWN_PROPERTIES%2C+false%29%3B&unscoped_q=FAIL_ON_UNKNOWN_PROPERTIES%2C+false%29%3B
>>> >
>>>                     <
>>> https://github.com/oVirt/ovirt-engine/search?q=FAIL_ON_UNKNOWN_PROPERTIES%2C+false%29%3B&unscoped_q=FAIL_ON_UNKNOWN_PROPERTIES%2C+false%29%3B
>>>         <
>>> https://github.com/oVirt/ovirt-engine/search?q=FAIL_ON_UNKNOWN_PROPERTIES%2C+false%29%3B&unscoped_q=FAIL_ON_UNKNOWN_PROPERTIES%2C+false%29%3B
>>> >>
>>>
>>>              Check the above link, As per the code it is always set as
>>>         false, So
>>>              is there a way in payload / headers in client API / server
>>>              configuration in oVirt engine which can ignore the extra
>>>         payload
>>>              parameters?
>>>
>>>              Any help / workaround is much appreciated.
>>>
>>>              Thanks, Greg for pointing the right ppl.
>>>
>>>              Thanks,
>>>              Hari
>>>
>>>              On Thu, Jun 21, 2018 at 1:35 AM, Greg Sheremeta
>>>         <[email protected] <mailto:[email protected]>
>>>              <mailto:[email protected] <mailto:[email protected]>>>
>>>         wrote:
>>>
>>>                  +Ondra and Ori
>>>
>>>                  On Wed, Jun 20, 2018 at 1:07 PM Hari Prasanth Loganathan
>>>                  <[email protected]
>>>         <mailto:[email protected]>
>>>                  <mailto:[email protected]
>>>         <mailto:[email protected]>>> wrote:
>>>
>>>                      Guys any update on this?  if you have any
>>>         clarification let
>>>                      me know please.
>>>
>>>                      Thanks
>>>
>>>                      On Wed, 20 Jun 2018 at 5:41 PM, Hari Prasanth
>>>         Loganathan
>>>                      <[email protected]
>>>         <mailto:[email protected]>
>>>                      <mailto:[email protected]
>>>         <mailto:[email protected]>>> wrote:
>>>
>>>                          Hi Team,
>>>
>>>                          I got one clue, using the code base :
>>>
>>> https://github.com/oVirt/ovirt-engine/blob/e2aad594a55c7272b513736616cb4b9841c2c43d/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/serialization/json/JsonObjectDeserializer.java
>>>         <
>>> https://github.com/oVirt/ovirt-engine/blob/e2aad594a55c7272b513736616cb4b9841c2c43d/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/serialization/json/JsonObjectDeserializer.java
>>> >
>>>                                 <
>>> https://github.com/oVirt/ovirt-engine/blob/e2aad594a55c7272b513736616cb4b9841c2c43d/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/serialization/json/JsonObjectDeserializer.java
>>>         <
>>> https://github.com/oVirt/ovirt-engine/blob/e2aad594a55c7272b513736616cb4b9841c2c43d/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/serialization/json/JsonObjectDeserializer.java
>>> >>
>>>
>>>
>>>
>>> formattedMapper.configure(Feature.FAIL_ON_UNKNOWN_PROPERTIES,
>>>                          false);
>>>
>>>                          As a default, this flag is set as false, then
>>>         How I get
>>>                          this error? Any idea?
>>>
>>>
>>>                          Thanks,
>>>                          Hari
>>>
>>>
>>>
>>>                          On Wed, Jun 20, 2018 at 5:21 PM, Hari Prasanth
>>>                          Loganathan <[email protected]
>>>         <mailto:[email protected]>
>>>                          <mailto:[email protected]
>>>
>>>         <mailto:[email protected]>>> wrote:
>>>
>>>                              Hi all,
>>>
>>>                              To clarify my payload is like below,
>>>
>>>                              *_Expected :_*
>>>
>>>                              {
>>>                                  "alias": "testdisk",
>>>                                  "shareable": false,
>>>                                  "storage_type": "cinder",
>>>                                  "openstack_volume_type": {
>>>                                       "name": "ceph"
>>>                                   },
>>>                                  "description": "",
>>>                                  "storage_domains": {
>>>                                        "storage_domain": [{
>>>                                           "name": "cinder_newone"
>>>                                        }]
>>>                                   },
>>>                                  "provisioned_size": 1073741824,
>>>                                    "interface": "virtio",
>>>                                    "format": "cow"
>>>                              }
>>>                              _*
>>>                              *_
>>>                              _*I sent : *_
>>>
>>>                              {
>>>                                  "alias": "testdisk",
>>>                                  "shareable": false,
>>>                                  "storage_type": "cinder",
>>>                                  "openstack_volume_type": {
>>>                                       "name": "ceph"
>>>                                   },
>>>                                  "description": "",
>>>                                  "storage_domains": {
>>>                                        "storage_domain": [{
>>>                                           "name": "cinder_newone"
>>>                                        }]
>>>                                   },
>>>                                  "provisioned_size": 1073741824,
>>>                                    "interface": "virtio",
>>>                                    "format": "cow",
>>>                              *     "test" : "value"*
>>>                              }
>>>
>>>
>>>                              Is there a way to ignore the *test* field?
>>>         Please
>>>                              let me know any way / work around.
>>>
>>>
>>>                              Any help is much appreciated.
>>>
>>>                              Thanks,
>>>                              Hari
>>>
>>>
>>>                              On Wed, Jun 20, 2018 at 3:09 PM, Hari
>>> Prasanth
>>>                              Loganathan
>>>         <[email protected]
>>>         <mailto:[email protected]>
>>>                              <mailto:[email protected]
>>>
>>>         <mailto:[email protected]>>> wrote:
>>>
>>>                                  Hi Team,
>>>
>>>                                  I want to attach the disk using the
>>>         oVIrt rest
>>>                                  API, I use the version*4.2* and
>>>         completed my script.
>>>                                  But when I downgrade my oVirt to lower
>>>         version
>>>                                  *4.1*, I get the following error.
>>>
>>>                                  detail: 'For correct usage, see:
>>>
>>> https://X.X.99.84/ovirt-engine/api/v4/model#services/disk-attachments/methods/add
>>>         <
>>> https://X.X.99.84/ovirt-engine/api/v4/model#services/disk-attachments/methods/add
>>> >
>>>                                         <
>>> https://X.X.99.84/ovirt-engine/api/v4/model#services/disk-attachments/methods/add
>>>         <
>>> https://X.X.99.84/ovirt-engine/api/v4/model#services/disk-attachments/methods/add>>',\n
>>>                                reason: 'Request syntactically
>>>         incorrect.',\n                         error: 'For correct
>>>         usage, see:
>>>
>>> https://X.X.99.84/ovirt-engine/api/v4/model#services/disk-attachments/methods/add
>>>         <
>>> https://X.X.99.84/ovirt-engine/api/v4/model#services/disk-attachments/methods/add
>>> >
>>>                                         <
>>> https://X.X.99.84/ovirt-engine/api/v4/model#services/disk-attachments/methods/add
>>>         <
>>> https://X.X.99.84/ovirt-engine/api/v4/model#services/disk-attachments/methods/add
>>> >>',\n
>>>
>>>
>>>                                  *Reason*: I added an extra parameter
>>> called
>>>                                  'isSharable' which is not expected in
>>>         this API.
>>>
>>>
>>>                                  *So Is there a way to Ignore the extra
>>>                                  parameters sent for oVirt API?*
>>>                                  *
>>>                                  *
>>>                                  _*Example :*_
>>>                                  *
>>>                                  *
>>>                                  *Expected :
>>>                                  *
>>>                                  *
>>>                                  *
>>>                                  *{*
>>>                                  * "a"  : "1"*
>>>                                  *}
>>>                                  *
>>>                                  *
>>>                                  *
>>>                                  *I sent :*
>>>                                  *
>>>                                  *
>>>                                  *{*
>>>                                  *  "a" : "1",*
>>>                                  *  "b" : "2"*
>>>                                  *}*
>>>                                  *
>>>                                  *
>>>                                  *My expectation is, Ignore the "b" and
>>>         the API
>>>                                  should work, Is there a flag in oVirt
>>>         API which
>>>                                  ignores the extra parameters?
>>>                                  *
>>>
>>>                                  Thanks,
>>>                                  Hari
>>>
>>>
>>>
>>>                      _______________________________________________
>>>                      Users mailing list -- [email protected]
>>>         <mailto:[email protected]> <mailto:[email protected]
>>>         <mailto:[email protected]>>
>>>                      To unsubscribe send an email to
>>>         [email protected] <mailto:[email protected]>
>>>                      <mailto:[email protected]
>>>         <mailto:[email protected]>>
>>>                      Privacy Statement:
>>>         https://www.ovirt.org/site/privacy-policy/
>>>         <https://www.ovirt.org/site/privacy-policy/>
>>>                      <https://www.ovirt.org/site/privacy-policy/
>>>         <https://www.ovirt.org/site/privacy-policy/>>
>>>                      oVirt Code of Conduct:
>>>         https://www.ovirt.org/community/about/community-guidelines/
>>>         <https://www.ovirt.org/community/about/community-guidelines/>
>>>                             <
>>> https://www.ovirt.org/community/about/community-guidelines/
>>>         <https://www.ovirt.org/community/about/community-guidelines/>>
>>>                      List Archives:
>>>
>>> https://lists.ovirt.org/archives/list/[email protected]/message/Q3S2KU4PXZ7P2ZBLAYM7CYAK2S4NUJD5/
>>>         <
>>> https://lists.ovirt.org/archives/list/[email protected]/message/Q3S2KU4PXZ7P2ZBLAYM7CYAK2S4NUJD5/
>>> >
>>>                             <
>>> https://lists.ovirt.org/archives/list/[email protected]/message/Q3S2KU4PXZ7P2ZBLAYM7CYAK2S4NUJD5/
>>>         <
>>> https://lists.ovirt.org/archives/list/[email protected]/message/Q3S2KU4PXZ7P2ZBLAYM7CYAK2S4NUJD5/
>>> >>
>>>
>>>
>>>
>>>                  --
>>>                  GREG SHEREMETA
>>>
>>>                  SENIOR SOFTWARE ENGINEER - TEAM LEAD - RHV UX
>>>
>>>                  Red Hat NA
>>>
>>>                  <https://www.redhat.com/>
>>>
>>>         [email protected] <mailto:[email protected]>
>>>         <mailto:[email protected] <mailto:[email protected]>> IRC:
>>>         gshereme
>>>
>>>                  <https://red.ht/sig>
>>>
>>>
>>>
>>>
>>>
>

-- 

GREG SHEREMETA

SENIOR SOFTWARE ENGINEER - TEAM LEAD - RHV UX

Red Hat NA

<https://www.redhat.com/>

[email protected]    IRC: gshereme
<https://red.ht/sig>
_______________________________________________
Users mailing list -- [email protected]
To unsubscribe send an email to [email protected]
Privacy Statement: https://www.ovirt.org/site/privacy-policy/
oVirt Code of Conduct: 
https://www.ovirt.org/community/about/community-guidelines/
List Archives: 
https://lists.ovirt.org/archives/list/[email protected]/message/PVHGHS2QCRC7JY5NBBMSH24WBGGYDVAQ/

Reply via email to