from fortiosapi import FortiOSAPI fmg = FortiOSAPI() fmg.login('admin', 'password', '10.0.0.1', verify=False)
system_status = fmg.get('system_status') print(system_status)
policy_data = { "policyid": "100", "srcintf": [{"name": "internal"}], "dstintf": [{"name": "external"}], "srcaddr": [{"name": "any"}], "dstaddr": [{"name": "webserver"}], "action": "accept", "schedule": "always", "service": [{"name": "http"}, {"name": "https"}], "logtraffic": "enable", "logtraffic-start": "enable", } fmg.post('firewall_policy', data=policy_data)
pip install fortiosapiOverall, FortiOSAPI is a powerful package for interacting with the Fortinet FortiOS REST API, and it provides a convenient and intuitive interface for performing tasks such as authentication, configuration, and monitoring.