예제 #1
0
 def get_service_instance_id_from_order(self, service_order_id):
     """
         Get NBI Service Catalog
     """
     try:
         url = self.nbi_url + "/serviceOrder/" + service_order_id
         self.logger.debug("NBI request: %s", url)
         service_instance_found = False
         instance_id = None
         nb_try = 0
         nb_try_max = 5
         while service_instance_found is False and nb_try < nb_try_max:
             response = onap_test_utils.get_simple_request(
                 url, self.nbi_headers, self.proxy)
             self.logger.info("NBI: looking for service instance id....")
             if response["state"] == "COMPLETED":
                 self.logger.info("NBI request COMPLETED")
                 service_instance_found = True
                 instance_id = response["orderItem"][0]["service"]["id"]
                 self.logger.info("Instance ID found %s", instance_id)
             time.sleep(10)
             nb_try += 1
     except Exception as err:  # pylint: disable=broad-except
         self.logger.error("impossible to perform the request on NBI: %s",
                           str(err))
     if service_instance_found is False:
         self.logger.info("Service instance not found")
     return instance_id
예제 #2
0
 def get_so_request_log(self):
     """
         Get Info on previous request
     """
     url = self.so_url + "/ecomp/mso/infra/orchestrationRequests/v5/"
     self.logger.debug("SO request: %s", url)
     return onap_test_utils.get_simple_request(url, self.so_headers,
                                               self.proxy)
예제 #3
0
 def get_nbi_service_catalog(self):
     """
         Get NBI Service Catalog
     """
     url = self.nbi_url + "/serviceSpecification"
     self.logger.debug("NBI request: %s", url)
     return onap_test_utils.get_simple_request(url,
                                               self.nbi_headers,
                                               self.proxy)
예제 #4
0
 def get_nbi_service_inventory(self):
     """
         Get NBI service inventory
     """
     url = self.nbi_url + "/service"
     self.logger.debug("NBI request: %s", url)
     return onap_test_utils.get_simple_request(url,
                                               self.nbi_headers,
                                               self.proxy)
예제 #5
0
 def get_nbi_service_order(self, **kwargs):
     """
         Get NBI Service order
         If an order_id is precised as kwargs, retrieve only related info
     """
     url = self.nbi_url + "/serviceOrder"
     if "order_id" in kwargs:
         url += "/" + kwargs["order_id"]
     self.logger.debug("NBI request: %s", url)
     return onap_test_utils.get_simple_request(url,
                                               self.nbi_headers,
                                               self.proxy)