Rest API - Storm Server

The Rest API allows to get basic information from the server and also to call some functions. Before we can access the API, it must be configured properly via preferences.xml file

                                
<REST>
    <IPWhiteList>192.168.0.1, 192.168.0.2</IPWhiteList>
</REST>
                            

IPWhiteList can contain multiple IP addresses separated by comma (space is optional). If a requesting agent is not included in the list following message on a request will be returned:

                                
{status:"fail", reason:"unknown agent"}
                            

Available API

Below you’ll find a list of available API for basic server management.

  1. Get server version

    URL: /storm/rest-api/get-version

                                    
    {
        version: "1.0.3",  // server version
        branch: "main"   // server branch (usually main or development)
    }
                                
  2. Get server load

    URL: /storm/rest-api/get-load

                                    
    {
        cpuLoad: 4,            // CPU usage in %
        heapSize: 342134,     // Total number of memory in MB taken by Java VM
        usedMemory: 23131,    // Memory used by the server
        freeMemory: 341580    // Free memory
    }
                                
  3. Get statistics

    URL: /storm/rest-api/get-statistics

                                    
    {
        streams: 100,    // Number of streams
        viewers: 10000,  // Number of viewers
        uptime: 3600     // Number of seconds since player start
    }
                                
  4. Server restart

    URL: /storm/rest-api/restart-server

                                    
    {
        command: "restart",     // Command name
        status: "success"       // Action status
    }
                                
  5. Server shutdown

    URL: /storm/rest-api/shutdown-server

                                    
    {
        command: "shutdown",     // Command name
        status: "success"       // Action status
    }