Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request - Policy Route #1

Open
daBONDi opened this issue Apr 9, 2017 · 2 comments
Open

Feature Request - Policy Route #1

daBONDi opened this issue Apr 9, 2017 · 2 comments

Comments

@daBONDi
Copy link

daBONDi commented Apr 9, 2017

You got the Fortigate Rest API Docs? where i can find it?

I tryed to add the functions for policy route entrys and copy paste from you the static route functions.
i can read and Delete the Policy route with you self.ApiXXX functions, but on add i got a problem

should the payload be equal to thhe console commands?
maybe you can give me some hint, or implement it in your Awesome lib

Thanx in advance

@DavidChayla
Copy link
Owner

hi
sorry i'm pretty late, i've just seen your comment
could you show me the code you've written for the policy route, we will start from here
thks

@daBONDi
Copy link
Author

daBONDi commented Jun 16, 2017

Hi David, the problem was missing fields in the json post, thats because i got no documentation, and still as fortigate customerer i need to pay a huge amount of money to get the fucking docs for it, realy sucks.

Here the json snipp i post to the api to get it to work, maybe you can build it into your api some time

    addResult = fgt.post('/api/v2/cmdb/router/policy', params={"vdom": vdom},
             data={"json": {
                 "input-device": [ { "name": "lan"} ],
                 "src":  [{"subnet": "192.168.10.5/255.255.255.255",
                           "q_origin_key": "192.168.10.5/255.255.255.255"}],
                 "dst": [{"subnet": "0.0.0.0/0.0.0.0",
                          "q_origin_key": "0.0.0.0/0.0.0.0"}],
                 "output-device": "wan2",
                 "comments": "something",
             }})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants