On Tue, Dec 04, 2012 at 08:43:11AM -0500, Antoni Segura Puimedon wrote:
> Hi all,
> I am currently working in adding a new feature to vdsm which requires a new
> entry point in vdsm, thus requiring:
> - Parameter definitions in vdsm_api/vdsmapi-schema.json
> - Implementation and checks in vdsm/API.py and other modules.
> Typically, we check for presence absence of required/optional parameters in
> API.py using utils.validateMinimalKeySet or just if else clauses. I think this
> process could benefit from a more automatic and less duplicated effort, i.e.,
> parsing vdsmapi-schema.json in a similar way as process-schema.py does to make
> a memoized method that is able to check whether the api call is correct
> according to the API definitions. A very good side effect would be that this
> would really avoid us from forgetting to update the schema.
Yes, this is a good idea. I do want to add some checking. For now, the best
place to add it would probably be in the DynamicBridge class which dispatches
json-rpc calls to the correct internal methods. Unfortunately this would
exclude the xmlrpc api from the automatic checking. I guess that's ok since
xmlrpc will be going away.
Adam Litke <a...@us.ibm.com>
IBM Linux Technology Center
vdsm-devel mailing list