API type in OpenSTACL
In openstack, no matter the calls between programs, internal calls for various services and functions in openstack, or external calls are all carried out in the form of API. Here’s a look at some of the common API types in openstack.
1. The first is that the internal API is mainly for the internal use of native programs.
Such as nova_master/nova/compute/API. Py files in the API class is mainly for the manager to call, the call which API class and the use of it in a very important dynamic load method to determine, is very flexible, I think this usage is very much like interface oriented programming in c#, c++ and even more flexible, taking advantage of dynamic languages.
2. One TYPE of API is RPC API, which realizes remote invocation of methods of different hosts through advanced message queue.
Such as nova_master/nova/compute/rpcapi. Py, among them the method called is the method for the manager. The method of RPC is the basic method to implement distributed program, and the RPC method of message queue is the common way to implement many cloud computing frameworks.
3. Another KIND of API is the API exposed to the outside world through the way of Web resources, exposing the provided services as Web resources, which can facilitate the access of the outside world
Openstack uses a WSGIService service with a corresponding API to realize external services.
Another TYPE of API is the Client API, which is the encapsulation of The Web API. This form of API is mainly to facilitate users to call the COMPLEX API in the form of Web resources, simplifying operations and facilitating users to call through programs.