On Mon, Apr 29, 2013 at 10:45:02AM +0530, Rohit Yadav wrote: > > If I get these basic rules, I am guessing it shouldn't be tough > > to generate the wrapper. > > > > The implementation won't be tough, but getting it right would be. Right now > I'm just splitting the apiname at the camelCase's hump in cloudmonkey, so > camel becomes a command and Case becomes the entity. >
FWIW, while breaking down the entity - verb relationships for Marvin's refactoring I used additional transformers based on prepositions. Because not all entities follow the camelCase relationship: Something like this: transform_api, addAccountToProject -> ('addAccount', 'Project') transform_api, addIpToNic -> ('addIp', 'Nic') transform_api, addNicToVirtualMachine -> ('addNic', 'VirtualMachine') transform_api, assignToGlobalLoadBalancerRule -> ('assign', 'GlobalLoadBalancerRule') transform_api, assignToLoadBalancerRule -> ('assign', 'LoadBalancerRule') transform_api, changeServiceForRouter -> ('changeService', 'Router') transform_api, changeServiceForSystemVm -> ('changeService', 'SystemVm') transform_api, changeServiceForVirtualMachine -> ('changeService', 'VirtualMachine') transform_api, deleteAccountFromProject -> ('deleteAccount', 'Project') transform_api, findHostsForMigration -> ('findHosts', 'Migration') transform_api, findStoragePoolsForMigration -> ('findStoragePools', 'Migration') transform_api, markDefaultZoneForAccount -> ('markDefaultZone', 'Account') transform_api, prepareHostForMaintenance -> ('prepareHost', 'Maintenance') transform_api, removeFromGlobalLoadBalancerRule -> ('remove', 'GlobalLoadBalancerRule') transform_api, removeFromLoadBalancerRule -> ('remove', 'LoadBalancerRule') transform_api, removeIpFromNic -> ('removeIp', 'Nic') transform_api, removeNicFromVirtualMachine -> ('removeNic', 'VirtualMachine') transform_api, resetPasswordForVirtualMachine -> ('resetPassword', 'VirtualMachine') transform_api, resetSSHKeyForVirtualMachine -> ('resetSSHKey', 'VirtualMachine') transform_api, revertToSnapshot -> ('revert', 'Snapshot') transform_api, updateDefaultNicForVirtualMachine -> ('updateDefaultNic', 'VirtualMachine') transform_api, markDefaultZoneForAccount -> ('markDefaultZone', 'Account') transform_api, assignToGlobalLoadBalancerRule -> ('assign', 'GlobalLoadBalancerRule') transform_api, removeFromGlobalLoadBalancerRule -> ('remove', 'GlobalLoadBalancerRule') transform_api, assignToLoadBalancerRule -> ('assign', 'LoadBalancerRule') transform_api, removeFromLoadBalancerRule -> ('remove', 'LoadBalancerRule') transform_api, prepareHostForMaintenance -> ('prepareHost', 'Maintenance') transform_api, findHostsForMigration -> ('findHosts', 'Migration') transform_api, findStoragePoolsForMigration -> ('findStoragePools', 'Migration') transform_api, addIpToNic -> ('addIp', 'Nic') transform_api, removeIpFromNic -> ('removeIp', 'Nic') transform_api, addAccountToProject -> ('addAccount', 'Project') transform_api, deleteAccountFromProject -> ('deleteAccount', 'Project') transform_api, changeServiceForRouter -> ('changeService', 'Router') transform_api, revertToSnapshot -> ('revert', 'Snapshot') transform_api, changeServiceForSystemVm -> ('changeService', 'SystemVm') transform_api, addNicToVirtualMachine -> ('addNic', 'VirtualMachine') transform_api, changeServiceForVirtualMachine -> ('changeService', 'VirtualMachine') transform_api, removeNicFromVirtualMachine -> ('removeNic', 'VirtualMachine') transform_api, resetPasswordForVirtualMachine -> ('resetPassword', 'VirtualMachine') transform_api, resetSSHKeyForVirtualMachine -> ('resetSSHKey', 'VirtualMachine') transform_api, updateDefaultNicForVirtualMachine -> ('updateDefaultNic', 'VirtualMachine') This is done by the cs_entity_generator module in the marvin_refactor branch. Thanks, -- Prasanna., ------------------------ Powered by BigRock.com