X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2FNBI.git;a=blobdiff_plain;f=osm_nbi%2Fhtml_out.py;h=bfa13d49dae939c8c4e5f3697ed20ffe61b70d41;hp=1d733bca8f121fcebb0525a184d66e144b7397d5;hb=fc5089ce2dee313929810482f9a4b01747f1df44;hpb=65acb4d5d56a90c9c4ff101b931f5fa6d65dcb51 diff --git a/osm_nbi/html_out.py b/osm_nbi/html_out.py index 1d733bc..bfa13d4 100644 --- a/osm_nbi/html_out.py +++ b/osm_nbi/html_out.py @@ -17,15 +17,17 @@ html_start = """
- + ( {} ) - VNFDs - NSDs - NSs + VNFDs + NSDs + NSs USERs PROJECTs TOKENs - VIMs + VIMs + SDNs logout
@@ -37,13 +39,12 @@ html_body = """ html_end = """ - + """ html_body_error = "

Error
{}

" - html_auth2 = """ @@ -91,6 +92,7 @@ html_upload_body = """ html_nslcmop_body = """ nslcm operations +VNFRS

@@ -118,10 +120,10 @@ def format(data, request, response, session): if response.status and response.status > 202: body += html_body_error.format(yaml.safe_dump(data, explicit_start=True, indent=4, default_flow_style=False)) elif isinstance(data, (list, tuple)): - if request.path_info == "/vnfpkgm/v1/vnf_packages_content": + if request.path_info == "/vnfpkgm/v1/vnf_packages": body += html_upload_body.format(request.path_info, "VNFD") - elif request.path_info == "/nsd/v1/ns_descriptors_content": - body += html_upload_body.format(request.path_info, "NSD") + elif request.path_info == "/nsd/v1/ns_descriptors": + body += html_upload_body.format(request.path_info + "_content", "NSD") for k in data: if isinstance(k, dict): data_id = k.pop("_id", None) @@ -132,7 +134,8 @@ def format(data, request, response, session): if "Location" in response.headers: body += ' show '.format(response.headers["Location"]) else: - body += ' '.format(request.path_info) + body += ' '\ + .format(request.path_info) if request.path_info.startswith("/nslcm/v1/ns_instances_content/") or \ request.path_info.startswith("/nslcm/v1/ns_instances/"): _id = request.path_info[request.path_info.rfind("/")+1:] @@ -150,8 +153,6 @@ def format(data, request, response, session): if session.get("project_id"): user_text += ", project: {}".format(session.get("project_id")) return html_start.format(user_text) + body + html_end - #yaml.safe_dump(data, explicit_start=True, indent=4, default_flow_style=False) + # yaml.safe_dump(data, explicit_start=True, indent=4, default_flow_style=False) # tags=False, # encoding='utf-8', allow_unicode=True) - -