Expand my Community achievements bar.

SOLVED

cURL command to update service config property

Avatar

Level 2

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.

1 Accepted Solution

Avatar

Correct answer by
Level 10

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

View solution in original post

5 Replies

Avatar

Correct answer by
Level 10

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

Avatar

Level 2

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.

Avatar

Level 10

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.

Avatar

Level 2

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.

Avatar

Level 10

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