Enable / disabled Plugins
Hi,
I didn't find in REST API documentation a command to enable and / or disable an installed plugin.
Is it possible to do this action with REST API ?
Regards,
Patrice
-
Hi Zcost,
It is possible with the /api/plugins endpoint. Here is the script we use for a single enable/disable of a plugin;
For enabling set isEnabled to True
For disabling set isEnabled to False
import requests
url = "URL/api/v1/plugins"
payload = "[{ \"name\": \"metadata\", \"lastUpdate\": \"2019-08-11T15:21:36.491Z\", \"version\": \"0\", \"isEnabled\": false, \"folderName\": \"metadata\"}]"
headers = {
'accept': "application/json",
'Content-Type': "application/json",
'cache-control': "no-cache",
'Authorization': 'Bearer TOKEN'
}response = requests.request("PATCH", url, data=payload, headers=headers)
print(response.text)
-
You can also do this with PySense, a Python SDK for Sisense.
https://support.sisense.com/hc/en-us/community/posts/360042115574-PySense-a-Python-SDK-for-Sisense
pip install PySenseSDK
from PySense import PySense
py_client = PySense.PySense(<your server>, <your login>, <your password>)
my_plugin = py_client.get_plugins(search='MyPluginName')[0]
my_plugin.set_plugin_enabled(<True or False>)
Please sign in to leave a comment.
Comments
2 comments