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

Mark McLoughlin markmc at redhat.com
Thu Jul 19 13:20:37 UTC 2012


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.




More information about the OpenStack-dev mailing list