Hi, guys,
When I port hypervisor extension into Nova API v3, I found some actions
doesn't follow REST principles.
But I still have some doubt. So I send mail to here, hope I can get some
suggestion.
Let me explain why I want to change those API.
For search action: https://review.openstack.org/#/c/33774/
The original search action works as:
'/os-hypervisors/[filters]/search'
It use part of URL as filters. So I change it as:
'/os-hypervisors/search?query=[filters]'
(I follow suggestion from
http://www.slideshare.net/apigee/restful-api-design-second-edition#btnNext
at 77 pages)
For servers action: https://review.openstack.org/#/c/33775/
The original servers action works as:
'/os-hypervisors/[filters]/servers'
It use part of URL as filters too.
So I change it as:
'/os-hypervisors/[hypervisor id]/servers'
And it will return all the servers that run on the specific hypervisor.
If we want to finish the same task as the old servers action we can do as:
hypervisors = GET /os-hypervisors/search?query=[filters]
for hyper in hypervisors
servers += GET /os-hypervisors/[hyper.id]/servers
Welcome any comment!
Thanks,
Alex
_______________________________________________
OpenStack-dev mailing list
[email protected]
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev