-def get_nst_solution(request_json):
-# the file is in the same folder for now will move it to the conf folder of the has once its integrated there...
- config_input_json = os.path.join(BASE_DIR, 'conf/configIinputs.json')
- try:
+ def run(self):
+ self.process_nst_selection()
+
+ def process_nst_selection(self):
+ """Process a PCI request from a Client (build config-db, policy and API call, make the call, return result)
+
+ :param req_object: Request parameters from the client
+ :param osdf_config: Configuration specific to OSDF application (core + deployment)
+ :return: response from NST Opt
+ """
+ try:
+ rest_client = get_rest_client(self.request_json, service='so')
+ solution = self.get_nst_solution()
+ solution = self.get_nst_selection_response(solution)
+ except Exception as err:
+ error_log.error("Error for {} {}".format(self.request_info.get('requestId'),
+ traceback.format_exc()))
+ error_message = str(err)
+ solution = self.error_response(error_message)
+
+ try:
+ rest_client.request(json=solution, noresponse=True)
+ except RequestException:
+ error_log.error("Error sending asynchronous notification for {} {}".
+ format(self.request_info['requestId'], traceback.format_exc()))
+
+ def get_nst_solution(self):
+ """the file is in the same folder for now will move it to the conf folder of the has once its
+
+ integrated there...
+ """
+
+ config_input_json = os.path.join(BASE_DIR, 'conf/configIinputs.json')