Wednesday, May 29, 2013

How to find out CURL command for any CQ operation?

  1. Use FireFox, open the FireBug
  2. Click on “Net” tab in FireBug, click “Enable”
  3. Perform CQ operation. For ex: Felix->JMX->com.adobe.granite.ldap->syncUser->enter user string. Ex: CN=Manoj Miryala,OU=ParkRidge,OU=User and Group Accounts,DC=us,DC=ad,DC=hertz,DC=com
  4. Click “invoke”
  5. In FireBug, you will see the whole request URL when you point the mouse on top of “POST java.lang.String” shown below. Copy that along with parameters from “Post” tab under it.
  6. clip_image002
  7. Post tab shows you the parameters that you need to pass to the CURL command.
  8. clip_image004
  9. Example curl command for JMX’s Syncuser operation is as follows

curl -d "user=CN=Manoj Miryala,OU=ParkRidge,OU=User and Group Accounts,DC=us,DC=ad,DC=hertz,DC=com" --user admin:admin http://hertz614:5402/system/console/jmx/com.adobe.granite.ldap%3Ahost%3DHertz00.US.AD.HERTZ.COM%2Cport%3D389%2Ctype%3DTools/op/syncUser/java.lang.String --trace-ascii debugdump.txt

Conclusion: The same procedure can be done to find out the exact URL for the request with parameters and then use CURL to perform the same operation. This is very useful to automate CQ operations.

1 comment:

  1. Hello,

    Do you have any clue for using in curl request the hash password instead of the clear text password? How will formatted if possible ? something like curl -u admin:12121212wrqtwrqtw1212rqtw12qrwtrqwtrqetu22121r} ?
    Thanks by advance