X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2FNBI.git;a=blobdiff_plain;f=osm_nbi%2Fadmin_topics.py;h=3c3249c62000c2bb14181c87080dbaf2c7d2d598;hp=7e714597290b32f65c843bc34c476e4c539096aa;hb=d010e3e44d9b06012dc741aca98054e3a87c5f22;hpb=c4e07d03f2519e61e8ab58ad71bbbd4d72524d95;ds=sidebyside diff --git a/osm_nbi/admin_topics.py b/osm_nbi/admin_topics.py index 7e71459..3c3249c 100644 --- a/osm_nbi/admin_topics.py +++ b/osm_nbi/admin_topics.py @@ -679,12 +679,13 @@ class UserTopicAuth(UserTopic): 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 + :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 @@ -817,6 +818,7 @@ class UserTopicAuth(UserTopic): 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) @@ -963,12 +965,13 @@ class ProjectTopicAuth(ProjectTopic): 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 + :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 @@ -1231,12 +1234,13 @@ class RoleTopicAuth(BaseTopic): 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 + :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}