Loading src/device/service/drivers/ietf_l3vpn/TfsApiClient.py +5 −3 Original line number Diff line number Diff line Loading @@ -160,7 +160,7 @@ class TfsApiClient: def create_connectivity_service(self, l3vpn_data: dict) -> None: try: # requests.post(self._l3vpn_url, json=l3vpn_data) requests.post(self._l3vpn_url, json=l3vpn_data) LOGGER.debug( "[create_connectivity_service] l3vpn_data={:s}".format(str(l3vpn_data)) ) Loading @@ -168,8 +168,10 @@ class TfsApiClient: raise Exception("faild to send post request to TFS L3VPN NBI") def update_connectivity_service(self, l3vpn_data: dict) -> None: vpn_id = l3vpn_data['ietf-l3vpn-svc:l3vpn-svc']["vpn-services"]["vpn-service"][0]["vpn-id"] url = self._l3vpn_url + f"/vpn-service={vpn_id}" try: # requests.post(self._l3vpn_url, json=l3vpn_data) requests.put(url, json=l3vpn_data) LOGGER.debug( "[update_connectivity_service] l3vpn_data={:s}".format(str(l3vpn_data)) ) Loading @@ -179,7 +181,7 @@ class TfsApiClient: def delete_connectivity_service(self, service_uuid: str) -> None: url = self._l3vpn_url + f"/vpn-service={service_uuid}" try: # requests.delete(url, auth=self._auth) requests.delete(url, auth=self._auth) LOGGER.debug("[delete_connectivity_service] url={:s}".format(str(url))) except requests.exceptions.ConnectionError: raise Exception("faild to send delete request to TFS L3VPN NBI") Loading
src/device/service/drivers/ietf_l3vpn/TfsApiClient.py +5 −3 Original line number Diff line number Diff line Loading @@ -160,7 +160,7 @@ class TfsApiClient: def create_connectivity_service(self, l3vpn_data: dict) -> None: try: # requests.post(self._l3vpn_url, json=l3vpn_data) requests.post(self._l3vpn_url, json=l3vpn_data) LOGGER.debug( "[create_connectivity_service] l3vpn_data={:s}".format(str(l3vpn_data)) ) Loading @@ -168,8 +168,10 @@ class TfsApiClient: raise Exception("faild to send post request to TFS L3VPN NBI") def update_connectivity_service(self, l3vpn_data: dict) -> None: vpn_id = l3vpn_data['ietf-l3vpn-svc:l3vpn-svc']["vpn-services"]["vpn-service"][0]["vpn-id"] url = self._l3vpn_url + f"/vpn-service={vpn_id}" try: # requests.post(self._l3vpn_url, json=l3vpn_data) requests.put(url, json=l3vpn_data) LOGGER.debug( "[update_connectivity_service] l3vpn_data={:s}".format(str(l3vpn_data)) ) Loading @@ -179,7 +181,7 @@ class TfsApiClient: def delete_connectivity_service(self, service_uuid: str) -> None: url = self._l3vpn_url + f"/vpn-service={service_uuid}" try: # requests.delete(url, auth=self._auth) requests.delete(url, auth=self._auth) LOGGER.debug("[delete_connectivity_service] url={:s}".format(str(url))) except requests.exceptions.ConnectionError: raise Exception("faild to send delete request to TFS L3VPN NBI")