Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: OpenStack: Netstack

Extenstions to Openstack Nova API

 

 

OpenStack netstack RSS feed   Index | Next | Previous | View Threaded


trinath.somanchi at gmail

Sep 26, 2012, 4:03 AM

Post #1 of 2 (558 views)
Permalink
Extenstions to Openstack Nova API

Hi All-


I'm new to development of Openstack Nova API.

I'm learning to write extensions for the NOVA API.

But NOVA API is not working fine with my extension.



My extension makes a list of servers in a project who have the user/client
given metadata info.

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

below is the Serve_actions class. I named my extension this way.

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.

Also, I have few more doubts while I gone through sc of Openstack Nova API.

How do URL get mapped to the extensions of the expert classes?

What are Controller and Resource extension? How are they different?

--
Regards,
----------------------------------------------
Trinath Somanchi,
+91 9866 235 130


emilien.macchi at stackops

Sep 26, 2012, 4:51 AM

Post #2 of 2 (533 views)
Permalink
Re: Extenstions to Openstack Nova API [In reply to]

This ML is deprecated and not related to your subject. You should try to
send it to openstack dev ML.

Regards

-Emilien
On Sep 26, 2012 1:04 PM, "Trinath Somanchi" <trinath.somanchi [at] gmail>
wrote:

> Hi All-
>
>
> I'm new to development of Openstack Nova API.
>
> I'm learning to write extensions for the NOVA API.
>
> But NOVA API is not working fine with my extension.
>
>
>
> My extension makes a list of servers in a project who have the user/client
> given metadata info.
>
> I have written an Resource extension, with parent member and collection as
> server.
>
> below is the Serve_actions class. I named my extension this way.
>
> 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.
>
> Also, I have few more doubts while I gone through sc of Openstack Nova API.
>
> How do URL get mapped to the extensions of the expert classes?
>
> What are Controller and Resource extension? How are they different?
>
> --
> Regards,
> ----------------------------------------------
> Trinath Somanchi,
> +91 9866 235 130
>
>
> --
> Mailing list: https://launchpad.net/~netstack
> Post to : netstack [at] lists
> Unsubscribe : https://launchpad.net/~netstack
> More help : https://help.launchpad.net/ListHelp
>
>

OpenStack netstack RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.