You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

 

(also compare README.md in main directory of FOD/flowspy)

e.g. $SERVER_ADDR="127.1:8082"


Querying of all rules (of user)
> curl -vvvv -X GET "http://$SERVER_ADDR/api/routes/" -H "Authorization: Token $TOKEN"

Querying of single rule
> curl -vvvv -X GET "http://$SERVER_ADDR/api/routes/$id/" -H "Authorization: Token $TOKEN"
Querying thenactions
> curl -vvvv -X GET "http://127.1:8082/api/thenactions/" -H "Authorization: Token $TOKEN"


Creating/Editing existing rule (with name=Example5, it seems that id value in url can be arbitrary, but at least one attr value has to be different to before, especially for creating)
> curl  -X PUT -F "name=Example5" -F "comments=Description" -F "source=0.0.0.0/0" -F "sourceport=30" -F "destination=10.0.0.56" -F "then=https://fod.example.com/api/thenactions/3/" -H "Authorization: Token $token" http://127.1:8082/api/routes/1/

Deleting (id field in URL seems to be important here) (does not work as rule is automatically recreated in FOD after some seconds)
> curl -X DELETE  -H "Authorization: Token $token" http://127.1:8082/api/routes/24/

  • No labels