2015-11-22 17:04:10 |
Yushiro FURUKAWA |
description |
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": ""
}
} |
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": ""
}
} |
|