Comment 1 for bug 1604662

Revision history for this message
Miguel Lavalle (minsel) wrote : Re: Bulk creation for security group does return 500 error.

We should be able to create security groups in bulk. The extension starts the API controller with bulk operations enabled: https://github.com/openstack/neutron/blob/master/neutron/extensions/securitygroup.py#L320

The docs (http://developer.openstack.org/api-ref-networking-v2-ext.html) don't show explicitly the request body for a bulk create operation. This is an example for networks (which I confirmed works correctly):

{
    "networks": [
        {
            "name": "sample_network3",
            "admin_state_up": true
        },
        {
            "name": "sample_network4",
            "admin_state_up": true
        }
    ]
}

Following this example, in my opinion the body for a security groups bulk create should be:

{
    "security_groups": [
        {
            "name": "my-security-group-1",
            "description": "My security group number 1"
        },
        {
            "name": "my-security-group-2",
            "description": "My security group number 2"
        }
    ]
}

It also returns a 500 and the Traceback is http://paste.openstack.org/show/538906/