Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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

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


Querying of all rules (of user)
> curl -s vvvv -X GET "http://127.1:8082$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$TOKEN"
Querying thenactions
> curl -s vvvv -X GET "http://127.1:8082/api/thenactions/" -H "Authorization: Token $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/