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

nce requests uncommented

parent 5a15c97e
No related branches found
No related tags found
1 merge request!304Resolve "(CTTC) Driver required to interact with NCE controller"
......@@ -70,13 +70,13 @@ class NCEClient:
app_data = app_flow_data["huawei-nce-app-flow:app-flows"]["applications"]
app_url = self._nce_fan_url + "/app-flows/apps"
LOGGER.info(f'Creating app: {app_data} URL: {app_url}')
# requests.post(app_url, json=app_data, headers=HEADERS)
requests.post(app_url, json=app_data, headers=HEADERS)
app_flow_data = {
"app-flow": app_flow_data["huawei-nce-app-flow:app-flows"]["app-flow"]
}
app_flow_url = self._nce_fan_url + "/app-flows"
LOGGER.info(f'Creating app flow: {app_flow_data} URL: {app_flow_url}')
# requests.post(app_flow_url, json=app_flow_data, headers=HEADERS)
requests.post(app_flow_url, json=app_flow_data, headers=HEADERS)
except requests.exceptions.ConnectionError:
raise Exception("faild to send post requests to NCE FAN")
......@@ -84,9 +84,9 @@ class NCEClient:
try:
app_url = self._nce_fan_url + f"/app-flows/apps/application={app_flow_name}"
LOGGER.info(f'Deleting app: {app_flow_name} URL: {app_url}')
# requests.delete(app_url)
requests.delete(app_url)
app_flow_url = self._nce_fan_url + f"/app-flows/app-flow={app_flow_name}"
LOGGER.info(f'Deleting app flow: {app_flow_name} URL: {app_flow_url}')
# requests.delete(app_flow_url)
requests.delete(app_flow_url)
except requests.exceptions.ConnectionError:
raise Exception("faild to send delete request to NCE FAN")
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