Change in ovirt-engine-sdk-ruby[master]: Add generic reader

juan.hernandez at redhat.com juan.hernandez at redhat.com
Tue Aug 30 09:46:25 UTC 2016


Juan Hernandez has submitted this change and it was merged.

Change subject: Add generic reader
......................................................................


Add generic reader

Currently the SDK doesn't provide any mechanism to read an XML object
without explicitly specifying its type. For example, to read a virtual
machine the only method available is "VmReader.read_one". But there are
situations where the SDK can't know in advance what type of object is
going to be received from the server, for example "action" or "fault".
To support that, this patch adds a new "Reader.read" method that decides
the type of object based on the name of the first tag, and invokes the
corresponding specific reader to read it.

Change-Id: I3b8c9a4c1118e7b261a589e8185861c9acf36921
Signed-off-by: Juan Hernandez <juan.hernandez at redhat.com>
---
M generator/src/main/java/org/ovirt/sdk/ruby/ReadersGenerator.java
M sdk/lib/ovirtsdk4/reader.rb
M sdk/spec/reader_spec.rb
3 files changed, 164 insertions(+), 0 deletions(-)

Approvals:
  Ondra Machacek: Looks good to me, but someone else must approve
  Juan Hernandez: Verified; Looks good to me, approved; Passed CI tests



-- 
To view, visit https://gerrit.ovirt.org/62572
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I3b8c9a4c1118e7b261a589e8185861c9acf36921
Gerrit-PatchSet: 2
Gerrit-Project: ovirt-engine-sdk-ruby
Gerrit-Branch: master
Gerrit-Owner: Juan Hernandez <juan.hernandez at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Juan Hernandez <juan.hernandez at redhat.com>
Gerrit-Reviewer: Ondra Machacek <omachace at redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation at ovirt.org>



More information about the Engine-commits mailing list