cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
172
Views
0
Helpful
1
Replies

SDWAN API Template management Issue

Ammartehsein
Level 1
Level 1

====Github link for this application I clone to local enviorment=============

https://github.com/CiscoDevNet/Getting-started-with-Cisco-SD-WAN-REST-APIs/blob/master/README.md

Hi, I configured SDWAN API. I clone the application from github.
The application is working as I I can see the device_lists and device_templates but when I attach or detach template through it, it show error. Please check below error. thanks

(venv) root@ubuntu:~/Getting-started-with-Cisco-SD-WAN-REST-APIs# ./sdwan.py detach --target a9dbe91f-cd18-fe29-53f6-6e65d7fd5718 --sysip 74.74.74.74 Attempting to detach template. {"deviceType": "vedge", "devices": [{"deviceId": "a9dbe91f-cd18-fe29-53f6-6e65d7fd5718", "deviceIP": "74.74.74.74"}]} Traceback (most recent call last): File "./sdwan.py", line 255, in cli() File "/root/Getting-started-with-Cisco-SD-WAN-REST-APIs/venv/lib/python3.6/site-packages/click/core.py", line 722, in __call__ return self.main(*args, **kwargs) File "/root/Getting-started-with-Cisco-SD-WAN-REST-APIs/venv/lib/python3.6/site-packages/click/core.py", line 697, in main rv = self.invoke(ctx) File "/root/Getting-started-with-Cisco-SD-WAN-REST-APIs/venv/lib/python3.6/site-packages/click/core.py", line 1066, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/root/Getting-started-with-Cisco-SD-WAN-REST-APIs/venv/lib/python3.6/site-packages/click/core.py", line 895, in invoke return ctx.invoke(self.callback, **ctx.params) File "/root/Getting-started-with-Cisco-SD-WAN-REST-APIs/venv/lib/python3.6/site-packages/click/core.py", line 535, in invoke return callback(*args, **kwargs) File "./sdwan.py", line 245, in detach response = sdwanp.post_request('template/config/device/mode/cli', payload) File "./sdwan.py", line 80, in post_request data = response.json() File "/root/Getting-started-with-Cisco-SD-WAN-REST-APIs/venv/lib/python3.6/site-packages/requests/models.py", line 897, in json return complexjson.loads(self.text, **kwargs) File "/usr/lib/python3.6/json/__init__.py", line 354, in loads return _default_decoder.decode(s) File "/usr/lib/python3.6/json/decoder.py", line 339, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/usr/lib/python3.6/json/decoder.py", line 357, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

1 Reply 1

This error your see typically occurs when the API response isn't valid JSON or is empty. 

Double-check that the device ID (a9dbe91f-cd18-fe29-53f6-6e65d7fd5718) and system IP (74.74.74.74) are correct in your API call.

You can raise an issue on the code to get support for this in GitHub. 

HTH

Please mark this as helpful or solution accepted to help others
Connect with me https://bigevilbeard.github.io

Review Cisco Networking for a $25 gift card