[Openstack] ResourceExtension member_actions question

Paul Chmielewski paulchm at us.ibm.com
Fri Sep 7 19:37:12 UTC 2012



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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack/attachments/20120907/fe0b6a91/attachment.html>


More information about the Openstack mailing list