unRAID API


Recommended Posts

Hi,

 

I have a feature request for some form of unraid API.

 

I have been using Unraid for along time now and was using with with esxi. Since v6 it has taken over as my host machine and I am doing more with it than ever.

I did notice there was a previous request for this in December 2014, Link, for an API but this was highlighted as not a priority at the time and given that unraid v6 was still in early beta stages this makes sense.

 

At the moment almost all the control requires ssh/telnet or web console access. This to me poses a potential security risk and think that an API might be able to provide access to some of the commonly used functions without providing access to all the system functions of unraid.

 

Some of the features that I would like to see in this this API are below:

  • Access token to bypass the basic authentication for API.
  • Possible multiple tokens with different access. example tokens, Global, Docker only, VM only, System only, Docker and VMs only, Plugins.... This could be managed via a webpage with automatically generated token but be able to be manually set or regenerated.
  • Some form of system/docker/vm overview that is easily obtained. I use Zeron's jsonvars plugin to provide me with information about the server for some of my home automation applications and monitoring. I also use SNMP and each has there own advantages.
  • Potentially make the API available for plugins to publish information.
  • Docker remote control. Ability to start/stop/restart containers would be the starting point. I am sure there would be other things that people might like to see.
  • VM remote control. Ability to start/stop/restart vm's would be the starting point. This might be a work around the physical power button problem that has been requested, for example an arduino, home automation system or even IFTTT could be used to send commands.
  • Unraid system control. Starting, stopping, powerdown, restart, start parity, spinup, spindown check etc. This should probably should be limited to non destructive system functions as to limit malicious/accidental control.
  • This may make it easier for third-parties to develop monitoring plugins or integration into automation systems.
  • There could be an option to provide some form of share control. I have recently become more Ransom-ware aware and have put in processes to try an limit damage in the event of an attack. Some of the suggestions on this forum are to change the user share from read-only to write when needed. An API could potentially change a share from read/write status of a share. The control of this could handled by the user in the form of a script or webpage etc.
  • Possibility to run command-line command/scripts. This goes against my non-destructive comment above but could be useful for anything not covered by the API. It probably should have it own API token.
  • There is the possibility that this may be able to be done as a plugin. It might be a good starting location but I still think an API should be part of the core unraid functionality.

 

 

I have noticed a few businesses/enterprises these days embracing API strategies, (example Telstra Australia) and they usually cite the collaboration, efficiency and development benefits. I have seen first-hand what having everybody developing their own backdoor/link to systems can have, especially on the inability to control system load and when trying to upgrade/change systems.

 

The development and documentation of an API is no small task but I think it might unlock some key development/features for the future of unraid.

  • Like 3
Link to comment
  • 3 months later...
  • 3 months later...
  • 1 month later...
  • 9 months later...

I know this is old, but a potential explanation for the solutions out there now is that they are simply screen-scraping.

The login process is fairly simplistic using basic auth so it's not too much trouble to pull data from pages you know the structure of.

 

I haven't personally looked at the DOM for unRaids web UI, but I'm willing to wager that if no official API exists, then this must be happening.

My own take on the law of parsimony there.. 

 

I would still be very interested in an official API - I roll my own dashboard bringing together monitoring information from various restful web services and since moving to unraid, would like to continue the same.

Link to comment
  • 2 weeks later...
On 03/03/2018 at 12:12 AM, Saldash said:

I would still be very interested in an official API - I roll my own dashboard bringing together monitoring information from various restful web services and since moving to unraid, would like to continue the same.

 

+1, I also do this,  REST API for unRAID would be great if it was available.

Link to comment
  • 3 months later...
  • 1 month later...
  • 9 months later...
  • 3 weeks later...
  • 2 weeks later...
  • 4 weeks later...
  • 8 months later...
  • 5 weeks later...
  • 4 weeks later...

There are a few things I can think of that would be quite beneficial to have API integrations in unRAID for Docker and VMs.

 

Docker Features

  • Some sort of docker-compose.yml ingestion would be nice.
  • Start/stop/restart/edit/status/check for update/update containers

VM Features

  • Create/Delete VMs/Disks
  • Start/Stop/Restart/Status/Edit VMs
  • ARP-Scan/Ping to get interface addresses for VMs

This would allow us to automate VM creation and subsequent automation of the VM configuration post creation. Someone could easily tie in a set of curl requests into an Ansible module for unRAID, which would increase exposure for unRAID as well. 

Link to comment
  • 3 months later...

+1 for an official API but it does NOT need to be a web based interface, the underlying individual software functions can easily use any suitable programming language.

I'd love to see unRAID move to a completely open source support model, similar to how CentOS compares to RHEL, then I'd willingly contribute more time to the product and pay for a reasonable yearly support subscription. Perhaps there are other professional developers and testers out there that feel the same way? If so, maybe a crowdfunding effort to kick-start an official open unRAID fork is a viable option, as long as Limetech formally approve of course, as owners of the brand. 

Link to comment
  • 3 weeks later...
  • 4 months later...
  • 1 month later...

I am very interested in this.  I would like the APi to have a nice TCP/IP interface or a REST interface.  IIRC an earlier version of unraid (way back in time) had the ability to do things using TCP/IP and GET.  I used that to spin up/down disks asynchronously when I started my home theater so that I would have the wait on first access when a movies stored on the unraid NAS was selected.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.