How to Enable UPM Safe Mode using UPM REST API
背景
Sometimes, it might be useful to set up the UPM to Safe Mode in your instance. This is useful as this will disable all third party plugins and will assist to isolating issues that may be caused by one or more of these plugins. While the link explains how to do so manually, you might want to do this through a REST call.
Enabling, Disabling and Checking the Safe Mode status through cUrl
Enabling Safe Mode
You can run the following cUrl command to enable safe mode over the REST API. We present examples for both basic authentication and Personal Access Tokens
Disabling Safe Mode
You can run the following cURL call to disable the UPM Safe mode:
Checking Safe Mode Status
You can always check UPM status by using the call below:
$ curl -u username:password http://localhost:8090/rest/plugins/latest/safe-mode
Expected Response:
{"enabled":false,"links":{"safe-mode":"/rest/plugins/1.0/safe-mode"}}
The above example is when using basic authentication. If you are using Personal Access Tokens, adjust the command accordingly (you may use the examples from enable and disable samples above as reference.