script-server
script-server copied to clipboard
expose PARAM_ variables to script value execution
Scripts configured in values for multiselect type don't get any PARAM_ variables.
I would like those variables to get exposed to listing scripts, like in this example:
"name": "Printers Management",
"script_path": "/opt/scripts/printers.sh",
"description": "Add/Remove printer from machine.",
"parameters": [
{
"name": "Machine",
"required": false,
"type": "text"
},
{
"name": "Action",
"required": true,
"type": "list",
"default": "Show",
"values": [
"Show",
"Add",
"Remove"
]
},
{
"name": "Printer",
"type": "multiselect",
"values": { "script": "/opt/scripts/list_printers.sh" }
},
{
"name": "Operator",
"required": true,
"default": "${auth.username}",
"constant": true
}
]
}
Right now I can only get values passed as parameters, like: "values": { "script": "/opt/scripts/list_printers.sh ${Machine} ${Action}" }
But with complex scripts this is confusing and misleading, so I would like to get PARAM_MACHINE and PARAM_ACTION instead.
thanks for your time!
Hi @muzzol, to be honest this would be quite complicated. At the moment, script server calls the script only if linked values are changed (i.e. Machine and Action). It has no idea, which environment parameters are used inside the script
ok, thanks for your time :)