Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Cannot delete configuration using CURL on AEM 6.5

Avatar

Avatar
Validate 1
Level 2
surenk
Level 2

Likes

9 likes

Total Posts

48 posts

Correct Reply

3 solutions
Top badges earned
Validate 1
Ignite 1
Give Back 5
Give Back 3
Give Back
View profile

Avatar
Validate 1
Level 2
surenk
Level 2

Likes

9 likes

Total Posts

48 posts

Correct Reply

3 solutions
Top badges earned
Validate 1
Ignite 1
Give Back 5
Give Back 3
Give Back
View profile
surenk
Level 2

16-09-2020

I'm trying to run a CRUL command to delete a configuration

 

The PID is: com.myproject.aem.core.services.impl.ApiSettingsService

 

Tried these but not working:

 

curl -v -u admin:admin http://localhost:4502/system/console/configMgr/com.myproject.aem.core.services.impl.ApiSettingsService -d "action=DELETE"

curl -v -u admin:admin -X DELETE http://localhost:4502/system/console/configMgr/com.myproject.aem.core.services.impl.ApiSettingsService

curl -u admin:admin -F":operation=delete" -F":applyTo=/system/console/configMgr/com.myproject.aem.core.services.impl.ApiSettingsService" http://localhost:4502

curl -u admin:admin -F":operation=delete" http://localhost:4502/system/console/configMgr/com.myproject.aem.core.services.impl.ApiSettingsService

 

 Using "DELETE" shows "Method not allowed. Checked "Apache Sling Referrer Filter" and "DELETE" is not listed. 

 

What am i missing?

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Give Back
Level 4
Jineet_Vora
Level 4

Likes

42 likes

Total Posts

45 posts

Correct Reply

22 solutions
Top badges earned
Give Back
Ignite 1
Boost 5
Boost 3
Boost 25
View profile

Avatar
Give Back
Level 4
Jineet_Vora
Level 4

Likes

42 likes

Total Posts

45 posts

Correct Reply

22 solutions
Top badges earned
Give Back
Ignite 1
Boost 5
Boost 3
Boost 25
View profile
Jineet_Vora
Level 4

16-09-2020

Hello @surenk,

Apparently you're deleting the config from a wrong location. The location of config can be under /apps/<project_name>/config or /apps/system/config.

Please try with below command: 

 

curl -u admin:admin -H User-Agent:curl -F":operation=delete" http://localhost:4502/apps/<project_name>/config/<pid>.config

 

 

Jineet_Vora_0-1600281261913.png

Hope this helps!

Jineet

Answers (1)

Answers (1)

Avatar

Avatar
Validate 1
Level 2
surenk
Level 2

Likes

9 likes

Total Posts

48 posts

Correct Reply

3 solutions
Top badges earned
Validate 1
Ignite 1
Give Back 5
Give Back 3
Give Back
View profile

Avatar
Validate 1
Level 2
surenk
Level 2

Likes

9 likes

Total Posts

48 posts

Correct Reply

3 solutions
Top badges earned
Validate 1
Ignite 1
Give Back 5
Give Back 3
Give Back
View profile
surenk
Level 2

16-09-2020

Thanks @Jineet_Vora There is a small change to your answer but thanks for pointing me.

The solution:

When a user edits an OSGI config, a copy is written by AEM at `/apps/system/config` . The config needs to be deleted from here, using below command. And on deleting this, if there is code for this configuration, then the default osgi configuration is created again using the default values as specified in code.

  • The path of the actual osgi configuration will be deployed by code at /apps/myproject/config/com.myproject.aem.core.services.impl.ApiSettingsService

  • On editing the config, a new node is created by AEM at /apps/system/config/com.myproject.aem.core.services.impl.ApiSettingsService.config

 
The delete command:
 

 

curl -u admin:admin -F":operation=delete" http://localhost:4502/apps/system/config/com.myproject.aem.core.services.impl.ApiSettingsService.config

 

 

The code based config can also be deleted as:

 

 

curl -u admin:admin -F":operation=delete" http://localhost:4502/apps/myproject/config/com.myproject.aem.core.services.impl.ApiSettingsService