Skip to main content

Python API for fortigate

Project description

FortiAPI

API for FortiOS or how to turn FortiOS into JunOS

Introduction

This API allows you to interact with a device runnine FortiOS in a sane way. With this API you can:

  • Connect to the device, retrieve the running config (the entire config or some blocks, whatever you want) and build a model

  • Build the same model from a file

  • Do changes in the candidate configuration locally

  • Create a candidate configuration from a file

  • Do a diff between the running config and the local candidate config

  • Generate the necessary commands to go from the running configuration to the candidate configuration

Documentation

You can find the documentation on [Read the Docs](https://pyfg.readthedocs.io/en/latest/index.html).

Installation

To install the library execute:

` pip install pyfg `

Examples

In the examples directory you will find different file with examples on how to use the API:

  • example1 - How to retrieve the configuration of a VDOM

  • example2 - How to get BGP information and navigate through it

  • example3 - How to load BGP configuration from a file (running.conf is emulating this step), load the candidate configuration from a file and then check the differences and show to get to the candidate configuration from the running one.

  • example4 - Similar as example3 but this time the changes are done programmatically instead of using a text file.

  • example5 - This example will do some changes, will try to commit them, will detect that something went wrong and it will finally rollback the changes.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyfg-0.49_1.tar.gz (24.6 kB view details)

Uploaded Source

File details

Details for the file pyfg-0.49_1.tar.gz.

File metadata

  • Download URL: pyfg-0.49_1.tar.gz
  • Upload date:
  • Size: 24.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pyfg-0.49_1.tar.gz
Algorithm Hash digest
SHA256 3a406445741cbebffb0411a150192d7117ed08c4b6e0442f2ffa3f65d788684e
MD5 f7e875cf67e882d78ac563f006af32c5
BLAKE2b-256 d5f59c03e1b4a96eafdfb1123af128cdf9f895388ac52844a8e00fe7ffb6f593

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page