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

Mark Nottingham mnot at mnot.net
Fri Jul 20 01:43:50 UTC 2012


Hey Mark,

Just from a pure HTTP perspective, there's nothing wrong with creating multiple things with a POST; we just clarified this in HTTP.

<https://svn.tools.ietf.org/svn/wg/httpbis/draft-ietf-httpbis/latest/p2-semantics.html#status.201>

Of course, there's still a question as to whether it's a useful thing to do. 

Cheers,



On 19/07/2012, at 11:20 PM, Mark McLoughlin wrote:

> Hi,
> 
> I was just reviewing the code for this:
> 
>  https://blueprints.launchpad.net/nova/+spec/os-api-network-create
> 
> You POST to /networks:
> 
>  {"network": {"vlan_start": 234, "cidr": "10.70.105.0/24", "label": "net234"}}
> 
> and get back e.g.
> 
>  {"networks": [{..., "id": 66085e78-8f6-4a26-b16c-4b1f55901fbd", ..., "label": "net234", ..., "vlan": 234, ..., "cidr": "10.70.105.0/24", ...}]}
> 
> Notice the plural "networks" in the response. A single POST may create
> multiple networks (where e.g. FLAGS.num_networks > 1), but it's not
> clear to me what the use case for this is.
> 
> The issue with this is that (at least IMHO) POST requests should only
> create a single resource - e.g. we want to be able to return a 201
> Created response with a Location header and it would seem bizarre to
> include multiple location headers.
> 
> So:
> 
>  - What's this batch network create thing for?
> 
>  - Is it important for it to be available in the API?
> 
>  - If it is important to make available in the API, any thoughts on 
>    modelling it?
> 
> Cheers,
> Mark.
> 
> 
> _______________________________________________
> OpenStack-dev mailing list
> OpenStack-dev at lists.openstack.org
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev

--
Mark Nottingham   http://www.mnot.net/






More information about the OpenStack-dev mailing list