diff --git a/docsrc/sources/controller.rst b/docsrc/sources/controller.rst index 1dc825fe..ffe3fd2b 100644 --- a/docsrc/sources/controller.rst +++ b/docsrc/sources/controller.rst @@ -20,5 +20,63 @@ Download and install debian package: https://github.com/rtbrick/bngblaster-contr API --- -https://rtbrick.github.io/bngblaster-controller/ +OpenAPI: https://rtbrick.github.io/bngblaster-controller/ +Create Test Instance +~~~~~~~~~~~~~~~~~~~~ + +`PUT /api/v1/bngblasters/` + +This API endpoint creates a test instance if not already created. The body of this request +is stored as bngblaster configuration (`config.json`). + +Each test instance creates a directory in `/var/bngblaster/`. +This directory contains the following files: + +* `config.json`: bngblaster configuration +* `run.pid`: bngblaster process ID (if running) +* `run.json`: bngblaster arguments +* `run_report.json`: bngblaster report (if enabled) +* `run.pcap`: bngblaster traffic capture (if enabled) +* `run.sock`: bngblaster control socket +* `run.stderr`: bngblaster standard error +* `run.stdout``: bngblaster standard output + +Start Test +~~~~~~~~~~~ + +`POST /api/v1/bngblasters//_start` + +The start API endpoint will start the bngblaster with the argument options +defined in the body. + +Status +~~~~~~ + +`GET /api/v1/bngblasters/` + +The status API endpoint returns the status of the test. + +Command +~~~~~~~ + +`POST /api/v1/bngblasters//_command` + +The JSON body of this API call will be passed to the bngblaster instance +control socket (`/var/bngbnlaster//run.sock``). The result will +be passed back to the client. + +Stop Test +~~~~~~~~~ + +`POST /api/v1/bngblasters//_stop` + +The stop API endpoint will send the SIGINT signal to the corresponding BNG blaster instance (`kill -INT `). + +Delete Test Instance +~~~~~~~~~~~~~~~~~~~~ + +`DELETE /api/v1/bngblasters/` + +This API endpoint deletes the test instance directory. The corresponding +test run is forcefully terminated (kill) if running.