Feature Request for API: Shutdown

ednt

Well-Known Member
Mar 16, 2017
107
7
58
We want to start a PBS via Power On, start a sync job and shutdown the PBS afterwards.

The problem at the moment is the shutdown.
There is no API function to achieve this. There is no system section.
OK we can 'hack' the system and simulate the shutdown button press, or use ssh to send the shut down command.
But it will be much easier if we can do this via API after we checked that the sync job is finished.
 
Feature requests are much better placed in our bugtracker. In the forum they get easily lost :)
 
In principal yes.
But ... this is only possible as root. So I need to create an API key for the root user with admin rights.
It is used inside of a python script.
If someone open the script, he can copy the token and cand do ehat he want with the PBS.
Very ugly.
What I need/want is a shutdown permission for a datastore user API key with no other 'system' rights.

But thanks anyway.
 
But ... this is only possible as root
how did you come to this conclusion?

the permissions required (as per the api docs above) are:

Code:
Check: {"partial":false,"path":["system","status"],"privs":["Sys.PowerManagement"]}

which basically means, the user needs the priv ' Sys.PowerManagement' on '/system/status'
 
In case you are running ZFS you should also verify if the pool is doing a scrub, trim or resilver and don't shut it down as long as those are running. Unlucky this isn't available via API at all and you would need to SSH into the PBS to check these states with "zpool status".
Would be great if the API could show the health of the underlaying storage.
 
Last edited:
  • Like
Reactions: Dunuin