From 4781c27ef09e9cee38b934bdf85009c6123dc3b1 Mon Sep 17 00:00:00 2001 From: hajipour <shajipour@cttc.es> Date: Sun, 19 Jan 2025 21:24:23 +0100 Subject: [PATCH] l3vpn driver: - l3vpn post, delete, put requests uncommented - l3vpn put request url temporarily fixed for integration --- src/device/service/drivers/ietf_l3vpn/TfsApiClient.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/device/service/drivers/ietf_l3vpn/TfsApiClient.py b/src/device/service/drivers/ietf_l3vpn/TfsApiClient.py index b05278fa0..1ca965f87 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") -- GitLab