Wiki

Clone wiki

pig / BackendAPI

The Backend

/api/v1/attack/ will get some attacks and paginated data.

/api/v1/packet/ will get some packets and paginated data.

Both are filterable on attributes. e.g.

/api/v1/attack/?source_ip=137.22.73.130&destination_ip=137.22.73.129&score__gt=5

/api/v1/packet/?attack=9

You can also get individual attacks or packets:

/api/v1/packet/[id]/

/api/v1/attack/[id]/

To classify, send a PUT request to /api/v1/classify/[id]/ like so (this can be done with jquery's ajax function):

curl --dump-header - -H "Content-Type: application/json" -X PUT --data '{"false_positive": true}' http://localhost:8000/api/v1/classify/1/

Updated