NFP - Pecan controller enhancements to support configuration patches
This changeset contains enhancements done for pecan controller which was merged
into GBP master branch.
These enhancements are to support submission of configurator and config orchestrator.
These changes are primarily into the following directories.
(1) gbpservice/nfp
(2) gbpservice/neutron/tests/unit/nfp
Change-Id: I03eef60b2c9afa57f0ca0635321fac28944b43fe
Implements: blueprint gbp-network-services-framework
Co-Authored-By: Akash Deep <akash.deep@oneconvergence.com>
(cherry picked from commit 7dc8e9d5ee)
This commit is contained in:
committed by
Hemanth Ravi
parent
27945595c1
commit
54d761dee1
@@ -23,7 +23,6 @@ from gbpservice.nfp.pecan import constants
|
||||
|
||||
setattr(pecan, 'mode', constants.base)
|
||||
|
||||
from gbpservice.nfp.pecan.api import root_controller
|
||||
|
||||
ERROR = 'error'
|
||||
UNHANDLED = 'unhandled'
|
||||
@@ -49,6 +48,8 @@ class ControllerTestCase(base.BaseTestCase, rest.RestController):
|
||||
test cases before execution of each test case.
|
||||
"""
|
||||
super(ControllerTestCase, self).setUp()
|
||||
from gbpservice.nfp.pecan.api import root_controller
|
||||
reload(root_controller)
|
||||
RootController = root_controller.RootController()
|
||||
self.app = webtest.TestApp(pecan.make_app(RootController))
|
||||
self.data = {'info': {'service_type': 'firewall',
|
||||
@@ -18,7 +18,7 @@ import requests
|
||||
import subprocess
|
||||
import time
|
||||
|
||||
from gbpservice.nfp.base_configurator.base_controller import BaseController
|
||||
from gbpservice.nfp.pecan import base_controller
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
TOPIC = 'configurator'
|
||||
@@ -31,7 +31,7 @@ notifications = []
|
||||
cache_ips = set()
|
||||
|
||||
|
||||
class Controller(BaseController):
|
||||
class Controller(base_controller.BaseController):
|
||||
|
||||
"""Implements all the APIs Invoked by HTTP requests.
|
||||
|
||||
|
||||
@@ -68,6 +68,8 @@ CONFIG_TAG_RESOURCE_MAP = {
|
||||
CUSTOM_JSON: 'custom_json'}
|
||||
|
||||
LOADBALANCER_RPC_API_VERSION = "2.0"
|
||||
LOADBALANCERV2_RPC_API_VERSION = "1.0"
|
||||
|
||||
HEALTHMONITOR_RESOURCE = 'healthmonitor'
|
||||
INTERFACE_RESOURCE = 'interfaces'
|
||||
ROUTES_RESOURCE = 'routes'
|
||||
|
||||
@@ -59,3 +59,10 @@ logging = {
|
||||
}
|
||||
}
|
||||
}
|
||||
cloud_services = [
|
||||
{'service_name': 'configurator',
|
||||
'topic': 'configurator',
|
||||
'reporting_interval': '10', # in seconds
|
||||
'apis': ['CONFIGURATION']
|
||||
}
|
||||
]
|
||||
|
||||
@@ -35,6 +35,8 @@ class RootController(object):
|
||||
v1 = _controllers[constants.BASE_CONTROLLER].V1Controller()
|
||||
elif pecan.mode == constants.base_with_vm:
|
||||
v1 = _controllers[constants.REFERENCE_CONTROLLER].V1Controller()
|
||||
elif pecan.mode == constants.advanced:
|
||||
v1 = _controllers[constants.ADVANCED_CONTROLLER].V1Controller()
|
||||
|
||||
@pecan.expose()
|
||||
def get(self):
|
||||
|
||||
@@ -13,14 +13,18 @@
|
||||
|
||||
BASE_CONTROLLER = 'base_controller'
|
||||
REFERENCE_CONTROLLER = 'reference_controller'
|
||||
ADVANCED_CONTROLLER = 'advanced_controller'
|
||||
|
||||
|
||||
controllers = {
|
||||
BASE_CONTROLLER: 'gbpservice.nfp.base_configurator.controllers',
|
||||
REFERENCE_CONTROLLER: ('gbpservice.tests.contrib'
|
||||
'.nfp_service.reference_configurator.controllers')
|
||||
'.nfp_service.reference_configurator.controllers'),
|
||||
ADVANCED_CONTROLLER: ('gbpservice.contrib.nfp.configurator'
|
||||
'.advanced_controller.controller_loader')
|
||||
}
|
||||
|
||||
base_with_vm = 'base_with_vm'
|
||||
base = 'base'
|
||||
modes = [base, base_with_vm]
|
||||
advanced = 'advanced'
|
||||
modes = [base, base_with_vm, advanced]
|
||||
|
||||
Reference in New Issue
Block a user