Bug 1875 - Scale of KDUs fails when the KDU is instantiated with additional params
[osm/LCM.git] / osm_lcm / data_utils / vnfd.py
index 5351c41..714487c 100644 (file)
@@ -101,6 +101,13 @@ def get_vdu_profile(vnfd, vdu_profile_id):
     )
 
 
+def get_kdu_resource_profile(vnfd, kdu_profile_id):
+    return list_utils.find_in_list(
+        vnfd.get("df", ())[0]["kdu-resource-profile"],
+        lambda kdu_profile: kdu_profile["id"] == kdu_profile_id,
+    )
+
+
 def get_configuration(vnfd, entity_id):
     lcm_ops_config = vnfd.get("df")[0].get("lcm-operations-configuration")
     if not lcm_ops_config:
@@ -114,6 +121,10 @@ def get_configuration(vnfd, entity_id):
     )
 
 
+def get_relation_list(vnfd, entity_id):
+    return (get_configuration(vnfd, entity_id) or {}).get("relation", [])
+
+
 def get_virtual_link_profiles(vnfd):
     return vnfd.get("df")[0].get("virtual-link-profile", ())