Normal response codes of "Create port" should be 201

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

Bug Description

In "Ports binding extended attributes (ports)" section, Normal response codes of "Create port" is 200 now, but it actually should be 201.

http://developer.openstack.org/api-ref-networking-v2-ext.html#port_binding-ext

[Representation]
$ source devstack/openrc admin admin
$ export TOKEN=`keystone token-get | grep ' id ' | get_field 2`
$ neutron net-list -c id -c name
+--------------------------------------+--------+
| id | name |
+--------------------------------------+--------+
| 318d00a7-b529-48d8-81ff-7b41c6cec725 | admin1 |
| 963436f4-fd71-4cd3-92da-b4dd5faaecbb | public |
| a8ab5c69-6a50-4a1b-a7f3-b17479731800 | demo1 |
+--------------------------------------+--------+
$ curl -i -X POST -H "x-auth-token:$TOKEN" -H "content-type:application/json" -d '{"port":{"name":"test_port","network_id":"318d00a7-b529-48d8-81ff-7b41c6cec725"}}' http://192.168.122.247:9696/v2.0/ports
HTTP/1.1 201 Created
Content-Type: application/json; charset=UTF-8
Content-Length: 620
X-Openstack-Request-Id: req-0485dbfb-9c65-4e90-bc30-07868970959c
Date: Wed, 08 Jul 2015 03:35:04 GMT

{"port": {"status": "DOWN", "binding:host_id": "", "allowed_address_pairs": [], "device_owner": "", "binding:profile": {}, "fixed_ips": [{"subnet_id": "472de1bc-1159-463d-a642-1e63ead4071f", "ip_address": "192.168.99.7"}], "id": "81dcb67b-6929-4bac-a9bd-313b6aa1aae8", "security_groups": ["de4979bc-4dc1-49ba-9edd-5ef651546d08"], "device_id": "", "name": "test_port", "admin_state_up": true, "network_id": "318d00a7-b529-48d8-81ff-7b41c6cec725", "tenant_id": "e7d8a7eccdb542aca94183ef6b2c8e70", "binding:vif_details": {}, "binding:vnic_type": "normal", "binding:vif_type": "unbound", "mac_address": "fa:16:3e:19:a4:07"}}

Changed in openstack-api-site:
assignee: nobody → Yushiro FURUKAWA (y-furukawa-2)
Changed in openstack-api-site:
status: New → In Progress
Revision history for this message
Anne Gentle (annegentle) wrote :

Is this a synchronous resource creation and does it follow these guidelines? http://specs.openstack.org/openstack/api-wg/guidelines/http.html#xx-success-codes

If so, I can mark this bug Confirmed.

description: updated
Tom Fifield (fifieldt)
Changed in openstack-api-site:
milestone: none → liberty
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to api-site (master)

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

commit 09d5a7d870a496234e1d25bba3607b5f67ce41f6
Author: Yushiro FURUKAWA <email address hidden>
Date: Wed Jul 8 15:41:18 2015 +0900

    Response codes of "Create port" should be 201

    This changes the normal reponse code of
    "Create port" from 200 to 201.

    Change-Id: I6e62ad7ef4cbb2eee941a9f407736b4b7f5d471c
    Closes-Bug: #1472490

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.