X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2FNBI.git;a=blobdiff_plain;f=osm_nbi%2Fadmin_topics.py;h=c2767c815ec5ba294108eb100325a595a859f40d;hp=0006917cd513abe0d69ab1e18549feb493f614e2;hb=c2ee2fcf4a379f2825ca4049e1c766d33852450d;hpb=4568a372eb5a204e04d917213de03ec51f9110c1 diff --git a/osm_nbi/admin_topics.py b/osm_nbi/admin_topics.py index 0006917..c2767c8 100644 --- a/osm_nbi/admin_topics.py +++ b/osm_nbi/admin_topics.py @@ -395,6 +395,52 @@ class CommonVimWimSdn(BaseTopic): # create operation content["_admin"]["operations"] = [self._create_operation("create")] content["_admin"]["current_operation"] = None + # create Resource in Openstack based VIM + if content.get("vim_type"): + if content["vim_type"] == "openstack": + compute = { + "ram": { + "total": None, + "used": None + }, + "vcpus": { + "total": None, + "used": None + }, + "instances": { + "total": None, + "used": None + } + } + storage = { + "volumes": { + "total": None, + "used": None + }, + "snapshots": { + "total": None, + "used": None + }, + "storage": { + "total": None, + "used": None + } + } + network = { + "networks": { + "total": None, + "used": None + }, + "subnets": { + "total": None, + "used": None + }, + "floating_ips": { + "total": None, + "used": None + } + } + content["resources"] = {"compute": compute, "storage": storage, "network": network} return "{}:0".format(content["_id"]) @@ -922,12 +968,13 @@ class UserTopicAuth(UserTopic): except ValidationError as e: raise EngineException(e, HTTPStatus.UNPROCESSABLE_ENTITY) - def show(self, session, _id, api_req=False): + def show(self, session, _id, filter_q=None, 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 filter_q: dict: query parameter :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. """ @@ -1295,12 +1342,13 @@ class ProjectTopicAuth(ProjectTopic): except ValidationError as e: raise EngineException(e, HTTPStatus.UNPROCESSABLE_ENTITY) - def show(self, session, _id, api_req=False): + def show(self, session, _id, filter_q=None, 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 filter_q: dict: query parameter :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. """ @@ -1594,12 +1642,13 @@ class RoleTopicAuth(BaseTopic): final_content["permissions"]["admin"] = False return None - def show(self, session, _id, api_req=False): + def show(self, session, _id, filter_q=None, 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 filter_q: dict: query parameter :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. """