[Bug 1512403] Re: API actions can not be versioned
TommyLike
tommylikehu at gmail.com
Wed Dec 21 01:21:21 UTC 2016
I think this no longer affect Cinder and Manila, tested in devstack both
for both project, take manila for example:
```python
@wsgi.Controller.api_version('2.7', '2.21')
@wsgi.action('reset_status')
def share_reset_status(self, req, id, body):
print('this is method one')
return self._reset_status(req, id, body)
@wsgi.Controller.api_version('2.22')
@wsgi.action('reset_status')
def share_reset_status(self, req, id, body):
print('this is method two')
return self._reset_status(req, id, body)
```
these method could be triggered by specifying different mircoversion:
```cmd
curl -i -X POST http://10.229.50.225:8786/v2/96bdd0edecc442a1b90454bb2ccfe31b/shares/1a3a0430-bc54-4bd2-a367-f851fe9b8347/action -H "X-Openstack-Manila-Api-Version: 2.22" -H "X-Auth-Token: d79a5605ebc049f78a85a145778b0632" -H "Content-Type: application/json" -H "Accept: application/json" -H "User-Agent: python-manilaclient" -d '{"reset_status": {"status": "error"}}'
```
--
You received this bug notification because you are a member of Ubuntu
OpenStack, which is subscribed to cinder in Ubuntu.
https://bugs.launchpad.net/bugs/1512403
Title:
API actions can not be versioned
Status in Manila:
Confirmed
Status in cinder package in Ubuntu:
New
Bug description:
Manila has functionality of API versioning only for resources, but not
actions with resources. So, it is impossible to make several versions
of some action using same name of method or name of action as required
by versioning functionality.
For the moment, versioning of actions can be achieved by usage of
different names and methods for different versions. It is some kind of
ugly when we have lots of them.
Another approach is having a single method, single action name, and
check API version in request parameter to decide the method behavior.
To manage notifications about this bug go to:
https://bugs.launchpad.net/manila/+bug/1512403/+subscriptions
More information about the Ubuntu-openstack-bugs
mailing list