[openstack-dev] [nova] Should the server create API return 404 errors?

Matt Riedemann mriedem at linux.vnet.ibm.com
Mon Nov 25 20:57:40 UTC 2013


Aaron Rosen is working a patch [1] to handle a NetworkNotFound exception 
in the server create API.  For the V2 API this will return a 400 error. 
  For the V3 API this will return a 404 because of a V3-specific patch 
[2].  The API docs list 404 as a valid response code, but is it 
intuitive for a POST request like this?

To muddy the waters more, ImageNotFound, FlavorNotFound and 
KeypairNotFound are translated to 400 errors in both the V2 and V3 APIs.

So why should the network-specific NotFound exceptions be a 404 but the 
others aren't?

 From a programmatic perspective, I should validate that my request 
parameters are valid before calling the API in order to avoid a 404. 
 From a user's perspective, a 404 seems strange - does it mean that the 
server I'm trying to create isn't found?  No, that's counter-intuitive.

Ultimately I think we should be consistent, so if 404 is OK, then I 
think the V3 API should make ImageNotFound, FlavorNotFound and 
KeypairNotFound return a 404 also.

Thoughts?

[1] https://review.openstack.org/#/c/54202/
[2] https://review.openstack.org/#/c/41863/

-- 

Thanks,

Matt Riedemann




More information about the OpenStack-dev mailing list