Missing "Optional" information for request params into FWaaS API

Bug #1518733 reported by Yushiro FURUKAWA
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
openstack-api-site
Fix Released
Low
Yushiro FURUKAWA

Bug Description

In http://developer.openstack.org/api-ref-networking-v2-ext.html#fwaas-v2.0,

"Optional" information is missing for request parameters.

* POST v2.0/fw/firewalls
  "firewall_policy_id" is required and other params should be "Optional".

* PUT v2.0/fw/firewalls
  "firewall_id" is required and other params should be "Optional".

[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": ""
  }
}

$ curl -s -X PUT -d '{"firewall":{}}' -H "x-auth-token:$TOKEN" localhost:9696/v2.0/fw/firewalls/b5d0cfb1-b5b2-4eca-9f03-89e914117e0c | jq "."
{
  "firewall": {
    "status": "INACTIVE",
    "router_ids": [],
    "name": "fw1",
    "admin_state_up": true,
    "tenant_id": "6fe0e915471c4db4a4620b9da159b826",
    "firewall_policy_id": "5c640f90-a1ab-4c14-ad93-fd03cd84ca0c",
    "id": "b5d0cfb1-b5b2-4eca-9f03-89e914117e0c",
    "description": ""
  }
}

Tags: fwaas neutron
Changed in openstack-api-site:
assignee: nobody → Yushiro FURUKAWA (y-furukawa-2)
summary: - Request params EXCEPT "firewall_policy_id" should be optional for POST
- v2.0/fw/firewalls
+ Missing "Optional" information for request params into FWaaS API
description: updated
Atsushi SAKAI (sakaia)
Changed in openstack-api-site:
status: New → Confirmed
Revision history for this message
Yushiro FURUKAWA (y-furukawa-2) wrote :

I've pushed the following patch set.

https://review.openstack.org/#/c/248808/

Changed in openstack-api-site:
status: Confirmed → In Progress
Changed in openstack-api-site:
importance: Undecided → Low
milestone: none → liberty
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.