API actions can not be versioned

Bug #1512403 reported by Valeriy Ponomaryov
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Invalid
Undecided
Unassigned
OpenStack Shared File Systems Service (Manila)
Fix Released
Low
Unassigned
cinder (Ubuntu)
Fix Released
Undecided
Unassigned

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.

Tags: api versioning
tags: added: api versioning
description: updated
Revision history for this message
Clinton Knight (clintonk) wrote :

This is a known issue, and the Nova author acknowledged it was intentional but ugly.

https://github.com/openstack/manila/blob/master/manila/api/openstack/wsgi.py#L977

It is an issue in Manila's admin actions module, where we had to pick non-overlapping names for the versioned methods.

Changed in manila:
status: New → Confirmed
Revision history for this message
Rodrigo Barbieri (rodrigo-barbieri2010) wrote :

Updated description stating that duplicated action names also do not work. As investigated by Valeriy and myself.

description: updated
Changed in manila:
assignee: nobody → Valeriy Ponomaryov (vponomaryov)
milestone: none → mitaka-2
Changed in manila:
assignee: Valeriy Ponomaryov (vponomaryov) → nobody
milestone: mitaka-2 → none
Changed in manila:
importance: Undecided → Low
no longer affects: cinder (Ubuntu)
Revision history for this message
TommyLike (hu-husheng) wrote :

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"}}'

```

Chuck Short (zulcss)
Changed in cinder (Ubuntu):
status: New → Fix Released
Tom Barron (tpb)
Changed in manila:
status: Confirmed → Fix Released
Changed in cinder:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.