Location header should be sent with an HTTP status code of 201 or 202

Bug #1317044 reported by Lucas Alvares Gomes
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ironic
Fix Released
Medium
Lucas Alvares Gomes

Bug Description

The HTTP Location header should be sent when a new resource is created (201) or when a server accepts the request and will process it asynchronously (202).

201:
To provide information about the location of a newly created resource the Ironic API should return the URI for the new object in the HTTP Location header.

202:
After the server accepts the request it needs to return an URI in the HTTP Location header so that clients will know how to track the status of the request.

Currently WSME has a bug opened about it[1], but the Ironic API we could workaround it by editing the pecan.response.location object directly before returning.

[1] https://bugs.launchpad.net/wsme/+bug/1233687

Changed in ironic:
importance: Undecided → High
assignee: nobody → Lucas Alvares Gomes (lucasagomes)
Changed in ironic:
importance: High → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to ironic (master)

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

Changed in ironic:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

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

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to ironic (master)

Reviewed: https://review.openstack.org/92615
Committed: https://git.openstack.org/cgit/openstack/ironic/commit/?id=230ff8d82154bd1f3290ed136032f541090e1792
Submitter: Jenkins
Branch: master

commit 230ff8d82154bd1f3290ed136032f541090e1792
Author: Lucas Alvares Gomes <email address hidden>
Date: Wed May 7 14:25:59 2014 +0100

    Return the HTTP Location for newly created resources

    To provide information about the location of a newly created resource
    (201) the Ironic API now returns the URI for the new object in the HTTP
    Location header.

    A new function build_url() was created in the link.py by factoring out
    part of the the Link.make_link() method so that we can reuse that part
    of the code to build a URL without having to create a new Link object.

    Partial-Bug: #1317044
    Change-Id: I88b033d446aaed93fc90ab6497578d5cd729dea8

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Reviewed: https://review.openstack.org/92616
Committed: https://git.openstack.org/cgit/openstack/ironic/commit/?id=b5eeb1485eb930c6e270021989e81218f7a8fccf
Submitter: Jenkins
Branch: master

commit b5eeb1485eb930c6e270021989e81218f7a8fccf
Author: Lucas Alvares Gomes <email address hidden>
Date: Wed May 7 15:52:55 2014 +0100

    Return the HTTP Location for accepted requestes

    After the server accepts a request (202) it now returns an URI in the
    HTTP Location header so that clients will know how to track the status
    of the request.

    Closes-Bug: #1317044
    Change-Id: I5286ed762426dea02a6513c0e31cbc9a8023f803

Changed in ironic:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in ironic:
milestone: none → juno-1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in ironic:
milestone: juno-1 → 2014.2
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.