← Back to team overview

openstack team mailing list archive

ResourceExtension member_actions question

 


Is it possible to define a ResourceExtension with a member_action that is
the same for both PUT and GET requests?

For example, let's say I want to add "foo" as a member action for images. I
tried to define the extension as:
        res = extensions.ResourceExtension('images',
                MyController(),
                member_actions={'foo':'PUT', 'foo' :'GET'},
                collection_actions={})
But the mapper only finds my foo method for either the PUT or the GET and
not both (depending on whether the method has declared a body parameter).

I'd like to use the same URL (/images/<id>/foo) for both PUT and GET
requests.
It works if I define 2 different controllers with the PUT in one and GET in
the other, but it seems like there should be a better way.
Any ideas?
Thanks.
-Paul