[openstack-dev] [keystone]Why not common definition about normal HTTP status code like 2xx and 3xx?
samuel at lsd.ufcg.edu.br
Tue Jun 2 11:11:19 UTC 2015
Hi Chenhong Liu,
encapsulated into the WSGI application, Keystone is architecturally
organized as follows:
Application <-> Router <-> Controller <-> Manager <-> Driver
The Router connects called URLs with the code in the Controller, which
to Manager, which manages the business logic and in turn calls the
configured Driver to
access stored information.
The Controller level may catch raised exceptions from Manager/Driver
; those are the
exceptions defined at exception.py and represent the 4xx and 5xx HTTP
When a Controller call to Manager/Driver has success, it may set the
HTTP status code
itself  or it will be defined when rendering the WSGI response ;
those are the 2xx
HTTP status codes.
The 300 HTTP status code is particularly used in version discovery, and
is defined at that
specific manager call in the base Controller class .
Em 02.06.2015 06:45, Boris Bobrov escreveu:
> On Tuesday 02 June 2015 09:32:45 Chenhong Liu wrote:
> There is keystone/exception.py which contains Exceptions defined and
> inside keystone provide 4xx and 5xx status code. And we can use it
> exception.Forbidden.code, exception.forbiddent.title
> exception.NotFound.code, exception.NotFound.title
> This makes the code looks pretty and avoid error prone. But I can't
> definition for other status code, like 200, 201, 204, 302, and so on.
> code in keystone, especially the unit test cases, just write these
> code and title explicitly.
> How about add those definitions?
> These are standard HTTP codes:
> Description in exceptions is given because one error code can be used
> several errors. Success codes always have one meaning.
More information about the OpenStack-dev