01-11-2025 04:08 AM
====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)
01-11-2025 04:39 AM
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
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide