Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Case Analysis created by openstack ice Edition

2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)05/31 Report--

Openstack ice version of the case analysis, I believe that many inexperienced people do not know what to do, so this article summarizes the causes of the problem and solutions, through this article I hope you can solve this problem.

Part one: detailed explanation of dashboard and novaclient of horizon

1. Create a virtual machine page:

2. Corresponding code at backend:

According to url = "horizon:project:instances:launch", find the corresponding urls.py file.

Call the view layer code:

Call the lanchinstance method of the workflow layer based on workflow_class = project_workflows.LaunchInstance:

Focus on the final code:

# most to api. The server_create method of the nova layer:

The following explains novaclient:# assembling client, assembling url parameters (including token of keystone, and calling v1 or v3 novaclient parameters, etc.)

Next, directly call the create () method in servers.py in novaclient:

Trace the last two lines of code for the create () method above:

Return self._boot (resource_url, response_key, * boot_args

* * boot_kwargs)

Call the _ boot () method:

Trace the last two lines of the above _ boot () method:

Return self._create (resource_url, body, response_key

Return_raw=return_raw, * * kwargs)

Call the _ create () method:

The complete url is spliced here and goes out using the post method. The next process makes novaclient-to-novaAPI calls according to wsgi rules.

Part two: detailed explanation of WSGI call

WSGI publish peer invocation diagram:

/ messages/update?id=1

Self._list () corresponds to the underlying index () function

Self._create () corresponds to the underlying create () function

Self._delete () corresponds to the underlying delete () function

Self._get () corresponds to the underlying show () function

The POST method is used to transmit body parameters.

For more details, please refer to the official website: http://routes.readthedocs.org/en/latest/restful.html

The wsgi release code of nova is in the _ _ inti__.py file: (other modules are in route.py)

The wsgi release code file for neutron:

According to the rules of wsgi, the create function of novaclient corresponds to the class Controller (wsgi.Controller): class create () method in the services.py that calls the nova layer.

:

After reading the above, have you mastered the method of case analysis created in openstack ice version? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report