08-10-2017 02:13 AM
I'm looking for the correct syntax to add a new managed device (serial number) into panorama, using API.
I tried lots of stuffs, but without success.
Does anybody can help me? or is it simply not supported?
Thx in advance,
08-10-2017 06:53 AM
I use this API call:
curl -k -v "https://<panorama_ip>/api/?type=config&action=set&key=<my_key>&xpath=/config/mgt-config/devices&element=<entry name='111111111111111'/>"
08-10-2017 07:08 AM
Interesting. I was testing previously using the browser, which worked fine. Curl does not work for this command for me, however. It returns a 404 error. I also tried the python requests library, which does work as well.
Are you also seeing a 404 returned?
08-10-2017 07:58 AM
Yes: I got HTTP/1.1 404 Not Found
Sounds like cURL is not sending it correctly 😕
maybe because of the space between entry and name ??? wrong encoding?
08-10-2017 09:39 AM
Good catch. Replacing that space with a %20 caused the command to succeed.
08-10-2017 11:42 PM
response status=\"success\" !!
yes !! %20 did it. Thanks a lot for your help !! I can continue to script crazy stuffs 🙂
Click Accept as Solution to acknowledge that the answer to your question has been provided.
The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!
These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!
The LIVEcommunity thanks you for your participation!