The connection between the client and server system is connected through a REST API over the HTTP protocol. This connection is using the URI to describe resources and the http methods to describe, what to do with the resource. A resource is for example a running moongen process or the interface list. The answers are described by HTTP status codes to show, is it working correct or what happened. Using this method reduces the overhead sending data over networks.
Method | Usage | HTTP Body |
---|---|---|
HEAD | Status Information with Status Code | No |
GET | Get the described resource | Yes |
POST | Create Resource | Yes |
PUT | Update Resource | Yes |
DELETE | Destroy the resource | No |
In this sections every entry point and used methods as well as the answer is described.
- URI: /
- Method: GET
- Response with the Default used GUI files (Static Response)
- URI: /config/
- Reponse: Static GUI Configuration file under config/configuration.json
This defines the Default Entry point to the REST API:
- URI: /rest/
- No Body, Nothing else
- Response: 200 OK (When Server is running)
- No Body, Nothing else
- Acttion: Stops the Running Server
- Response: 200 OK (Cannot happen, that it is not working)
##Interface Entry The Entry point for getting the list of usable interfaces for MoonGen and DPDK in the correct order.
- URI: /rest/interfaces/
- Method: GET
- Action: Get a list of interfaces
- Response: Array List of Interfaces: show (Names), index (id order)
Is the entry for system relevant information:
- URI: /rest/system/
- Method: GET
- Action: Calls different Methods to get system information
- Response: JSON {os: Operating System, arch: Architecture x86 or x64, hostname: Hostname, user: User starting MoonGen, core: CPU cores, lua:{ version: Lua Version, status: Lua Status } }
Is build to delete or access direct to history files:
- URI: /rest/history/
- Method: DELETE
- Action: Delete all files in the history folder
- Response: 200 OK or 403 Failure
In this part, the Running MoonGen process id can be get or a new process can be started for example:
- URI: /rest/moongen/
Returns the current running MoonGen Id or a empty object, if no process is currently running
- Action: reads the Execution Number
- Response: JSON {execution: Execution Number} or {}
Starts a new Process, if no other MoonGen Process is currently running.
- Action: Stores Config and starts a new process MoonGen
- Body: Requires a JSON Configuration files, define by the config file for the GUI with necesary information: title, author and script (MoonGen script to run with the server)
- Response: JSON {execution: ID of execution}, if successfully
This entry is working with a running process or will return status 404 if no one found at this entry:
- URI: /rest/moongen/{executionNumber}/
- Action: Search if the process is running at the moment
- Response: status 200 if running or 412 if the process is stopped
- No Body
- Action: Returns the data from the actual count
- Parameter: count (Number of already send data points)
- Response: JSON {data: {List of data points},count:{Number already send included them send in this packet}}
- Status: 200 if process is found
- Action: Updates the configuration file
- Body: Requires a JSON Configuration files, define by the config file for the GUI with necesary information: title, author and script (MoonGen script to run with the server)
- Status: 200 if successfully
- Action: Stopps the current running MoonGen process
- Response: Status 200 for OK
- Action: Reads the Log lines as HTML objects
- Parameter: Seek for the beginning of the lines
- Response: JSON {seek: {The number after this reponse}, log: {Lines of the log as array} }
- Status: 200
- Action: Activates the button action
- Parameter: button for the button name
- Status: 200