[openstack-dev] Writing Openstack Nova API extensions

Trinath Somanchi trinath.somanchi at gmail.com
Wed Sep 26 05:07:25 UTC 2012


Hi-

I have written an Resource extension, with parent member and collection as
server.

below is the Serve_actions class.

class Server_actions(extensions.ExtensionDescriptor):
    def get_resources(self):
        resources = []
        resource = extensions.ResourceExtension('server_actions',
                                                 ServerActionsController(),

 member_actions={"metadetail":"GET"},

 parent=dict(member_name='server', collection_name='servers'))
        resources.append(resource)
        return resources

Here, the parent is the Server expert controller and the extension is the
Resource extension.

But I execute the URL as "GET
http://10.232.90.82:8774/v2/e216fcb54dc944a8ab16e4e325299643/servers/metadetail?key=Created+By&value=TestApp.py
"

I see that the API, is not mapping the URI to the newly created extension
which handles the "metadetail" request.

In the logs, 'wsgiorg.routing_args': (<routes.util.URLGenerator object at
0x38a5050>, {*'action': u'show'*, 'controller':
<nova.api.openstack.wsgi.Resource object at 0x2bb6810>, 'project_id':
u'e216fcb54dc944a8ab16e4e325299643', 'id': u'metadetail'}), actions is
reported as "Show" rather than "metadetail".

Can any one guide me on where I was wrong in my new extension
implementation.

Thanking you for the help in advance.




-- 
Regards,
----------------------------------------------
Trinath Somanchi,
+91 9866 235 130
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20120926/4acf550b/attachment.html>


More information about the OpenStack-dev mailing list