当前位置:网站首页>Nova中的api
Nova中的api
2022-06-25 12:36:00 【团子的守护】
1、nova中和api有关的文件/目录夹有:
api目录
多个rpcaip.py
多个api.py
2、openstack的几种api
Rest api:项目对外开放的接口。
本地调用api(local api):进程内方法调用,及普通的Python方法调用
Rpcapi.py就是某个功能模块的远程调用api
3、Rest API:RestAPI是openstack的标准对外接口,所有API都有官方文档详细定义。
openstack中的rest api实现有两个关键技术:wsgi和Paste Deployment.
wsgi是一种接口规范。定义web server和web application之间的接口。
Paste Deployment是一个针对wsgi开发的库,用来配置和加载wsgi application和server。openstack中配置都是通过api-paste.ini文件提供。通过这个文件就可以直接调用Paste Deployment代码来加载web server和上面的application。
4、openstack service endpoint
每个服务(nova,cinder,neutron等)都会在keystone上注册一个service endpoint,这个endpoint就是一个URL。每个rest api的完整URL是由这个endpoint+api文档中定义的URI构成的。
Ps:keystone中可以为每个service定义3个endpoint:一个是面向公网(public)使用的;一个是
面向内网(internal)使用的;还有一个是面向admi使用的。通常internal和admin的endpoint是相同的,都是用openstack管理网络中的IP地址。public需要使用公网IP地址。
5、本地调用api
和远程调用api非常类似,只能在进程间调用。每个服务会有一个api.py文件,这个文件就提供了该服务的本地调用api接口。如compute中api.py。查看api.py文件可以看到,该文件中的很多实现其实由调用了compute的rpcapi.py
6、远程调用api
每个openstack项目会包括多个功能独立的服务(service)。如nova会分成nova-api,nova-conductor,nova-compute...其中除了nova-api外,其余的都是RPC server。
7、openstack中的api使用规则
如果是跨项目的调用(如nova调用keystone,glance等),使用rest api(通过相应的python-XXXclient库)。安装nova时需要依赖python-cinderclient python-neutronclien python-glanceclient python-keystoneclient,因为nova需要调用这些rest api。其他项目也有类似的依赖。
如果是项目内跨服务调用,则使用RPC调用,通过服务提供的rpcapi.py文件。
边栏推荐
- Conway's law can not be flexibly applied as an architect?
- Include what you use to save chaotic header files
- J2EE从入门到入土01.MySQL安装
- Back test of quantitative trading - tqzfuturerenkowavestrategy
- Stockage des données en mémoire
- LeetCode链表题解技巧归纳总结
- 一篇文章讲清楚MySQL的聚簇/联合/覆盖索引、回表、索引下推
- 二叉树之_哈夫曼树_哈弗曼编码
- 数据在内存中的存储相关内容
- Lexical trap
猜你喜欢

mysql导入导出数据到excel表日期出现问题

New Gospel of drug design: Tencent, together with China University of science and technology and Zhejiang University, developed an adaptive graph learning method to predict molecular interactions and

Sword finger offer II 025 Adding two numbers in a linked list

Confusion caused by the ramp

Fedora 35 部署DNS主从和分离解析 —— 筑梦之路

Introduction to mongodb chapter 01 introduction to mongodb

Conway's law can not be flexibly applied as an architect?

About data storage in memory

Capabilities required by architects

AGCO AI frontier promotion (6.25)
随机推荐
Storage related contents of data in memory
字符串各操作函数与内存函数详解
深圳民太安智能二面_秋招第一份offer
Where is it safe to open an account for buying funds? Please give me your advice
Detailed explanation of string operation functions and memory functions
RESTful和RPC
There is a problem with the date when MySQL imports and exports data to excel
剑指 Offer II 025. 链表中的两数相加
Serevlt初识
Three lines of code to simply modify the project code of the jar package
Online service emergency research methodology
Django框架——缓存、信号、跨站请求伪造、 跨域问题、cookie-session-token
Meichuang was selected into the list of "2022 CCIA top 50 Chinese network security competitiveness"
Solve the problem that yarn cannot load files in vs Code
MySQL learning notes
QT mouse tracking
nacos无法修改配置文件Mysql8.0的解决方法
[machine learning] what is machine learning?
Resolution of PPT paper drawing
Summer Ending