From: peusterm Date: Wed, 19 Dec 2018 12:58:12 +0000 (+0100) Subject: 5GTANGO LLCM: Allow service instanceiation by service_name. X-Git-Tag: v6.0.0~45 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=61ba12980c1a7959dfb83943513c8af9d70d0b26;p=osm%2Fvim-emu.git 5GTANGO LLCM: Allow service instanceiation by service_name. Change-Id: I924a1aa3a0e8f852e19a44471630348de176ea5a Signed-off-by: peusterm --- diff --git a/src/emuvim/api/tango/llcm.py b/src/emuvim/api/tango/llcm.py index d7c24dd..bc94eb0 100755 --- a/src/emuvim/api/tango/llcm.py +++ b/src/emuvim/api/tango/llcm.py @@ -883,7 +883,15 @@ class Instantiations(fr.Resource): # try to extract the service uuid from the request json_data = request.get_json(force=True) service_uuid = json_data.get("service_uuid") - + service_name = json_data.get("service_name") + + # first try to find by service_name + if service_name is not None: + for s_uuid, s in GK.services.iteritems(): + if s.manifest.get("name") == service_name: + LOG.info("Found service: {} with UUID: {}" + .format(service_name, s_uuid)) + service_uuid = s_uuid # lets be a bit fuzzy here to make testing easier if (service_uuid is None or service_uuid == "latest") and len(GK.services) > 0: