From 61ba12980c1a7959dfb83943513c8af9d70d0b26 Mon Sep 17 00:00:00 2001 From: peusterm Date: Wed, 19 Dec 2018 13:58:12 +0100 Subject: [PATCH] 5GTANGO LLCM: Allow service instanceiation by service_name. Change-Id: I924a1aa3a0e8f852e19a44471630348de176ea5a Signed-off-by: peusterm --- src/emuvim/api/tango/llcm.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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: -- 2.25.1