Skip to content
Snippets Groups Projects
Commit 4781c27e authored by Shayan Hajipour's avatar Shayan Hajipour
Browse files

l3vpn driver:

- l3vpn post, delete, put requests uncommented
- l3vpn put request url temporarily fixed for integration
parent 8c4cc1e7
No related branches found
No related tags found
1 merge request!283Resolve "(CTTC) Implement L3 VPN SBI driver compatible with IETF L3 Service Model"
...@@ -160,7 +160,7 @@ class TfsApiClient: ...@@ -160,7 +160,7 @@ class TfsApiClient:
def create_connectivity_service(self, l3vpn_data: dict) -> None: def create_connectivity_service(self, l3vpn_data: dict) -> None:
try: try:
# requests.post(self._l3vpn_url, json=l3vpn_data) requests.post(self._l3vpn_url, json=l3vpn_data)
LOGGER.debug( LOGGER.debug(
"[create_connectivity_service] l3vpn_data={:s}".format(str(l3vpn_data)) "[create_connectivity_service] l3vpn_data={:s}".format(str(l3vpn_data))
) )
...@@ -168,8 +168,10 @@ class TfsApiClient: ...@@ -168,8 +168,10 @@ class TfsApiClient:
raise Exception("faild to send post request to TFS L3VPN NBI") raise Exception("faild to send post request to TFS L3VPN NBI")
def update_connectivity_service(self, l3vpn_data: dict) -> None: 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: try:
# requests.post(self._l3vpn_url, json=l3vpn_data) requests.put(url, json=l3vpn_data)
LOGGER.debug( LOGGER.debug(
"[update_connectivity_service] l3vpn_data={:s}".format(str(l3vpn_data)) "[update_connectivity_service] l3vpn_data={:s}".format(str(l3vpn_data))
) )
...@@ -179,7 +181,7 @@ class TfsApiClient: ...@@ -179,7 +181,7 @@ class TfsApiClient:
def delete_connectivity_service(self, service_uuid: str) -> None: def delete_connectivity_service(self, service_uuid: str) -> None:
url = self._l3vpn_url + f"/vpn-service={service_uuid}" url = self._l3vpn_url + f"/vpn-service={service_uuid}"
try: try:
# requests.delete(url, auth=self._auth) requests.delete(url, auth=self._auth)
LOGGER.debug("[delete_connectivity_service] url={:s}".format(str(url))) LOGGER.debug("[delete_connectivity_service] url={:s}".format(str(url)))
except requests.exceptions.ConnectionError: except requests.exceptions.ConnectionError:
raise Exception("faild to send delete request to TFS L3VPN NBI") raise Exception("faild to send delete request to TFS L3VPN NBI")
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment