cancel
Showing results for 
Search instead for 
Did you mean: 
Login & Join the DevCentral Connects Group to watch the Recorded LiveStream (May 12) on Basic iControl Security - show notes included.

Formatting iControl API command into JSON body using curl

mpeck
Nimbostratus
Nimbostratus

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.

0 REPLIES 0