Hello,<div><br></div><div>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.</div><div><br></div><div>--</div>
<div>Best regards,</div><div>Oleg</div><div><br><div class="gmail_quote">On Wed, Aug 15, 2012 at 12:22 PM, Mark McLoughlin <span dir="ltr"><<a href="mailto:markmc@redhat.com" target="_blank">markmc@redhat.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Thu, 2012-07-19 at 14:20 +0100, Mark McLoughlin wrote:<br>
> Hi,<br>
><br>
> I was just reviewing the code for this:<br>
><br>
> <a href="https://blueprints.launchpad.net/nova/+spec/os-api-network-create" target="_blank">https://blueprints.launchpad.net/nova/+spec/os-api-network-create</a><br>
><br>
> You POST to /networks:<br>
><br>
> {"network": {"vlan_start": 234, "cidr": "<a href="http://10.70.105.0/24" target="_blank">10.70.105.0/24</a>", "label": "net234"}}<br>
><br>
> and get back e.g.<br>
><br>
> {"networks": [{..., "id": 66085e78-8f6-4a26-b16c-4b1f55901fbd", ..., "label": "net234", ..., "vlan": 234, ..., "cidr": "<a href="http://10.70.105.0/24" target="_blank">10.70.105.0/24</a>", ...}]}<br>
><br>
> Notice the plural "networks" in the response. A single POST may create<br>
> multiple networks (where e.g. FLAGS.num_networks > 1), but it's not<br>
> clear to me what the use case for this is.<br>
><br>
> The issue with this is that (at least IMHO) POST requests should only<br>
> create a single resource - e.g. we want to be able to return a 201<br>
> Created response with a Location header and it would seem bizarre to<br>
> include multiple location headers.<br>
<br>
</div>For anyone interested, this debate is still rumbling on here:<br>
<br>
<a href="https://review.openstack.org/#/c/9847/" target="_blank">https://review.openstack.org/#/c/9847/</a><br>
<br>
I've tried to be pretty clear about my objection to the proposed<br>
modelling:<br>
<br>
REST stands for Representational State Transfer<br>
<br>
When you POST to /networks, you are sending a representation of the<br>
network resource you want to create<br>
<br>
The sensible thing for a client to expect is that a network resource<br>
will be created and for a 201 Created response to include a<br>
representation the resource and a Location header with a URI for the<br>
resource<br>
<br>
What doesn't seem at all sensible is for the server to return a<br>
collection of resources, based on "num_networks" and "network_size"<br>
properties in the network representation and also based on the server<br>
configuration<br>
<br>
Other opinions are most welcome, though.<br>
<div class="HOEnZb"><div class="h5"><br>
Cheers,<br>
Mark.<br>
<br>
<br>
_______________________________________________<br>
OpenStack-dev mailing list<br>
<a href="mailto:OpenStack-dev@lists.openstack.org">OpenStack-dev@lists.openstack.org</a><br>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
</div></div></blockquote></div><br></div>