[openstack-dev] Writing Openstack Nova API extensions

Kevin L. Mitchell kevin.mitchell at rackspace.com
Wed Sep 26 14:51:59 UTC 2012


On Wed, 2012-09-26 at 10:37 +0530, Trinath Somanchi wrote:
> But I execute the URL as
> "GET http://10.232.90.82:8774/v2/e216fcb54dc944a8ab16e4e325299643/servers/metadetail?key=Created+By&value=TestApp.py"

As you have declared the ResourceExtension, the URL that maps to the
metadetail method would be, I believe, more like this:

        http://10.232.90.82:8774/v2/<tenant>/servers/server_actions/metadetail

You might try that and see if that gets you any closer to your goal.

What I would suggest trying for the ResourceExtension declaration would
be something more like ResourceExtension('metadetail',
ServerMetaDetailController(), parent=dict(…)) and implementing the
index() method to report your metadetail call.

(Also, it's probably a bad idea to use "server_actions.py" to contain
your extension code, since that duplicates the name of an existing
extension.  Probably not a problem for PoC code as you're trying to
figure out how extensions work, but when you get ready for production,
make sure your names make sense and are distinct…)
-- 
Kevin L. Mitchell <kevin.mitchell at rackspace.com>




More information about the OpenStack-dev mailing list