cURL command to update service config property | Community
Skip to main content
suresh_kumar_ve
Level 2
October 16, 2015
Solved

cURL command to update service config property

  • October 16, 2015
  • 5 replies
  • 3657 views

I am trying to update a service config property using cURL command, where "isEnabled=true" is the property checkbox which i want to enable

curl -u admin:admin1 -F isEnabled=true http://localhost:4502/system/console/configMgr/com.tm.help.PageActivationListner

[img]service_screen.jpg[/img]

Please suggest me the right cURL command to use in the above senario, thanks.

Regard,

Suresh Kumar.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Sham_HC

Use Firebug with persist option & manually update the config.  Then you can find what parameters are passed & update curl command accordingly. I believe you are missing property list.

The best way to do it is not through  updating configMgr Instead create a node "com.tm.help.PageActivationListner" below config node.  An example something like

curl  -F "jcr:primaryType=sling:OsgiConfig"  -F scheduler.concurrent=true -F "scheduler.concurrent@TypeHint=Boolean" -u admin:admin  http://localhost:4502/apps/daycare/config/com.day.cq.rewriter.linkchecker.impl.LinkCheckerImpl

5 replies

Sham_HC
Sham_HCAccepted solution
Level 10
October 16, 2015

Use Firebug with persist option & manually update the config.  Then you can find what parameters are passed & update curl command accordingly. I believe you are missing property list.

The best way to do it is not through  updating configMgr Instead create a node "com.tm.help.PageActivationListner" below config node.  An example something like

curl  -F "jcr:primaryType=sling:OsgiConfig"  -F scheduler.concurrent=true -F "scheduler.concurrent@TypeHint=Boolean" -u admin:admin  http://localhost:4502/apps/daycare/config/com.day.cq.rewriter.linkchecker.impl.LinkCheckerImpl

suresh_kumar_ve
Level 2
October 16, 2015

Thanks Sham, the example shared by you for Link Checker service works fine !!

But when I tried impl the same for my custom service(created the config folder under apps/<appname>, created node with PID as sling:OsgiConfig) and on executing same cURL command it creates the property in repository but to some reason I see the change does not reflect in the console.

Any suggestion to debug or to progress on this further, please.

Thanks.

Sham_HC
Level 10
October 16, 2015

Symptoms indicates changes didn't picked by osgi even exists in repo. Verify

*    If there is any config already exists in repo in someother location.

*    Make sure if you have custom run mode create the config under right run mode.

suresh_kumar_ve
Level 2
October 16, 2015

I managed to get this working by adding the runmode to the config folder like config.runmode and works perfectly alright.

Is there a reason why it behaves so only for the custom services but just config folder works for all out of box service like link checker, sling authenticator, etc.. ?

Thanks.

Sham_HC
Level 10
October 16, 2015

It will behave consistently otherwise it is bug & you might not have required hotfix deponding on aem version.  But for your usecase be it oob or custom always create under right runmode config