Skip to content

bradley-rose/pyFortinetAPI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 

Repository files navigation

Fortigate REST API

This is a base Python wrapper for the FortiOS API. Create custom logic as necessary, including creating new CRUD actions in apiWrapper.py. Of note, this doesn't include any amount of inventory management. Integrate your source of truth for inventory management as you see fit.

To use apiWrapper.py:

import apiWrapper as fgApi

def actionsToPerform(*, api: dict):
    with api.FortiGate(**{
        "hostAddress": "<IP address of FortiGate management interface>",
        "port": "<HTTPS port where web interface is accessible>",
        # If authenticating via apiKey:
        "apiKey": "<apiKey>".
        # Or, if authenticating via username/password:
        "username": "<username>",
        "password": "<password>"
    }) as fortiGate:
        # Syntax: result = fortiGate.<functionFrom_apiWrapper.py>
        # Example:
        result = fortiGate.getUserGroup(name="<groupName>")
        return result

def main():
    resultFromApiCall = actionsToPerform(api = fgApi)

if __name__ == "__main__":
    main()

About

Python library for Fortinet's FortiOS REST API.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages