


Use case Create an AEM content package using cURL cURL to create a package Below is the syntax and a sample command to create an AEM content package using cURL. curl -u : -X POST http://localhost:4502/crx/packmgr/service/.json/etc/packages/mycontent.zip?cmd=create -d packageName= -d groupName= e.g. curl -u admin:admin -X POST http://localhost:4502/crx/packmgr/service/.json/etc/packages/mycontent.zip?cmd=create -d packageName=sample-test-package -d groupName=my_packages After the successful execution of cURL, you will see a successful message. {"success":true,"msg":"Package created","path":"/etc/packages/my_packages/sample-test-package.zip"}
Please use this thread to ask the related questions.
@kautuk_sahni , thanks for sharing.
I would like to share curl command to create dispatcher flush agent -
Curl command
curl -u admin:admin -X POST -F "jcr:primaryType=cq:Page" -F "jcr:primaryType=nt:unstructured" -F "jcr:content/jcr:title=Flush Agent 5" -F "jcr:content/sling:resourceType=cq/replication/components/agent" -F "jcr:content/cq:template=/libs/cq/replication/templates/agent" -F "jcr:content/logLevel=error" -F "jcr:content/retryDelay=60000" -F "jcr:content/protocolHTTPMethod=GET" -F "jcr:content/triggerOnOffTime=true" -F "jcr:content/serializationType=flush" -F "jcr:content/transportUri=http://localhost:80/dispatcher/invalidate.cache" -F "jcr:content/protocolHTTPHeaders=CQ-Action:{action}" -F "jcr:content/protocolHTTPHeaders=CQ-Handle:{path}" -F "jcr:content/protocolHTTPHeaders=CQ-Path:{path}" -F "jcr:content/jcr:description=Agent that sends flush requests to the dispatcher." -F "jcr:content/enabled=true" http://localhost:5050/etc/replication/agents.author/flush5
Output -