RESTful API - Application Management - Storm Streaming Server

This section describes Storm’s RESTful API regarding server basic functionality and information.

Get application list

Request typeGET
URL/rest-api/applications
AnswerHTTP/1.1 200 OK
Content-Type: application/json

{
   "status":"success",
   "data":{
      "applications":[
         "live",
         "edge"
      ]
   }
}
                                        
Table 1. Get application list table

Field explanation:

applicationsList of all active applications
Table 2. Get application list fields table

Get application info

Request typeGET
URL/rest-api/applications/${APPLICATION_NAME}
AnswerHTTP/1.1 200 OK
Content-Type: application/json

{
   "status":"success",
   "data":{
      "name":"live",
      "type":"live",
      "videoStreams":1,
      "connections":10,
      "transcodingTasks":0,
      "download":15400,
      "upload": 681231,
      "startDate":1685526733
   }
}
                                        
Table 3. Get application info table

Field explanation:

nameApplication name
typeApplication type, possible values: live, edge, origin.
videoStreamsNumber of active (live) video streams.
connectionsNumber of encoding tasks for this application (if enabled).
transcodingTasksNumber of encoding tasks for this application (if enabled).
downloadDownload speed for this application (all incoming streams).
uploadUpload speed for this application (all viewer connections).
startDateStart date for this application in Unix time.
Table 4. Get application info fields table

Get application stream list

Request typeGET
URL/rest-api/applications/${APPLICATION_NAME}/stream-list
AnswerHTTP/1.1 200 OK
Content-Type: application/json

{
   "status":"success",
   "data":{
      "streamCount":2,
      "streamList":[
         {
            "streamName":"test",
            "viewersCount":100,
            "sourceState":"streaming",
            "startTime":1685526733,
            "download":3650,
            "upload":292000
         },
         {
            "streamName":"test_2",
            "viewersCount":1,
            "sourceState":"streaming",
            "startTime":1685526733,
            "download":3650,
            "upload":3650
         }
      ]
   }
}
                                        
Table 5. Get application stream list table

Field explanation:

streamCountTotal number of active streams
streamNameStream name
viewersCountNumber of viewer connections
sourceStateCurrent source state
startTimeStream start time in UNIX time format
downloadDownload speed for this stream (generated by a source)
uploadUpload speed for this stream (all viewer connections)
Table 6. Get application stream list fields table

Get application configuration

Request typeGET
URL/rest-api/applications/${APPLICATION_NAME}/config
AnswerHTTP/1.1 200 OK
Content-Type: application/json

{
   "status":"success",
   "data":{
      "RTMPController":{
         "allowStreamPublish":true,
         "allowStreamOverwrite":true,
         "allowClientPlayback":true,
         "keepClientStreamsAlive":true,
         "playbackAuthRequired":true
      },
      "secureStream":{
         "enabled":true,
         "password":"qwerty",
         "checkViewerIP":false,
         "tokenLifespan":10
      },
      "MP4MuxerSettings":{
         "variableFPS":true,
         "keyFrameCompensation":true
      },
      "DVRSettings":{
         "enabled":false,
         "cacheSize":100
      },
      "recordingSettings":{
         "enabled":false,
         "cacheSize":100,
         "savePath":"/srv/storm/recordings"
      }
   }
}
                                        
Table 7. Get application configuration table

Field explanation:

RTMPControllerRTMP settings block. For specific field reference please check Live Application Configuration guide guide.
SecureStreamSecure Stream settings block. For specific field reference please Live Application Configuration guide guide.
MP4MuxerSettingsMP4 Muxer settings block. For specific field reference please check Live Application Configuration guide guide.
DVRSettingsDVR settings block. For specific field reference please check Live Application Configuration guide guide.
RecordingSettingsRecording settings block. For specific field reference please check Live Application Configuration guide guide.
Table 8. Get application configuration fields table

Please keep in mind that application configuration will differ for each type of application.

Delete application

Request typeDELETE
URL/rest-api/applications/${APPLICATION_NAME}
AnswerHTTP/1.1 200 OK
Content-Type: application/json

{
   "status":"”success”",
   "data":{
      "command":"delete"
   }
}
                                        
Table 9. Delete application table

Field explanation:

