Enable / disabled Plugins

Comments

2 comments

  • Avatar
    Hamza Jap-Tjong

    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)

    1
    Comment actions Permalink
  • Avatar
    Nathan Giusti

    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>)

     

    0
    Comment actions Permalink

Please sign in to leave a comment.