From d1eaf98e0c5ccf46aab538dcd5659ecb23b85559 Mon Sep 17 00:00:00 2001 From: "vijay.r" Date: Fri, 14 May 2021 11:54:59 +0000 Subject: [PATCH] Feature5950: Management of quotas in VIM Account Adding code support for Openstack quota resources in vim_accounts Change-Id: I80b557824729fd6aedcc11dbc70d1f284497a0ea Signed-off-by: vijay.r --- osm_nbi/admin_topics.py | 47 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/osm_nbi/admin_topics.py b/osm_nbi/admin_topics.py index 786d237..51a6963 100644 --- a/osm_nbi/admin_topics.py +++ b/osm_nbi/admin_topics.py @@ -395,6 +395,53 @@ 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"]) -- 2.25.1