diff --git a/src/device/service/drivers/ietf_l3vpn/TfsApiClient.py b/src/device/service/drivers/ietf_l3vpn/TfsApiClient.py index b05278fa0c437a76b2abbed194d2069bd5f78c17..1ca965f8777aa23287ad379c8ac2cd0d92d9c28f 100644 --- a/src/device/service/drivers/ietf_l3vpn/TfsApiClient.py +++ b/src/device/service/drivers/ietf_l3vpn/TfsApiClient.py @@ -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)) ) @@ -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)) ) @@ -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")