api_服务流程

65 阅读1分钟

通过 之前的 分析

我们 来到了

[app:apiv2] paste.app_factory = cinder.api.v2.router:APIRouter.factory

  1. 查看 v2 factory /root/cinder/cinder/api/v2/router.py
class APIRouter(cinder.api.openstack.APIRouter):
    """Routes requests on the API to the appropriate controller and method."""
    ExtensionManager = extensions.ExtensionManager

    def _setup_routes(self, mapper, ext_mgr):
    pass
  1. 没有实现 ,继续查找 他的 父类

/root/cinder/cinder/api/openstack/init.py

class APIRouter(base_wsgi.Router):
    """Routes requests on the API to the appropriate controller and method."""
    ExtensionManager = None  # override in subclasses

    @classmethod
    def factory(cls, global_config, **local_config):
        """Simple paste factory, :class:`cinder.wsgi.Router` doesn't have."""
        return cls()