feature: sol004 and sol007
[osm/NBI.git] / osm_nbi / admin_topics.py
index 786d237..c2767c8 100644 (file)
@@ -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"])