04-Jun-2021 06:19
We are trying to execute the following from the i-control API using curl and are having issues figuring out the JSON body specifically.
• Command we wish to run via API/curl --> run util bash -c "tmsh -c \"run cli script classMod chbe_app_a03_base.class Display\””
We want to format that into the json body using curl and/or postman using the –d flag. Something like below, but this is failing along with several other attempts we have made. This will be executed as a bash command as that is how ansible is doing it, so we want to emulate that.
• -d "{\"command\":\"run\", \"utilCmdArgs\":\"-c 'run cli script classMod chbe_app_a03_base.class Display\\\" | tmsh'\"}"
If someone has and could share a working example of doing this it would be much appreciated.