From Dan Kenigsberg danken@redhat.com:
Dan Kenigsberg has submitted this change and it was merged.
Change subject: vdsmapi: get complex type representation ......................................................................
vdsmapi: get complex type representation
vdsm-api contain some complex method prameter types. vdsm-client should use vdsmapi.py knowledge of the schema in order to help the users construct these parameters.
vdsmapi now returns a dictionary represenation of given command parameters. keys represent the parameter names and dict values are the parameter types. Note that it's almost perfect: union types aren't fully represented and only the union types are being stored.
usage: from vdsm.api import vdsmapi schema_paths = [vdsmapi.find_schema()] schema = vdsmapi.Schema(schema_paths, False) schema.get_args_dict("Lease", "create")
{ "lease": { "sd_id": "UUID", "lease_id": "UUID" } }
Change-Id: I25a9ace931b377408ffabb2b570af9da7cfccfc6 Signed-off-by: Irit Goihman igoihman@redhat.com --- M lib/vdsm/api/vdsmapi.py M tests/vdsmapi_test.py 2 files changed, 112 insertions(+), 0 deletions(-)
Approvals: Piotr Kliczewski: Looks good to me, approved Yaniv Bronhaim: Looks good to me, but someone else must approve Jenkins CI: Passed CI tests Irit Goihman: Verified