Loading src/service/service/tools/OpticalTools.py +4 −4 Original line number Diff line number Diff line Loading @@ -109,11 +109,11 @@ def add_lightpath(src, dst, bitrate, bidir, ob_band) -> str: if ob_band is None: if bidir is None: bidir = 1 urlx = "{:s}/AddFlexLightpath/{:s}/{:s}/{:s}/{:s}".format(base_url, src, dst, bitrate, bidir) urlx = "{:s}/AddFlexLightpath/{:s}/{:s}/{:s}/{:s}".format(base_url, src, dst, str(bitrate), str(bidir)) else: if bidir is None: bidir = 1 urlx = "{:s}/AddFlexLightpath/{:s}/{:s}/{:s}/{:s}/{:s}".format(base_url, src, dst, bitrate, bidir, ob_band) urlx = "{:s}/AddFlexLightpath/{:s}/{:s}/{:s}/{:s}/{:s}".format(base_url, src, dst, str(bitrate), str(bidir), str(ob_band)) r = requests.put(urlx, headers=headers) reply = r.text return reply Loading @@ -127,7 +127,7 @@ def add_lightpath(src, dst, bitrate, bidir, ob_band) -> str: def get_optical_band(idx) -> str: if not TESTING: base_url = get_optical_controller_base_url() urlx = "{:s}/GetOpticalBand/{:s}".format(base_url, idx) urlx = "{:s}/GetOpticalBand/{:s}".format(base_url, str(idx)) headers = {"Content-Type": "application/json"} r = requests.get(urlx, headers=headers) reply = r.text Loading @@ -143,7 +143,7 @@ def delete_lightpath(flow_id, src, dst, bitrate) -> str: reply = "200" if not TESTING: base_url = get_optical_controller_base_url() urlx = "{:s}/DelLightpath/{:s}/{:s}/{:s}/{:s}".format(base_url, flow_id, src, dst, bitrate) urlx = "{:s}/DelLightpath/{:s}/{:s}/{:s}/{:s}".format(base_url, str(flow_id), src, dst, str(bitrate)) headers = {"Content-Type": "application/json"} r = requests.delete(urlx, headers=headers) Loading Loading
src/service/service/tools/OpticalTools.py +4 −4 Original line number Diff line number Diff line Loading @@ -109,11 +109,11 @@ def add_lightpath(src, dst, bitrate, bidir, ob_band) -> str: if ob_band is None: if bidir is None: bidir = 1 urlx = "{:s}/AddFlexLightpath/{:s}/{:s}/{:s}/{:s}".format(base_url, src, dst, bitrate, bidir) urlx = "{:s}/AddFlexLightpath/{:s}/{:s}/{:s}/{:s}".format(base_url, src, dst, str(bitrate), str(bidir)) else: if bidir is None: bidir = 1 urlx = "{:s}/AddFlexLightpath/{:s}/{:s}/{:s}/{:s}/{:s}".format(base_url, src, dst, bitrate, bidir, ob_band) urlx = "{:s}/AddFlexLightpath/{:s}/{:s}/{:s}/{:s}/{:s}".format(base_url, src, dst, str(bitrate), str(bidir), str(ob_band)) r = requests.put(urlx, headers=headers) reply = r.text return reply Loading @@ -127,7 +127,7 @@ def add_lightpath(src, dst, bitrate, bidir, ob_band) -> str: def get_optical_band(idx) -> str: if not TESTING: base_url = get_optical_controller_base_url() urlx = "{:s}/GetOpticalBand/{:s}".format(base_url, idx) urlx = "{:s}/GetOpticalBand/{:s}".format(base_url, str(idx)) headers = {"Content-Type": "application/json"} r = requests.get(urlx, headers=headers) reply = r.text Loading @@ -143,7 +143,7 @@ def delete_lightpath(flow_id, src, dst, bitrate) -> str: reply = "200" if not TESTING: base_url = get_optical_controller_base_url() urlx = "{:s}/DelLightpath/{:s}/{:s}/{:s}/{:s}".format(base_url, flow_id, src, dst, bitrate) urlx = "{:s}/DelLightpath/{:s}/{:s}/{:s}/{:s}".format(base_url, str(flow_id), src, dst, str(bitrate)) headers = {"Content-Type": "application/json"} r = requests.delete(urlx, headers=headers) Loading