<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Nov 25, 2013 at 6:00 PM, Christopher Yeoh <span dir="ltr"><<a href="mailto:cbkyeoh@gmail.com" target="_blank">cbkyeoh@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div class="im">On Tue, Nov 26, 2013 at 7:27 AM, Matt Riedemann <span dir="ltr"><<a href="mailto:mriedem@linux.vnet.ibm.com" target="_blank">mriedem@linux.vnet.ibm.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">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?<br>
<br></blockquote><div><br></div></div><div>Yea I think in this case we've just got this wrong for the V3 API here. It's validating a parameter, and although the client (glance/neutron etc) may return a 404 to us, we should be returning a 400 (with a decent message) to our client.<br>
</div></div></div></div></blockquote><div><br></div><div>I agree, I think 400 makes more sense than 404. I'll go a head and make this change for the v3 API's as well. </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>
</div><div class="im"><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
To muddy the waters more, ImageNotFound, FlavorNotFound and KeypairNotFound are translated to 400 errors in both the V2 and V3 APIs.<br>
<br>
So why should the network-specific NotFound exceptions be a 404 but the others aren't?<br>
<br>
>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.<br>
<br>
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.<br>
<br></blockquote><div><br></div></div><div>At the very least we should be consistent across our API.</div></div></div></div></blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"></div><div class="gmail_quote">Chris.<br></div></div></div>
<br>_______________________________________________<br>
OpenStack-dev mailing list<br>
<a href="mailto:OpenStack-dev@lists.openstack.org">OpenStack-dev@lists.openstack.org</a><br>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
<br></blockquote></div><br></div></div>