Added api_req arguments to add show methods to make
them compatible with engine.py call signature.
Change-Id: I161515e0cc71596fde28e138561f7bb399e206fc
Signed-off-by: K Sai Kiran <saikiran.k@tataelxsi.co.in>
except ValidationError as e:
raise EngineException(e, HTTPStatus.UNPROCESSABLE_ENTITY)
except ValidationError as e:
raise EngineException(e, HTTPStatus.UNPROCESSABLE_ENTITY)
- def show(self, session, _id):
+ def show(self, session, _id, api_req=False):
"""
Get complete information on an topic
:param session: contains "username", "admin", "force", "public", "project_id", "set_project"
:param _id: server internal id or username
"""
Get complete information on an topic
:param session: contains "username", "admin", "force", "public", "project_id", "set_project"
:param _id: server internal id or username
+ :param api_req: True if this call is serving an external API request. False if serving internal request.
:return: dictionary, raise exception if not found.
"""
# Allow _id to be a name or uuid
:return: dictionary, raise exception if not found.
"""
# Allow _id to be a name or uuid
Get a list of the topic that matches a filter
:param session: contains "username", "admin", "force", "public", "project_id", "set_project"
:param filter_q: filter of data to be applied
Get a list of the topic that matches a filter
:param session: contains "username", "admin", "force", "public", "project_id", "set_project"
:param filter_q: filter of data to be applied
+ :param api_req: True if this call is serving an external API request. False if serving internal request.
:return: The list, it can be empty if no one match the filter.
"""
user_list = self.auth.get_user_list(filter_q)
:return: The list, it can be empty if no one match the filter.
"""
user_list = self.auth.get_user_list(filter_q)
except ValidationError as e:
raise EngineException(e, HTTPStatus.UNPROCESSABLE_ENTITY)
except ValidationError as e:
raise EngineException(e, HTTPStatus.UNPROCESSABLE_ENTITY)
- def show(self, session, _id):
+ def show(self, session, _id, api_req=False):
"""
Get complete information on an topic
:param session: contains "username", "admin", "force", "public", "project_id", "set_project"
:param _id: server internal id
"""
Get complete information on an topic
:param session: contains "username", "admin", "force", "public", "project_id", "set_project"
:param _id: server internal id
+ :param api_req: True if this call is serving an external API request. False if serving internal request.
:return: dictionary, raise exception if not found.
"""
# Allow _id to be a name or uuid
:return: dictionary, raise exception if not found.
"""
# Allow _id to be a name or uuid
final_content["permissions"]["admin"] = False
return None
final_content["permissions"]["admin"] = False
return None
- def show(self, session, _id):
+ def show(self, session, _id, api_req=False):
"""
Get complete information on an topic
:param session: contains "username", "admin", "force", "public", "project_id", "set_project"
:param _id: server internal id
"""
Get complete information on an topic
:param session: contains "username", "admin", "force", "public", "project_id", "set_project"
:param _id: server internal id
+ :param api_req: True if this call is serving an external API request. False if serving internal request.
:return: dictionary, raise exception if not found.
"""
filter_q = {BaseTopic.id_field(self.topic, _id): _id}
:return: dictionary, raise exception if not found.
"""
filter_q = {BaseTopic.id_field(self.topic, _id): _id}
except aiohttp.client_exceptions.ClientConnectorError as e:
raise EngineException("Connection to '{}'Failure: {}".format(self.url, e))
except aiohttp.client_exceptions.ClientConnectorError as e:
raise EngineException("Connection to '{}'Failure: {}".format(self.url, e))
- def show(self, session, ns_id):
+ def show(self, session, ns_id, api_req=False):
metrics_list = self._get_vnf_metric_list(ns_id)
loop = asyncio.new_event_loop()
asyncio.set_event_loop(loop)
metrics_list = self._get_vnf_metric_list(ns_id)
loop = asyncio.new_event_loop()
asyncio.set_event_loop(loop)