[openstack-dev] Modelling the creation of multiple networks in Nova's REST API

Jay Pipes jaypipes at gmail.com
Sat Aug 25 08:14:39 UTC 2012


On 08/15/2012 04:58 AM, Mark McLoughlin wrote:
> On Wed, 2012-08-15 at 12:55 +0400, Oleg Gelbukh wrote:
>> Hello,
>>
>> It seems to me that this call just mimics the behavior of nova-manage
>> utility which allows to create multiple networks for single
>> project/tenant with single CLI command.
> 
> Yes, but that doesn't mean it's a sane REST API.

Correct. A CLI can and should be able to do multiple requests in a
single command. That doesn't mean, however, that the underlying HTTP API
calls need to mimic the CLI. The only exception to this, IMHO, is when a
transaction creating/updating multiple resources needs to be atomic, in
which case it might be useful to have multiple resources created in a
single HTTP request. Not sure of whether there is any transactional
guarantee with the POST /networks call, though... can one of the
networks get created and another fail? If so, then what is the result of
the call? A 201? A 4XX?

Best,
-jay



More information about the OpenStack-dev mailing list