diff options
Diffstat (limited to 'robotframework-onap/ONAPLibrary/BaseAAIKeywords.py')
-rw-r--r-- | robotframework-onap/ONAPLibrary/BaseAAIKeywords.py | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/robotframework-onap/ONAPLibrary/BaseAAIKeywords.py b/robotframework-onap/ONAPLibrary/BaseAAIKeywords.py index 222c54b..fdc9e84 100644 --- a/robotframework-onap/ONAPLibrary/BaseAAIKeywords.py +++ b/robotframework-onap/ONAPLibrary/BaseAAIKeywords.py @@ -36,34 +36,38 @@ class BaseAAIKeywords(object): self.aai_endpoint = aai_server_protocol + '://' + aai_ip_addr + ':' + aai_server_port @keyword - def run_get_request(self, endpoint, data_path, accept="application/json", auth=None): + def run_get_request(self, endpoint, data_path, accept="application/json", auth=None, client_certs=None): """Runs an AAI get request""" - return self.reqs.get_request("aai", endpoint, data_path, sdc_user=None, accept=accept, auth=auth) + return self.reqs.get_request(alias="aai", endpoint=endpoint, data_path=data_path, accept=accept, auth=auth, + client_certs=client_certs) @keyword - def run_post_request(self, endpoint, data_path, data, accept="application/json", auth=None): + def run_post_request(self, endpoint, data_path, data, accept="application/json", auth=None, client_certs=None): """Runs an AAI post request""" - return self.reqs.post_request("aai", endpoint, data_path, data, sdc_user=None, files=None, - accept=accept, auth=auth) + return self.reqs.post_request(alias="aai", endpoint=endpoint, data_path=data_path, data=data, accept=accept, + auth=auth, client_certs=client_certs) @keyword - def run_put_request(self, endpoint, data_path, data, accept="application/json", auth=None): + def run_put_request(self, endpoint, data_path, data, accept="application/json", auth=None, client_certs=None): """Runs an AAI post request""" - return self.reqs.put_request("aai", endpoint, data_path, data, sdc_user=None, accept=accept, auth=auth) + return self.reqs.put_request(alias="aai", endpoint=endpoint, data_path=data_path, data=data, accept=accept, + auth=auth, client_certs=client_certs) @keyword - def run_delete_request(self, endpoint, data_path, resource_version, accept="application/json", auth=None): + def run_delete_request(self, endpoint, data_path, resource_version, accept="application/json", auth=None, + client_certs=None): """Runs an AAI delete request""" - return self.reqs.delete_request("aai", endpoint, data_path + '?resource-version=' + resource_version, - data=None, sdc_user=None, accept=accept, auth=auth) + return self.reqs.delete_request(alias="aai", endpoint=endpoint, accept=accept, auth=auth, + client_certs=client_certs, + data_path=data_path + '?resource-version=' + resource_version) @keyword - def wait_for_node_to_exist(self, search_node_type, key, uuid, auth=None): + def wait_for_node_to_exist(self, search_node_type, key, uuid, auth=None, client_certs=None): logger.info('Waiting for AAI traversal to complete...') for i in range(30): logger.trace("running iteration " + str(i)) time.sleep(1) - result = self.find_node(search_node_type, key, uuid, auth=auth) + result = self.find_node(search_node_type, key, uuid, auth=auth, client_certs=client_certs) if result: return result @@ -73,9 +77,10 @@ class BaseAAIKeywords(object): self.builtin.fail(error_message) @keyword - def find_node(self, search_node_type, key, node_uuid, auth=None): + def find_node(self, search_node_type, key, node_uuid, auth=None, client_certs=None): data_path = '/aai/v11/search/nodes-query?search-node-type={0}&filter={1}:EQUALS:{2}'.format( search_node_type, key, node_uuid) - resp = self.reqs.get_request("aai", self.aai_endpoint, data_path, accept="application/json", auth=auth) + resp = self.reqs.get_request("aai", self.aai_endpoint, data_path, accept="application/json", auth=auth, + client_certs=client_certs) response = resp.json() return 'result-data' in response |