[openstack-dev] HTTP response code for not implemented features

Christopher B Ferris chrisfer at us.ibm.com
Thu Dec 6 12:32:20 UTC 2012


Mark,

The term "request method" in the HTTP spec refers exclusively to the tokens described in sect 5.1.1 Method (GET, PUT, POST, etc). Hence, 405 and 501 are inappropriate, because they refer to situations where the request method is not implemented, etc.

I should think that 400 is appropriate,accompanied with a suitable explanation (error message).

Cheers,

Christopher Ferris
IBM Distinguished Engineer, CTO Industry and Cloud Standards
Member, IBM Academy of Technology
IBM Software Group, Standards Strategy
email: chrisfer at us.ibm.com
Twitter: christo4ferris
phone: +1 508 234 2986

On Dec 6, 2012, at 7:06 AM, "Mark McLoughlin" <markmc at redhat.com> wrote:

> Hey,
> 
> Kevin raised a good point here:
> 
>   https://review.openstack.org/17565
> 
> Currently attempting to set a host's status to disabled will fail with
> 400 Bad Request (without any explanatory error message) if you're using
> the libvirt driver.
> 
> To be clear, this is a PUT request containing a representation of the
> desired status for the host and we don't support changing its status.
> 
> I proposed changing this to return a 501 Not Implemented with an
> explanatory message, but it's not clear that's correct either.
> 
> Things to consider:
> 
>   - 4xx codes are for client errors - is this a client error? There is
>     no way for a client to know that a cloud supports this without
>     trying it, so it's obviously something we expect clients to do.
> 
>   - 400 explicitly states that clients should not retry the request
>     without modifications. That does apply here.
> 
>   - 405 Method Not Allowed is only appropriate where a request method
>     isn't allowed. We do support PUT requests on host resources, just
>     not this particular request.
> 
>   - 5xx codes "indicate cases in which the server is aware that it has
>     erred or is incapable of performing the request". The latter part
>     seems appropriate here.
> 
>   - The 501 docs say:
> 
>        The server does not support the functionality required to
>        fulfill the request. This is the appropriate response when the
>        server does not recognize the request method and is not capable
>        of supporting it for any resource.
> 
>     The first sentence makes it seem like 501 is a good fit here. I
>     take the second sentence to be an example of one of cases where 501
>     is appropriate, rather than the only case.
> 
> 
> I think I'm still leaning towards 501. Any thoughts?
> 
> Cheers,
> Mark.
> 
> 
> _______________________________________________
> OpenStack-dev mailing list
> OpenStack-dev at lists.openstack.org
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
> 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20121206/d787e5ed/attachment.html>


More information about the OpenStack-dev mailing list