# **WORK IN PROGRESS** # Firegex-API Documentation ### This is a short description of the API ## TODO 1. custom windows docker-compose 2. fix glich change page with loading screen 3. Instant refresh after an add or delete 4. backend checks and errors 5. frontend requests on buttons 6. frontend messages on success and some failure 7. back and frontend password 8. volume on the database 9. compile c++ -O3 # # Documentation ## Index - [General stats](#get-apigeneral-stats) - [List services](#get-apiservices) - [Service info](#get-apiserviceserv) - [Stop service](#get-apiserviceservstop) - [Start service](#get-apiserviceservstart) - [Delete service](#get-apiserviceservdelete) - [Terminate service](#get-apiserviceservterminate) - [Regenerate public port](#get-apiserviceservregen-port) - [Service regexes](#get-apiserviceservregexes) - [Regex info](#get-apiregexregexid) - [Delete regex](#get-apiregexregexiddelete) - [Add regex](#post-apiregexesadd) - [Add service](#post-apiservicesadd) # # ## **GET** **```/api/general-stats```** ### Server response: ```json { "services": , "closed": , "regex": } ``` # ## **GET** **```/api/services```** ### Server response: ```json [ { "id": , "status": , "public_port": , "internal_port": , "n_packets": , "n_regex": }, { // Another service } ] ``` # ## **GET** **```/api/service/```** ### Server response: ```json { "id": , "status": , "public_port": , "internal_port": , "n_packets": , "n_regex": } ``` # ## **GET** **```/api/service//stop```** ### Server response: ```json { "status": "ok" } ``` # ## **GET** **```/api/service//start```** ### Server response: ```json { "status": "ok" } ``` # ## **GET** **```/api/service//delete```** ### Server response: ```json { "status": "ok" } ``` # ## **GET** **```/api/service//terminate```** ### Server response: ```json { "status": "ok" } ``` # ## **GET** **```/api/service//regen-port```** ### Server response: ```json { "status": "ok" } ``` # ## **GET** **```/api/service//regexes```** ### Server response: ```json [ { "id": , "service_id": , "regex": , "is_blacklist": , "n_packets": , "mode": <"C"|"S"|"B"> // Client to server, server to client or both }, { // Another regex } ] ``` # ## **GET** **```/api/regex/```** ### Server response: ```json { "id": , "service_id": , "regex": , "is_blacklist": , "n_packets": , "mode" <"C"|"S"|"B"> // Client to server, server to client or both } ``` # ## **GET** **```/api/regex//delete```** ### Server response: ```json { "status": "ok" } ``` # ## **POST** **```/api/regexes/add```** ### Client request: ```json { "service_id": , "regex": , "is_blacklist": , "mode": <"C"|"S"|"B"> // Client to server, server to client or both } ``` ### Server response: ```json { "status": "ok" } ``` # ## **POST** **```/api/services/add```** ### Client request: ```json { "name": , "port": } ``` ### Server response: ```json { "status": "ok" } ```