Wednesday, May 29, 2013

Some of the COMMON CURL commands to work with AEM

  • Build a AEM/CRX package: curl -u admin:admin -X POST http://localhost:5502/crx/packmgr/service/.json/etc/packages/my_packages/release-1.0.zip?cmd=build
  • Download a package: curl -C - -O -u admin:admin http://localhost:5502/etc/packages/my_packages/release-1.0.zip
  • Delete all packages after a certain date: See [this]
  • How to change all AEM passwords: See [this]
  • How to run online backup / Datastore GC / Tar Optimization using curl in AEM 5.5: See [this]
  • How to use CURL command to find pending and blocking job in the replication Queue in AEM 5.4 / WEM: See [this]
  • How to flush Cache using Curl Command: See [this]
  • How to create encoded password that you can use for curl in CQ/WEM: see [this]
  • How to do user management using POST API / CURL in AEM 5.5: see [this]
  • How to change Admin password in AEM5.5: see [this]
  • How to reduce downtime for consistency check and fix AEM5.4 / WEM: See [this]
  • How to transfer file from one CRX to other modified after certain date using CURL in AEM / WEM / CRX: see [this]

Since Apache Sling makes sure that all “activated” (published) CQ DAM assets have URIs, you can programmatically download DAM content with a command line HTTP utility such as cURL.  cURL also lets you include these commands in a Windows batch or PowerShell script.

c:\Programs\cURL>curlhttp://jayan.kandathil.org:4503/content/dam/guides/manual.pdf > C:\TEMP\manual.pdf

Many administrative and maintenance operations can also be remotely executed on both the “author” and “publish” CQ instances if you had Administrator (“admin”) credentials.

1) Create a folder in /apps called myFolder:

c:\Programs\cURL>curl -u admin:admin -Fjcr:primaryType=sling:Folder http://localhost:4502/content/dam/myFolder

2) Copy the folder /content/dam/geometrixx/icons/ (and its contents) to /content/dam/myFolder

c:\Programs\cURL>curl -u admin:admin -F:operation=copy -F:dest=/content/dam/myFolder/ http://localhost:4502/content/dam/geometrixx/icons/

3) Backup the CQ instance to the server filesystem (/content/BACKUP/Mar20-2012.zip).  For example, if the CQ author instance is at C:\Programs\Adobe\CQ_5.5\author, then the backup will be made to C:\Programs\Adobe\CQ_5.5\BACKUP\

curl -u admin:admin -X POST http://localhost:4502/system/console/jmx/com.adobe.granite:type=Repository/op/startBackup/java.lang.String?target=/BACKUP/Mar20-2012.zip

3 comments:

  1. Great site, thanks. Would you know how to replicate a package using cURL?

    ReplyDelete
    Replies
    1. Ok found this so all good:
      Replicating Packages (CLI)

      To replicate a package, use the following command in your terminal:

      curl -u : -X POST http://localhost:7402/crx/packmgr/service/.json/etc/packages/mycontent.zip?cmd=replicate

      For example:
      1
      2

      curl -X POST http://localhost:7402/crx/packmgr/service/.json/etc/packages/my_packages/testpackage.zip?cmd=replicate
      {"success":true,"msg":"Package replicated"}

      Delete
  2. Hello,
    I have to build a curl command for setting up the replication agent from author to publisher. Can you help me out.

    Thank you

    ReplyDelete