Comment 0 for bug 1518733

Revision history for this message
Yushiro FURUKAWA (y-furukawa-2) wrote : Request params EXCEPT "firewall_policy_id" should be optional for POST v2.0/fw/firewalls

In http://developer.openstack.org/api-ref-networking-v2-ext.html#createFirewall,
"firewall_policy_id" is required when creating the firewall.

[How to reproduce]
$ source devstack/openrc admin admin
$ export TOKEN=`openstack token issue| grep ' id ' | get_field 2`
$ neutron firewall-policy-create policy1
Created a new firewall_policy:
+----------------+--------------------------------------+
| Field | Value |
+----------------+--------------------------------------+
| audited | False |
| description | |
| firewall_rules | |
| id | 5c640f90-a1ab-4c14-ad93-fd03cd84ca0c |
| name | policy1 |
| shared | False |
| tenant_id | 6fe0e915471c4db4a4620b9da159b826 |
+----------------+--------------------------------------+

$ curl -s -X POST -d '{"firewall":{}}' -H "x-auth-token:$TOKEN" localhost:9696/v2.0/fw/firewalls | jq "."
{
  "NeutronError": {
    "message": "Failed to parse request. Required attribute 'firewall_policy_id' not specified",
    "type": "HTTPBadRequest",
    "detail": ""
  }
}

$ curl -s -X POST -d '{"firewall":{"firewall_policy_id":"5c640f90-a1ab-4c14-ad93-fd03cd84ca0c"}}' -H "x-auth-token:$TOKEN" localhost:9696/v2.0
/fw/firewalls | jq "."
{
  "firewall": {
    "status": "INACTIVE",
    "router_ids": [],
    "name": "",
    "admin_state_up": true,
    "tenant_id": "6fe0e915471c4db4a4620b9da159b826",
    "firewall_policy_id": "5c640f90-a1ab-4c14-ad93-fd03cd84ca0c",
    "id": "8e6d05da-4a9f-4db1-bb35-d3e4bfe8577d",
    "description": ""
  }
}