X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=osm_mon%2Fcore%2Fcommon_db.py;h=aa6538831d251fa806f69123911e4296147f9a7b;hb=517bd7ef3b32561a6a3dd25ca383bcd40da263e6;hp=e43c6cdc8b79b715e087bc519a378d096187dc41;hpb=85a9185db3248f1e3f20c8edad95ab77b8ee989c;p=osm%2FMON.git diff --git a/osm_mon/core/common_db.py b/osm_mon/core/common_db.py index e43c6cd..aa65388 100644 --- a/osm_mon/core/common_db.py +++ b/osm_mon/core/common_db.py @@ -62,9 +62,9 @@ class CommonDbClient: {"_id": vnfd_id}) return vnfd - def get_vnfd_by_id(self, vnfd_id: str): - vnfd = self.common_db.get_one("vnfds", - {"id": vnfd_id}) + def get_vnfd_by_id(self, vnfd_id: str, filter: dict = {}): + filter["id"] = vnfd_id + vnfd = self.common_db.get_one("vnfds", filter) return vnfd def get_vnfd_by_name(self, vnfd_name: str): @@ -162,3 +162,6 @@ class CommonDbClient: def get_role_by_name(self, name: str): return self.common_db.get_one('roles', {'name': name}) + + def get_role_by_id(self, role_id: str): + return self.common_db.get_one('roles', {'_id': role_id})