diff --git a/backend/Firegex-API/README.md b/backend/Firegex-API/README.md new file mode 100644 index 0000000..36c807f --- /dev/null +++ b/backend/Firegex-API/README.md @@ -0,0 +1,186 @@ +# **WORK IN PROGRESS** + +# Firegex-API Documentation +### This is a short description of the API + +# +# 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_pacchetti": , + "n_regex": + }, + { + // Another service + } +] +``` + +# +## **GET** **```/api/service/```** +### Server response: +```json +{ + "id": , + "status": , + "public_port": , + "internal_port": , + "n_pacchetti": , + "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": , + "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": , + "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" +} +``` \ No newline at end of file