Hi,
you can use the "init script" functionallity.
- Download and unzip the configuration via the web interface
- Write a python script 'init.py' with content eg. 'print("Hello ctrlX")' and save it in the configuration in the directory "script" (any other dir/filename would also work)
- Zip the configuration directory (now includes the init.py file) and upload it to the core via web ui
- Write on the datalyer node "script/cfg/init-script" the payload "{"file": "activeConfiguration/script/init.py","language": "python","parameter": []}" (can be done also via web ui)
- Reboot
- Now there is always a python instance called "Base" (prerequisite is the python runtime snap)
- POST the following payload on "script/instances/Base/cmd/file" to excecute any script you need (via web ui or REST API). Payload eg. '{"name":"activeConfiguration/script/myworker.py","param":[]}'
Notes:
Link to documentation
It seems in the docu linked above is a mistake according to the path for the init script see: activeConfiguration vs. activeSolution