applicationsList of all active applications
Table 10. Delete application fields table

Create application

Request typeGET
Request Data

{
   "data":{
      "applicationName":"live",
      "applicationType":"live",
      "RTMPController":{
         "allowStreamPublish":true,
         "allowStreamOverwrite":true,
         "allowClientPlayback":true,
         "keepClientStreamsAlive":true,
         "playbackAuthRequired":true
      },
      "secureStream":{
         "enabled":true,
         "password":"qwerty",
         "checkViewerIP":false,
         "tokenLifespan":10
      },
      "MP4MuxerSettings":{
         "variableFPS":true,
         "keyFrameCompensation":true
      },
      "DVRSettings":{
         "enabled":false,
         "cacheSize":100
      },
      "recordingSettings":{
         "enabled":false,
         "cacheSize":100,
         "SavePath":"/srv/storm/recordings"
      }
   }
}
                                        
URL/rest-api/applications
AnswerHTTP/1.1 200 OK
Content-Type: application/json

{
   "status":"success",
   "data":{
      "command":"create"
   }
}
                                        
Table 11. Create application table

Field explanation:

commandRepeats command from Request Data.
applicationNameName for new application.
applicationTypeType of new application. Possible values: live, origin, edge.
RTMPControllerRTMP settings block. For specific field reference please check Live Application Configuration guide guide.
SecureStreamSecure Stream settings block. For specific field reference please check Live Application Configuration guide guide.
MP4MuxerSettingsMP4 Muxer settings block. For specific field reference please check Live Application Configuration guide guide.
DVRSettingsDVR settings block. For specific field reference please check Live Application Configuration guide guide.
DVRSettingsRecording settings block. For specific field reference please check Live Application Configuration guide guide.
Table 12. Create application fields table

Get authorization data

Request typeGET
URL/rest-api/applications/${APPLICATION_NAME}/authorization
AnswerHTTP/1.1 200 OK
Content-Type: application/json

{
   "status":"success",
   "data":{
      "enabled":true,
      "authorizationList":[
         {
            "type":"credentials",
            "username":"admin",
            "password":"qwerty"
         },
         {
            "type":"token",
            "token":"62cjdj",
            "expireTime":1685560070
         }
      ]
   }
}
                                        
Table 13. Get authorization data table

Field explanation:

enabledInforms whenever publishing authorization is enabled for this application.
authorizationListList of all authorization items. Items can be of “credentials” and “token” type.
typeType of authorization item. it can be of “credentials” and “token” type.
usernameUsername for credentials authorization item.
passwordPassword for credentials authorization item.
tokenToken string for token authorization item.
expireTimeTime after which token expires expressed (unix timestamp).
Table 14. Get authorization data fields table

Add authorization data

Request typePUT
Request Data

{
   "type":"credentials",
   "username":"admin",
   "password":"qwerty"
}

// or

{
   "type":"token",
   "token":"62cjdj",
   "expireTime":1685560070
}
                                        
URL/rest-api/applications/${APPLICATION_NAME}/authorization
AnswerHTTP/1.1 200 OK
Content-Type: application/json

{
   "status":"success",
   "data":{
      "command":"create"
   }
}
                                        
Table 15. Add authorization data table

Field explanation:

typeType of authorization item. it can be of “credentials” and “token” type.
usernameUsername for credentials authorization item.
passwordPassword for credentials authorization item.
tokenToken string for token authorization item.
expireTimeTime after which token expires expressed (unix timestamp).
Table 16. Add authorization data fields table

Delete authorization data

Request typeDELETE
Request Data

{
   "type":"credentials",
   "username":"admin",
   "password":"qwerty"
}

// or

{
   "type":"token",
   "token":"62cjdj"
}
                                        
URL/rest-api/applications/${APPLICATION_NAME}/authorization
AnswerHTTP/1.1 200 OK
Content-Type: application/json

{
   "status":"success",
   "data":{
      "command":"delete"
   }
}
                                        
Table 17. Delete authorization data table

Field explanation:

typeType of authorization item. it can be of “credentials” and “token” type.
usernameUsername for credentials authorization item.
passwordPassword for credentials authorization item.
tokenToken string for token authorization item.
Table 18. Delete authorization data fields table