Is the Nx Cloud up? Visit our Status Page for the current health and performance of the Nx Cloud.

Status Page

How to disable the plugin through the Metadata SDK

Answered

Comments

3 comments

  • Andrey Terentyev
    • Network Optix team

    Hello Scott,

    There is no routine in Metadata SDK for disabling a plugin on a camera.
    But you could use the Server API /ec2/setResourceParams from the plugin.

    As a parameter, it accepts an array of json objects

    {
    "name": "userEnabledAnalyticsEngines",
    "resourceId": "<here should be camera id>",
    "value": "[\""<here should be engine id>"\"]"
    }

    Engine id can be got with /ec2/getAnalyticsEngines

    0
  • Scott Chiang

    Hi Andrey, thanks for your reply, I have tried this API you commend and it works fine in turn on the plugin, but seems not to work when I want to turn the plugin off, here is my post request body, are my parameters correct? thank you.

    enable plugin:

    [{
        "name":"userEnabledAnalyticsEngines",
        "resourceId":"<camera ID>",
        "value":"[\"<engine id>\"]"
    }]
     
    disable plugin:
    [{
        "name":"userDisabledAnalyticsEngines", 
        "resourceId":"<camera ID>",
        "value":"[\"<engine id>\"]"
    }]
     
    Any comment will be helpful, thanks

     

    0
  • Andrey Terentyev
    • Network Optix team

    Hello,

    /ec2/setResourceParams and "name":"userEnabledAnalyticsEngines" are used for both enabling and disabling a plugin on a resource (a device).
    The parameter name is a kind of confusing and needs to be clarified.
    In fact, analytics Engine is always present in the Server if the plugin's binary is successfully loaded and is consequently supplied with ID.
    This API causes a DeviceAgent instance of the specific Engine indicated by ID to be created on a device.

    The "value" parameter is an array of engine IDs a DeviceAgent of which to be enabled on a device indicated by the "resourceId"

    {
    "name": "userEnabledAnalyticsEngines",
    "resourceId": "{f92adeff-3ac0-fb7c-d793-06b5a3475b52}",
    "value": "[\"{3596eadc-0afc-5c80-ddcb-149856119dbc}\",\"{687611a2-fd30-94e7-7f4c-8705642b0bcc}\"]"
    }

    So, to disable a DeviceAgent of the specific Engine, just remove engine ID from the "value" array.

    0

Please sign in to leave a comment.