Neutron API-site: "Networks provider extended attributes" missing "Error response codes"

Bug #1477527 reported by Keiichiro Tokunaga
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
openstack-api-site
Fix Released
Medium
Keiichiro Tokunaga

Bug Description

The all methods of "Networks provider extended attributes" are missing "Error response codes". Please see http://developer.openstack.org/api-ref-networking-v2-ext.html#network_provider-ext .

The methods should have the following error response codes.

- List networks
   Unauthorized(401)

- Create network
   Bad request(400), Unauthorized(401)

- Show network details
   Unauthorized(401), Not found(404)

- Update network
   Bad request(400), Unauthorized(401), Not found(404)

- Delete network
   Unauthorized(401), Not found(404), Conflict(409)

Actually, "Delete network" is missing "Normal response codes" as well, and that should be '204'. That can be fixed in the same patch.

Changed in openstack-api-site:
assignee: nobody → Keiichiro Tokunaga (keiichiro)
Revision history for this message
Keiichiro Tokunaga (keiichiro) wrote :
Download full text (7.8 KiB)

Here is what I confirmed.

- List networks
   It returns 401 when giving a wrong token.

    $ curl -i -X GET -H "x-auth-token: dummy" http://192.168.122.111:9696/v2.0/networks
    HTTP/1.1 401 Unauthorized
    Content-Type: text/html; charset=UTF-8
    Content-Length: 23
    Www-Authenticate: Keystone uri='http://192.168.122.111:5000'
    X-Openstack-Request-Id: req-bd75e25a-b102-4ec2-a68e-7ea16feb05bf
    Date: Thu, 23 Jul 2015 11:55:32 GMT

- Create network
   It returns 400 when giving a bad request body.

    $ curl -i -X POST -H "x-auth-token: $TOKEN" -H "content-type:application/jason" -d '{"network":{"dummy":"dummy"}}' http://192.168.122.111:9696/v2.0/networks
    HTTP/1.1 400 Bad Request
    Content-Length: 106
    Content-Type: application/json; charset=UTF-8
    X-Openstack-Request-Id: req-ba7ebf42-b1fb-48f8-bc34-62ac8408b9b1
    Date: Thu, 23 Jul 2015 11:58:56 GMT

  It returns 401 when giving a wrong token.

    $ curl -i -X POST -H "x-auth-token: dummy" -H "content-type:application/jason" -d '{"network":{}}' http://192.168.122.111:9696/v2.0/networks
    HTTP/1.1 401 Unauthorized
    Content-Type: text/html; charset=UTF-8
    Content-Length: 23
    Www-Authenticate: Keystone uri='http://192.168.122.111:5000'
    X-Openstack-Request-Id: req-c4382d22-5ff6-415b-b8a3-98abada420e6
    Date: Thu, 23 Jul 2015 12:00:00 GMT

- Show network details
  It returns 401 when giving a wrong token.

    $ neutron net-list
    +--------------------------------------+----------+----------------------------------------------------------+
    | id | name | subnets |
    +--------------------------------------+----------+----------------------------------------------------------+
    | 0d4af632-5e88-4d9a-a155-3f1a64a49986 | private4 | a0a928f1-e057-4ecd-99d6-659fe2c950c5 fdc6:3c3c:39a7::/64 |
    | | | a9d8ad08-71f9-4a7b-82f1-9005ff24e7c1 10.0.0.0/24 |
    | ae75fb2a-c44f-4e85-a1b5-c2b79bd79dab | public | c2c2c941-c315-43b3-8318-73adff030aad 172.24.4.0/24 |
    | | | e8cb68cf-f0ad-4d7e-a0b3-2c56d35f01ce 2001:db8::/64 |
    +--------------------------------------+----------+----------------------------------------------------------+
    $ curl -i -X GET -H "x-auth-token: dummy" http://192.168.122.111:9696/v2.0/networks/0d4af632-5e88-4d9a-a155-3f1a64a49986
    HTTP/1.1 401 Unauthorized
    Content-Type: text/html; charset=UTF-8
    Content-Length: 23
    Www-Authenticate: Keystone uri='http://192.168.122.111:5000'
    X-Openstack-Request-Id: req-b6442ede-d972-45c4-82b6-fb0adff5108f
    Date: Thu, 23 Jul 2015 12:02:20 GMT

  It returns 404 when giving a wrong network-id.

    $ curl -i -X GET -H "x-auth-token: $TOKEN" http://192.168.122.111:9696/v2.0/networks/dummy
    HTTP/1.1 404 Not Found
    Content-Length: 154
    Content-Type: text/html; charset=UTF-8
    X-Openstack-Request-Id: req-1f28e824-6c6a-432d-bcf2-113b4071e03d
    Date: Thu, 23 Jul 2015 12:03:32 GMT

- Update network
  It returns 401 when giving a wrong token.

    $ neutron net-list
    ...

Read more...

Revision history for this message
Anne Gentle (annegentle) wrote :

Good work.

Changed in openstack-api-site:
status: New → Confirmed
importance: Undecided → Medium
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/205514

Changed in openstack-api-site:
status: Confirmed → In Progress
Tom Fifield (fifieldt)
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/205514
Committed: https://git.openstack.org/cgit/openstack/api-site/commit/?id=d75c2e0b3160888a1f380567df6cd03ea04e7304
Submitter: Jenkins
Branch: master

commit d75c2e0b3160888a1f380567df6cd03ea04e7304
Author: Keiichiro Tokunaga <email address hidden>
Date: Fri Jul 24 19:52:12 2015 +0900

    Add error response codes to net provider ext attr

    The all methods of "Networks provider extended attributes" are
    missing "Error response codes".

    The methods should have the following error response codes.

      - List networks
        Unauthorized(401)

      - Create network
        Bad request(400), Unauthorized(401)

      - Show network details
        Unauthorized(401), Not found(404)

      - Update network
        Bad request(400), Unauthorized(401), Not found(404)

      - Delete network
        Unauthorized(401), Not found(404), Conflict(409)

    Actually, "Delete network" is missing "Normal response codes" as
    well, and that should be '204'. That can be fixed in this patch.

    Change-Id: I3246f85fccd3b4980410954643a133583d3ab939
    Closes-Bug: #1477527

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.