Ask Your Question
0

Api Controller

asked 2011-03-22 09:00:07 -0500

raphael-g gravatar image

Hi,

I think I can now understand the links and interactions between the compute, network controllers and the scheduler in the code However, I still don't understand how the services are exposed (how does the API-node work ?): For example, I don't manage to fill the call chain between a euca-run-instances command and the run_instances method call in the CloudController.py . What is precisely happening in between ?

Thanks

edit retag flag offensive close merge delete

8 answers

Sort by ยป oldest newest most voted
0

answered 2011-03-22 15:12:54 -0500

jaypipes gravatar image

Hi!

So, the API node is the "top-level" endpoint for OpenStack. It receives HTTP requests from various clients, including the eucatools. The HTTP requests from the clients will correspond to either the EC2 API or OpenStack API. For eucatools clients clearly the EC2 API is used, which means that the eucatool will be sending an HTTP request to the API node on the port that the EC2 API is configured on (typically 8773). The API node will receive this request and route the request to the EC2 API Cloud Controller (nova/api/ec2/cloud.py). If the HTTP request was /?Action=RunInstances, the Cloud Controller will execute the run_instances() method, which sends a message to the scheduler to begin the process of launching instances.

Hope this helps! I agree it can be a somewhat convoluted and complicated string of interrelated nodes and methods!

-jay

edit flag offensive delete link more
0

answered 2011-03-22 15:15:33 -0500

jaypipes gravatar image

On Tue, Mar 22, 2011 at 11:12 AM, Jay Pipes question150000@answers.launchpad.net wrote:

So, the API node is the "top-level" endpoint for OpenStack. It receives

To be more clear, I should have said that the API node is the top-level endpoint for Nova, not OpenStack. OpenStack is the set of projects. Nova is the cloud controller fabric project, and that is what I was referring to.

-jay

edit flag offensive delete link more
0

answered 2011-03-22 15:14:57 -0500

jaypipes gravatar image

On Tue, Mar 22, 2011 at 11:12 AM, Jay Pipes question150000@answers.launchpad.net wrote:

So, the API node is the "top-level" endpoint for OpenStack. It receives

To be more clear, I should have said that the API node is the top-level endpoint for Nova, not OpenStack. OpenStack is the set of projects. Nova is the cloud controller fabric project, and that is what I was referring to.

-jay

edit flag offensive delete link more
0

answered 2011-03-22 15:28:23 -0500

vishvananda gravatar image

The api node is implemented as a wsgi app that uses a number of wsgi apps and middlewares:

The chain can be found in etc/api-paste.ini and the code for the ec2 wsgi components are in nova/api/ec2

Specifically in nova/api/ec2: __init__.py : Requestify creates an apirequest.py : APIRequest with a specific controller (cloud.py) __init__.py : Executor executes the request by calling APIRequest.invoke() and handles any errors APIRequest converts the http request to method calls on the controller (cloud.py) and formats the result

I hope that clarifies

On Mar 22, 2011, at 2:01 AM, Raphael.G wrote:

Question #150000 on OpenStack Compute (nova) changed: https://answers.launchpad.net/nova/+q...

Description changed to: Hi,

I think I can now understand the links and interactions between the compute, network controllers and the scheduler in the code However, I still don't understand how the services are exposed (how does the API-node work ?): For example, I don't manage to fill the call chain between a euca-run-instances command and the run_instances method call in the CloudController.py . What is precisely happening in between ?

Thanks


You received this question notification because you are a member of Nova Core, which is an answer contact for OpenStack Compute (nova).

edit flag offensive delete link more
0

answered 2011-03-23 10:51:20 -0500

raphael-g gravatar image

Ok. Thank you both. Thanks to your messages I think I begin to understand how an euca-... command in translated to match a cloud.py method. The wsgi apps are still not clear for me. I will get information on that topic.

I went to the EC2 API Reference page and saw the link between the command and their APIs. Am I wrong if I say that an EC2 action is converted to a cloud.py method thanks to the _camelcase_to_underscore method found in apirequest.py ?

edit flag offensive delete link more
0

answered 2011-03-23 14:24:27 -0500

jaypipes gravatar image

On Wed, Mar 23, 2011 at 6:51 AM, Raphael.G question150000@answers.launchpad.net wrote:

Am I wrong if I say that an EC2 action is converted to a cloud.py method thanks to the _camelcase_to_underscore method found in apirequest.py ?

Nope, that is correct.

-jay

edit flag offensive delete link more
0

answered 2011-03-23 16:18:20 -0500

raphael-g gravatar image

Thanks Jay Pipes, that solved my question.

edit flag offensive delete link more
0

answered 2011-03-23 16:18:42 -0500

raphael-g gravatar image

Thank you both

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2011-03-22 09:00:07 -0500

Seen: 77 times

Last updated: Mar 23 '11