Sensetif / sensetif-app-plugin

The Grafana Application Plugin for the Sensetif platform.
Apache License 2.0
0 stars 0 forks source link

Script Update/Delete/Rename #72

Open niclash opened 11 months ago

niclash commented 11 months ago

To modify the Scripts, the same principle of sending commands to Pulsar topic is used.

Topic: sensetif/main/configurations

Formats

Update script

Key; 1:[orgId]:updateScript Value example:

{
    "name": "theNameOfTheScriptNoSlashes",
    "language": "js",
    "code": "var example = 'a string'"
}

The entire object will be stored in the keyValues store, under the type="scripts" and key=[language]:[name], e.g "js:myscript"

Additional fields that the UI probably needs to manage and store;

"description" = a human-readable description of what the script does.

Delete script

Key; 1:[orgId]:deleteScript Value example:

{
    "name": "scriptToBeDeleted",
    "language": "js"
}

Rename script

Key; 1:[orgId]:renameScript Value example:

{
    "oldName": "formerScriptName",
    "newName": "newScriptName",
    "language": "js"
}