Attribute "direction" is "Optional" in POST "metering-label-rules", but it is actually "Required".

Bug #1478976 reported by Yuta Kawamura
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
openstack-api-site
Fix Released
Medium
Duncan.C

Bug Description

Networking API v2.0 extensions, Create metering label rule:
http://developer.openstack.org/api-ref-networking-v2-ext.html#createMeteringLabelRule

Issue:
Attribute "direction" is "Optional" in POST "metering-label-rules" ,
but it is actually "Required".

[Reproduction]
<Environment>
stack@ubuntu:~/devstack$ git show
commit c90656a4a3ca148cd3eec8b4792215f735f9c75d
Merge: e8292ae 92ad152
Author: Jenkins <email address hidden>
Date: Fri Jul 24 05:49:36 2015 +0000

    Merge "Explicitly set bind_ip in Swift server config files"

stack@ubuntu:~/devstack$

<Case of failure>
stack@ubuntu:~/devstack$ curl -g -i -X POST -H "Content-Type: application/json" -H "X-Auth-Token: ${token}" http://192.168.122.127:9696/v2.0/metering/metering-label-rules -d '{"metering_label_rule": {"direction":"","remote_ip_prefix":"192.168.10.0/24","metering_label_id":"0e062f5f-edac-4488-b5cd-710cc051354f","tenant_id":"647ceaac4e2a40ebbfa210761672e4cd"}}';echo
HTTP/1.1 400 Bad Request
Content-Length: 145
Content-Type: application/json; charset=UTF-8
X-Openstack-Request-Id: req-5a84cd91-2076-4028-a901-44381175eb47
Date: Tue, 28 Jul 2015 11:51:38 GMT

{"NeutronError": {"message": "Invalid input for direction. Reason: '' is not in ['ingress', 'egress'].", "type": "HTTPBadRequest", "detail": ""}}
stack@ubuntu:~/devstack$

<Case of success>
stack@ubuntu:~/devstack$ curl -g -i -X POST -H "Content-Type: application/json" -H "X-Auth-Token: ${token}" http://192.168.122.127:9696/v2.0/met
ering/metering-label-rules -d '{"metering_label_rule": {"direction":"ingress","remote_ip_prefix":"192.168.10.0/24","metering_label_id":"0e062f5f-edac-4488-b5cd-710cc051
354f","tenant_id":"647ceaac4e2a40ebbfa210761672e4cd"}}';echo
HTTP/1.1 201 Created
Content-Type: application/json; charset=UTF-8
Content-Length: 214
X-Openstack-Request-Id: req-d39b2b1f-125d-4c53-b398-b8f842de8435
Date: Tue, 28 Jul 2015 12:14:18 GMT

{"metering_label_rule": {"remote_ip_prefix": "192.168.10.0/24", "direction": "ingress", "metering_label_id": "0e062f5f-edac-4488-b5cd-710cc051354f", "id": "e228e8bb-688d-418e-98ca-f9228cd43342", "excluded": false}}

Anne Gentle (annegentle)
Changed in openstack-api-site:
status: New → Confirmed
importance: Undecided → Medium
Duncan.C (duncan-c)
Changed in openstack-api-site:
assignee: nobody → Duncan.C (duncan-c)
Duncan.C (duncan-c)
Changed in openstack-api-site:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to api-site (master)

Fix proposed to branch: master
Review: https://review.openstack.org/211017

Changed in openstack-api-site:
milestone: none → liberty
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to api-site (master)

Reviewed: https://review.openstack.org/211017
Committed: https://git.openstack.org/cgit/openstack/api-site/commit/?id=c58cf641b9e56d185a5bb27e3e136c0d27663435
Submitter: Jenkins
Branch: master

commit c58cf641b9e56d185a5bb27e3e136c0d27663435
Author: Duncan.C <email address hidden>
Date: Mon Aug 10 15:17:32 2015 +0800

    Modify parameter type in Networking v2.0 ext

    1.Modify attribute "direction" type to "required" and modify
      description content in POST "metering-label-rules" api.

    2.Modify "Create metering label", "Create metering label rule"
       request/response parameters table format.

    Change-Id: I993a629148244db17cc4932627e72c1c84f9ed79
    Closes-Bug: #1478976

Changed in openstack-api-site:
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.