Files
firegex-traffic-viewer/backend/Firegex-API
2022-06-27 09:28:15 +02:00
..
2022-06-27 09:28:03 +02:00
2022-06-27 09:28:03 +02:00
2022-06-27 09:28:03 +02:00
2022-06-27 09:28:15 +02:00
2022-06-27 09:28:03 +02:00

WORK IN PROGRESS

Firegex-API Documentation

This is a short description of the API

Documentation

Index

GET /api/general-stats

Server response:

{
    "services": <total number of services>,
    "closed": <total number of rejected packets>,
    "regex": <total number of regexes>
}

GET /api/services

Server response:

[
    {
        "id": <service_id>,
        "status": <service status>,
        "public_port": <public port>,
        "internal_port": <internal port>,
        "n_pacchetti": <number of rejected packets>,
        "n_regex": <number of regexes>
    },
    {
        // Another service
    }
]

GET /api/service/<serv>

Server response:

{
    "id": <service_id>,
    "status": <service status>,
    "public_port": <public port>,
    "internal_port": <internal port>,
    "n_pacchetti": <number of rejected packets>,
    "n_regex": <number of regexes>
}

GET /api/service/<serv>/stop

Server response:

{
    "status": "ok"
}

GET /api/service/<serv>/start

Server response:

{
    "status": "ok"
}

GET /api/service/<serv>/delete

Server response:

{
    "status": "ok"
}

GET /api/service/<serv>/terminate

Server response:

{
    "status": "ok"
}

GET /api/service/<serv>/regen-port

Server response:

{
    "status": "ok"
}

GET /api/service/<serv>/regexes

Server response:

[
    {
        "id": <regex id>,
        "service_id": <service_id>,
        "regex": <base64 encoded regex>,
        "is_blacklist": <true|false>,
        "mode": <"C"|"S"|"B"> // Client to server, server to client or both
    },
    {
        // Another regex
    }
]

GET /api/regex/<regex_id>

Server response:

{
    "id": <regex id>,
    "service_id": <service_id>,
    "regex": <base64 encoded regex>,
    "is_blacklist": <true|false>,
    "mode" <"C"|"S"|"B"> // Client to server, server to client or both
}

GET /api/regex/<regex_id>/delete

Server response:

{
    "status": "ok"
}

POST /api/regexes/add

Client request:

{
    "service_id": <service_id>,
    "regex": <base64 encoded regex>,
    "is_blacklist": <true|false>,
    "mode": <"C"|"S"|"B"> // Client to server, server to client or both
}

Server response:

{
    "status": "ok"
}

POST /api/services/add

Client request:

{
    "name": <the id used to identify the service>,
    "port": <the internal port>
}

Server response:

{
    "status": "ok"
}