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>
Co-Authored-By: ashutosh mishra <mca.ashu4@gmail.com>
(cherry picked from commit 7dc8e9d5ee)
(cherry picked from commit 54d761dee1)
This commit is contained in:
Rahul Shikhare
2016-07-20 18:39:29 +05:30
committed by Hemanth Ravi
parent 913e3f09fb
commit 1437c070bd
10 changed files with 21 additions and 6 deletions

View File

@@ -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',

View File

@@ -18,9 +18,8 @@ import requests
import subprocess
import time
from gbpservice.nfp.base_configurator import base_controller
from gbpservice.nfp.pecan import base_controller
BaseController = base_controller.BaseController
LOG = logging.getLogger(__name__)
TOPIC = 'configurator'
NFP_SERVICE_LIST = ['heat', 'ansible']
@@ -32,7 +31,7 @@ notifications = []
cache_ips = set()
class Controller(BaseController):
class Controller(base_controller.BaseController):
"""Implements all the APIs Invoked by HTTP requests.

View File

@@ -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'

View File

@@ -59,3 +59,10 @@ logging = {
}
}
}
cloud_services = [
{'service_name': 'configurator',
'topic': 'configurator',
'reporting_interval': '10', # in seconds
'apis': ['CONFIGURATION']
}
]

View File

@@ -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):

View File

@@ -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]