On Wed, 2011-05-11 at 11:24 +0200, [email protected] wrote: > Hi, > > this patch add possibility to create a new instance using POST body XML. > > How it works: > > instance.xml: > <instance> > <name>testinst10</name> > <realm id="us"/> > <hardware_profile id="m1-small"> > <memory>512</memory> > <cpu>2</cpu> > <storage>10</storage> > <architecture>i386</architecture> > </hardware_profile> > </instance>
I assume the HWP entries are meant to override defaults from m1-small here ? As for the patch, parsing an instance from XML should be done in a class method in Instance; that should probably happen in server.rb, and the code there should ensure the params hash only has an :instance entry for XML. Also, we should distinguish whether to look for XML or not based on the content type of the POST (so that we can later easily add posting JSON or whatnot) David
