Normal response codes of "Suspend stack" should be 200

Bug #1477109 reported by Yutaro Iwakiri
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Heat
Triaged
Low
Unassigned
openstack-api-site
Fix Released
Low
Unassigned

Bug Description

In http://developer.openstack.org/api-ref-orchestration-v1.html#stack_action_suspend,
the normal response code for "Suspend stack" is described 201.

However, heat returns 200.

But, it should probably be 202 in both!

Tags: heat
Changed in openstack-api-site:
assignee: nobody → Yutaro Iwakiri (iwakiri-yutaro)
Revision history for this message
Yutaro Iwakiri (iwakiri-yutaro) wrote :

CLI debug log
----
stack@vagrant-ubuntu-trusty-64:~$ heat --debug action-suspend stack

...

DEBUG (session) REQ: curl -g -i -X POST http://xxx.xxx.xxx.xxx:8004/v1/7e9157722a414d69b472d1b176478789/stacks/stack/actions -H "Accept: application/json" -H "User-Agent: python-heatclient" -H "X-Region-Name: RegionOne" -H "X-Auth-Token: {SHA1}b0b670a34442188f567f6ab6e2a336a9a3803f4f" -H "Content-Type: application/json" -H "X-Auth-Url: http://xxx.xxx.xxx.xxx:5000/v2.0" -d '{"suspend": null}'

...

DEBUG (connectionpool) "POST /v1/7e9157722a414d69b472d1b176478789/stacks/stack/19380f52-4f41-4701-8054-5fae1d8e8b4d/actions HTTP/1.1" 200 4
DEBUG (session) RESP: [200] date: Wed, 22 Jul 2015 03:36:04 GMT connection: keep-alive content-type: application/json; charset=UTF-8 content-length: 4 x-openstack-request-id: req-01557cb0-37f5-4fb8-b388-edfb56cabd01
RESP BODY: null

...
----

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/205346

Changed in openstack-api-site:
status: New → In Progress
Revision history for this message
Anne Gentle (annegentle) wrote :

However, for an asynchronous response, the heat code should make sure it follows the API working group guideline here: http://specs.openstack.org/openstack/api-wg/guidelines/http.html#xx-success-codes

I believe that suspend stack should return a URI of a status resource and also should return a 202 Accepted. Please log a bug against heat itself rather than the docs, and do not work on a doc change until the doc bug is triaged and set to Confirmed.

Changed in openstack-api-site:
status: In Progress → Incomplete
Revision history for this message
Yutaro Iwakiri (iwakiri-yutaro) wrote :

I agree with you that suspend stack should return a URI and 202 Accepted.

Revision history for this message
Tom Fifield (fifieldt) wrote :

I updated this bug to be in the heat tracker

Changed in openstack-api-site:
milestone: none → liberty
description: updated
Revision history for this message
Angus Salkeld (asalkeld) wrote :

I agree with this in principle, but wonder if we can pull this off without upsetting our users.

I'll see what I can do...

Changed in heat:
status: New → Triaged
importance: Undecided → Medium
assignee: nobody → Angus Salkeld (asalkeld)
milestone: none → liberty-3
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to heat (master)

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

Changed in heat:
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to heat (master)

Related fix proposed to branch: master
Review: https://review.openstack.org/214032

Angus Salkeld (asalkeld)
Changed in heat:
milestone: liberty-3 → next
Revision history for this message
Angus Salkeld (asalkeld) wrote :

Consensus seems to be that we change this in the next major API version. Doing this now would cause havoc to REST clients.

Changed in heat:
status: In Progress → Triaged
assignee: Angus Salkeld (asalkeld) → nobody
importance: Medium → Low
Atsushi SAKAI (sakaia)
tags: added: heat
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on heat (master)

Change abandoned by Angus Salkeld (<email address hidden>) on branch: master
Review: https://review.openstack.org/211454

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

Change abandoned by Angus Salkeld (<email address hidden>) on branch: master
Review: https://review.openstack.org/214032

Revision history for this message
Tom Fifield (fifieldt) wrote :

Hi,

any update on the status of this bug?

Changed in openstack-api-site:
status: Incomplete → Confirmed
importance: Undecided → Low
milestone: liberty → mitaka
Changed in openstack-api-site:
assignee: Yutaro Iwakiri (iwakiri-yutaro) → nobody
Revision history for this message
Atsushi SAKAI (sakaia) wrote :

Andras

Would you notice me? When is the planned date for the heat next major API version?

> Consensus seems to be that we change this in the next major API version.

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

Sounds like the docs should be revised to indicate what it really is.

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

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

commit 75d5026333b26c880bdabc6efb6bab5ff459037e
Author: Yutaro Iwakiri <email address hidden>
Date: Fri Jul 24 10:56:37 2015 +0900

    Fix a wrong response code in Heat API Reference

    Fix the response code for "Suspend stack" in Heat API Reference
    from 201 to 200.

    Change-Id: I8dbef4b09a61efa4e0b36006a89eed53cdcf0e9d
    Closes-Bug: #1477109

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