All of our REST resources are setup with the route.mapper (when you dig deep enough), which registers a set of default methods on all the resources in nova. It creates 5 methods:
GET /resource - def index
POST /resource- def create
PUT /resource/{id} - def update
DELETE /resource/{id} - def delete
GET /resource/{id} - def show
Should a resource not support all those actions, the default behavior ends up returning 200 with some boilerplate HTML (a good example is doing a DELETE on /v2/ for nova). There doesn't seem to be any side effects from this action, however for correctness we should do the right thing here.
The correct behavior would be the return of an HTTP 405 (method not allowed) in these cases.
Hello, I found where is the problem :
in nova/nova/ api/openstack/ compute/ __init_ _.py, the APIRouter class
mapper. connect( "versions" , "/",
controller= self.resources[ 'versions' ],
action= 'show')
it should add request method conditions like this:
mapper. connect( "versions" , "/",
controller= self.resources[ 'versions' ],
action= 'show',
conditions= {"method" : ['GET']})
But this changes the result from HTTP 200 OK to HTTP 404 Not Found, not 405.
And only versions have this problem, others are normal.
You can test like this:
$ curl -X DELETE -v -H "X-Auth- Token:$ AUTH_TOKEN" http:// 192.168. 1.100:8774/ v2/