davidchayla / fortigateapi Goto Github PK
View Code? Open in Web Editor NEWAccess Fortigate REST API in python
License: GNU General Public License v3.0
Access Fortigate REST API in python
License: GNU General Public License v3.0
Hey,
thx for this great API.
I would like to see if you could add 1 more feature.
Policy search like for all disabled policies for example.
If i use your SearchFwPolicyID it stops at the first matching rule and thats it but i would like see every rule in the PolicyPackage which would match.
Is that something you could add?
thx in advance
I am trying to create a device (object) with it's mac address and then trying to add it to a device group.
I could not find any information related to it in the REST API documentation.
This can be done like this in the command line:
config user device
edit device_name
set mac AA:AA:AA:AA:AA
set type windows-pc
...
next
end
And then adding it to a group:
config user device-group
edit group_name
set member "device_name"
next
end
...
Also if a device has more than one mac (ethernet and wifi), two separate devices need to be created, link then and set one as default.
Can this be done adapting your code? Thanks.
fg.GetFwAddressGroup("Block")
fetches me properly the details as
"name":"Block", "q_origin_key":"Block", "uuid":"asdfasdf", "member":[ { "name":"TEST1", "q_origin_key":"TEST1" } ],
However when I try to update using the code snippet below
ips_to_add_list = [] ips_to_add_list.append("1.1.1.1") ips_to_add_list.append("2.2.2.2") response = fg.SetFwAddressGroup("Block",ips_to_add_list) print(response)
I get error "500". Not sure where my mistake is. Any help would be appreciated.
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
I have a Fortigate 100D without vdom enabled, but I can't get the following test to work:
import FortigateApi
fg = FortigateApi.Fortigate('192.168.1.1', 'root', 'admin', 'password')
fg.AddFwAddress('srv-A','10.1.1.1/32')
fg.GetFwAddress('srv-A')
fg.DelFwAddress('srv-A')
All I got is:
login status: 200
I tried to change vdom from root to ' ' but no joy. Any idea?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.