[ https://issues.apache.org/jira/browse/CLOUDSTACK-414?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13545847#comment-13545847 ]
sebastien goasguen commented on CLOUDSTACK-414: ----------------------------------------------- Rohit, after looking at the code closely it's pretty clear that your python skills are greater than mine :) When I looked at this a while back, I wanted to use introspection assuming that we would not know anything about the API commands. But since we do, we can indeed define the grammar and get all the verbs. The packaging does what it's supposed to do, gives you the list of modules available. you can iterate over that to check the validity of an API or do autocompletion like you did. Your cachegen.py is pretty good to look at for this. One question that I have though, is that since you import for each verb based on the completions from cloudstackAPI.__all__, why do you do a marvin.cloudstackAPI import * ? it seems redundant. We can close this as "not an issue" -sebastien > marvin cloudstackAPI is packaging each api call in its separate module, we > should create a single module > -------------------------------------------------------------------------------------------------------- > > Key: CLOUDSTACK-414 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-414 > Project: CloudStack > Issue Type: Improvement > Security Level: Public(Anyone can view this level - this is the > default.) > Components: API, Test Tools > Affects Versions: 4.1.0 > Environment: Devcloud, OSX 10.8.1 > Reporter: sebastien goasguen > Priority: Critical > Fix For: 4.1.0 > > > build-marvin uses codegenerator.py to create the cloudstackAPI/ in the marvin > tree. The way this is done each API is its own module. This makes it > troublesome to use the cloudstackAPI in python. We may want to create a > single cloudstackapi file which contains all the skeleton classes generated. > That way something like inspect.getmembers(cloudstackAPI,inspect.isclass) > will return something. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira