X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2FNBI.git;a=blobdiff_plain;f=osm_nbi%2Fnbi.py;h=3cc12b9a03b4ea3e2ed07cf5df7ebf5ae6791cef;hp=c2cb1aff6cff174f047a4374b7da2c26664745fd;hb=ad17766b32a303ba7b1c1f6ca9b6d363ae9d36ed;hpb=2236d203182b39ae5d20d21a475c95f6a5d5fbc5 diff --git a/osm_nbi/nbi.py b/osm_nbi/nbi.py index c2cb1af..3cc12b9 100644 --- a/osm_nbi/nbi.py +++ b/osm_nbi/nbi.py @@ -59,7 +59,7 @@ URL: /osm GET POST /ns_instances_content O O / O O /ns_instances 5 5 - / 5 5 + / O5 O5 instantiate O5 terminate O5 action O @@ -68,8 +68,8 @@ URL: /osm GET POST /ns_lcm_op_occs 5 5 / 5 5 5 TO BE COMPLETED 5 5 - /vnfrs O - / O + /vnf_instances (also vnfrs for compatibility) O + / O /subscriptions 5 5 / 5 X /admin/v1 @@ -158,13 +158,13 @@ class Server(object): "": {"METHODS": ("GET", "DELETE")} }, "vims": {"METHODS": ("GET", "POST"), - "": {"METHODS": ("GET", "DELETE")} + "": {"METHODS": ("GET", "DELETE", "PATCH", "PUT")} }, "vim_accounts": {"METHODS": ("GET", "POST"), - "": {"METHODS": ("GET", "DELETE", "PATCH")} + "": {"METHODS": ("GET", "DELETE", "PATCH", "PUT")} }, "sdns": {"METHODS": ("GET", "POST"), - "": {"METHODS": ("GET", "DELETE", "PATCH")} + "": {"METHODS": ("GET", "DELETE", "PATCH", "PUT")} }, } }, @@ -196,7 +196,7 @@ class Server(object): "": {"METHODS": ("GET", "PUT", "DELETE")} }, "vnf_packages": {"METHODS": ("GET", "POST"), - "": {"METHODS": ("GET", "DELETE"), "TODO": "PATCH", # GET: vnfPkgInfo + "": {"METHODS": ("GET", "DELETE", "PATCH"), # GET: vnfPkgInfo "package_content": {"METHODS": ("GET", "PUT"), # package "upload_from_uri": {"TODO": "POST"} }, @@ -215,8 +215,8 @@ class Server(object): "": {"METHODS": ("GET", "DELETE")} }, "ns_instances": {"METHODS": ("GET", "POST"), - "": {"TODO": ("GET", "DELETE"), - "scale": {"TODO": "POST"}, + "": {"METHODS": ("GET", "DELETE"), + "scale": {"METHODS": "POST"}, "terminate": {"METHODS": "POST"}, "instantiate": {"METHODS": "POST"}, "action": {"METHODS": "POST"}, @@ -228,6 +228,9 @@ class Server(object): "vnfrs": {"METHODS": ("GET"), "": {"METHODS": ("GET")} }, + "vnf_instances": {"METHODS": ("GET"), + "": {"METHODS": ("GET")} + }, } }, } @@ -257,7 +260,7 @@ class Server(object): try: user_passwd = standard_b64decode(user_passwd64).decode() user, _, passwd = user_passwd.partition(":") - except: + except Exception: pass outdata = self.engine.new_token(None, {"username": user, "password": passwd}) token = outdata["id"] @@ -323,15 +326,15 @@ class Server(object): elif format_yaml: try: kwargs[k] = yaml.load(v) - except: + except Exception: pass elif k.endswith(".gt") or k.endswith(".lt") or k.endswith(".gte") or k.endswith(".lte"): try: kwargs[k] = int(v) - except: + except Exception: try: kwargs[k] = float(v) - except: + except Exception: pass elif v.find(",") > 0: kwargs[k] = v.split(",") @@ -342,7 +345,7 @@ class Server(object): elif format_yaml: try: v[index] = yaml.load(v[index]) - except: + except Exception: pass return indata @@ -449,7 +452,7 @@ class Server(object): elif method == "POST": try: session = self._authorization() - except: + except Exception: session = None if kwargs: indata.update(kwargs) @@ -488,7 +491,7 @@ class Server(object): thread_info = None if args and args[0] == "help": return "
\ninit\nfile/  download file\ndb-clear/table\nprune\nlogin\nlogin2\n"\
-                    "sleep/
" + "sleep/