From e8f00ec45adb71eac51e110ea19dd2bead78b2d3 Mon Sep 17 00:00:00 2001 From: vrvarma Date: Thu, 1 Nov 2018 10:46:18 -0400 Subject: oof changes for the new sdnr-configdb changes OSDF changes required for the latest configdb api specs. Improve performance building the minizinc request Change-Id: I5558c96c13f3cac25d50aed61ded3ffa079df3f7 Signed-off-by: vrvarma Issue-ID: OPTFRA-388 --- osdf/optimizers/pciopt/configdb.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'osdf/optimizers/pciopt/configdb.py') diff --git a/osdf/optimizers/pciopt/configdb.py b/osdf/optimizers/pciopt/configdb.py index bebc5c0..0e76884 100644 --- a/osdf/optimizers/pciopt/configdb.py +++ b/osdf/optimizers/pciopt/configdb.py @@ -42,20 +42,20 @@ def request(req_object, osdf_config, flat_policies): cell_list_response['network_id'] = network_id + ts = dt.strftime(dt.now(), '%Y-%m-%d %H:%M:%S%z') + rc = RestClient(userid=uid, passwd=passwd, method="GET", log_func=debug_log.debug, headers=headers) - cell_list_url = '{}/{}?networkId={}'.format(config['configDbUrl'], config['configDbGetCellListUrl'], network_id) + cell_list_url = '{}/{}/{}/{}'.format(config['configDbUrl'], config['configDbGetCellListUrl'], network_id, ts) cell_list_resp = rc.request(raw_response=True, url=cell_list_url) cell_resp = cell_list_resp.json() - ts = dt.strftime(dt.now(), '%Y-%m-%dT%H:%M:%S%z') cell_list = [] count = 0 for cell_id in cell_resp: cell_info = {'cell_id': cell_id, 'id': count} - nbr_list_url = '{}/{}?cellId={}&ts={}'.format(config['configDbUrl'], config['configDbGetNbrListUrl'], cell_id, - ts) + nbr_list_url = '{}/{}/{}/{}'.format(config['configDbUrl'], config['configDbGetNbrListUrl'], cell_id, ts) nbr_list_raw = rc.request(url=nbr_list_url, raw_response=True) cell_info['nbr_list'] = nbr_list_raw.json() cell_list.append(cell_info) -- cgit 1.2.3-korg