1 # -------------------------------------------------------------------------
2 # Copyright (c) 2018 AT&T Intellectual Property
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
16 # -------------------------------------------------------------------------
19 from apps.pci.optimizers.config.config_client import ConfigClient
22 def request(req_object, osdf_config, flat_policies):
23 """Process a configdb request from a Client (build Conductor API call, make the call, return result)
25 :param req_object: Request parameters from the client
26 :param osdf_config: Configuration specific to OSDF application (core + deployment)
27 :param flat_policies: policies related to PCI Opt (fetched based on request)
28 :return: response from ConfigDB (accounting for redirects from Conductor service
30 cell_list_response = {}
32 network_id = req_object['cellInfo']['networkId']
34 cell_list_response['network_id'] = network_id
36 config = osdf_config.deployment
38 config_client = ConfigClient.create(config['configClientType'])
40 cell_resp = config_client.get_cell_list(network_id)
44 for cell_id in cell_resp:
48 'nbr_list': config_client.get_nbr_list(network_id, cell_id)
50 cell_list.append(cell_info)
53 cell_list_response['cell_list'] = cell_list
55 return cell_resp, cell_list_response