Skip to main content

F5 BIG-IP Parser and Config Generator written in Rust

Project description

f5py

Is a Python library written in Rust for the F5 BIG-IP Configurations parsing.

The idea is to provide a simple and easy to use library to parse, manipulate, construct and generate F5 BIG-IP configurations in multiple output formats

Starting with JSON for facilitating the automation of F5 python scripts written by network and security engineers.

Then the plan is to support generating to the following formats

* LTM commands
* F5 REST API
* F5 AS3

Although this library is not a replacement for the F5 SDK, it is a good starting point for those who want to automate F5 BIG-IP LTM configurations in a simpler way

Actual State

F5 TMM Configurations generated within the scf files (LTM Commands) are parsed to generate the native rust objects that represent the configurations. Objects manipulation and JSON Output are already supported

Roadmap

* CSV output, having Virtual Servers as a reference. 
* Generating LTM commands
* Parsing and generating F5 iControl REST API
* Parsing and generating F5 AS3

Useful Links

* Github Issues Repository: `https://github.com/AhmedThabet/f5py-doc`

* The same library is used in this WASM frontend, so it's possible to parse the configs without writing a simple line of code!
    `https://ipvx.me/f5`

Usage

All the objects can be initialize by passing the raw config text to the class's initializer or using the new_default() function which will create a new object with default values

from f5py import *

l = LTM("""
ltm pool /Common/www.ipvx.me {
    members {
        /Common/10.1.2.3:8888 {
            address 10.1.2.3
        }
    }
    monitor /Common/TCP-8888
}
ltm virtual /Common/www.ipvx.me {
    destination /Common/35.156.107.63:443
    ip-protocol tcp
    mask 255.255.255.255
    pool /Common/www.ipvx.me
    profiles {
        /Common/clientssl {
            context clientside
        }
        /Common/serverssl {
            context serverside
        }
        /Common/http { }
        /Common/tcp { }
    }
    source 0.0.0.0/0
    source-address-translation {
        type automap
    }
    translate-address enabled
    translate-port enabled
}
""")

l
LTM at 0x7fff57e086b0, partitions: 1, virtual_servers: 1, pools: 1, snat_p
v = l.virtual_servers[0]
v
VS: 0x7fff57e086c8, name: /Common/www.ipvx.me , destination: /Common/35.156.107

v.to_json()
'{"name":"/Common/www.ipvx.me","destination":"/Common/35.156.107.63:443","ip-protocol":"tcp","profiles":[{"name":"/Common/clientssl","context":"clientside"},{"name":"/Common/serverssl","context":"serverside"},{"name":"/Common/http"},{"name":"/Common/tcp"}],"mask":"255.255.255.255","pool":"/Common/www.ipvx.me","source-address-translation":{"type":"automap"},"translate_address":"enabled","translate_port":"enabled","source":"0.0.0.0/0"}'

v.to_dict()

{'name': '/Common/www.ipvx.me',
 'destination': '/Common/35.156.107.63:443',
 'ip-protocol': 'tcp',
 'profiles': [{'name': '/Common/clientssl', 'context': 'clientside'},
  {'name': '/Common/serverssl', 'context': 'serverside'},
  {'name': '/Common/http'},
  {'name': '/Common/tcp'}],
 'mask': '255.255.255.255',
 'pool': '/Common/www.ipvx.me',
 'source-address-translation': {'type': 'automap'},
 'translate_address': 'enabled',
 'translate_port': 'enabled',
 'source': '0.0.0.0/0'}

v.destination.get_partition()
'Common'

v.destination.get_name()
'35.156.107.63'

v.destination.get_port()
443

v.destination.get_address()
'35.156.107.63'

v.destination.get_full_path()
'/Common/35.156.107.63'

dir(l)

['__class__',
 '__delattr__',
 '__dir__',
 '__doc__',
 '__eq__',
 '__format__',
 '__ge__',
 '__getattribute__',
 '__gt__',
 '__hash__',
 '__init__',
 '__init_subclass__',
 '__le__',
 '__lt__',
 '__module__',
 '__ne__',
 '__new__',
 '__reduce__',
 '__reduce_ex__',
 '__repr__',
 '__setattr__',
 '__sizeof__',
 '__str__',
 '__subclasshook__',
 'new_default',
 'partitions',
 'pools',
 'snat_pools',
 'to_dict',
 'to_json',
 'virtual_servers']

Disclaimer

This library is not affiliated with F5 Networks in any way. It is a personal project and is not supported by F5 Networks.

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

f5py-0.1.6-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (796.9 kB view details)

Uploaded PyPy manylinux: glibc 2.17+ x86-64

f5py-0.1.6-cp311-none-win_amd64.whl (723.8 kB view details)

Uploaded CPython 3.11 Windows x86-64

f5py-0.1.6-cp310-none-win_amd64.whl (723.8 kB view details)

Uploaded CPython 3.10 Windows x86-64

f5py-0.1.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (793.5 kB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

f5py-0.1.6-cp39-none-win_amd64.whl (724.1 kB view details)

Uploaded CPython 3.9 Windows x86-64

f5py-0.1.6-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (793.9 kB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

f5py-0.1.6-cp38-none-win_amd64.whl (725.2 kB view details)

Uploaded CPython 3.8 Windows x86-64

f5py-0.1.6-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (793.8 kB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

f5py-0.1.6-cp37-none-win_amd64.whl (725.3 kB view details)

Uploaded CPython 3.7 Windows x86-64

f5py-0.1.6-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (795.0 kB view details)

Uploaded CPython 3.7m manylinux: glibc 2.17+ x86-64

File details

Details for the file f5py-0.1.6-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for f5py-0.1.6-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 21c94acfe79fa100237b3da1fb81629fa37d0a252a197f160a23e6e29d6f5d4e
MD5 e6aa02ae37aa28e279d21375f25713b3
BLAKE2b-256 7452e6a92d69547af6af72d56933bb968bf0803b05098fe4243829a19a1f0808

See more details on using hashes here.

Provenance

File details

Details for the file f5py-0.1.6-cp311-none-win_amd64.whl.

File metadata

  • Download URL: f5py-0.1.6-cp311-none-win_amd64.whl
  • Upload date:
  • Size: 723.8 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/0.13.7

File hashes

Hashes for f5py-0.1.6-cp311-none-win_amd64.whl
Algorithm Hash digest
SHA256 9c65da8fc9df530562cd499b5a0969d3a6d2c6553379e79469194ad1fa8db0df
MD5 3cadac0702f353a7575afb6bab0d38ec
BLAKE2b-256 b9623d37b63ca26694ed7e658ea97c977217bd430869a65332e8ab292587ece8

See more details on using hashes here.

Provenance

File details

Details for the file f5py-0.1.6-cp310-none-win_amd64.whl.

File metadata

  • Download URL: f5py-0.1.6-cp310-none-win_amd64.whl
  • Upload date:
  • Size: 723.8 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/0.13.7

File hashes

Hashes for f5py-0.1.6-cp310-none-win_amd64.whl
Algorithm Hash digest
SHA256 be1e8b71f881c0218a1dfc7e07f5007d4a858df1eb6f44dab7b9ae2ab2bac18d
MD5 f1ef684974c5c3a536e4b8a80234ab38
BLAKE2b-256 b762ace54898bdccc0af512437d337687ee7098e9b898d3960bcc16893fe5ff1

See more details on using hashes here.

Provenance

File details

Details for the file f5py-0.1.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for f5py-0.1.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a82c2f679e7b5a0a3d8fe43d676a87aa9aa322ec8b85b762eb3a02121ac5620b
MD5 c042a579d360942767af4a67cef39925
BLAKE2b-256 870648b5fa682e0f8b7c3bb570be7a88fdadffdd74e614060c9e2732c08fac0a

See more details on using hashes here.

Provenance

File details

Details for the file f5py-0.1.6-cp39-none-win_amd64.whl.

File metadata

  • Download URL: f5py-0.1.6-cp39-none-win_amd64.whl
  • Upload date:
  • Size: 724.1 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/0.13.7

File hashes

Hashes for f5py-0.1.6-cp39-none-win_amd64.whl
Algorithm Hash digest
SHA256 163559719c2e780846e4baea2c555356125cd4d68110116d6acfb66b5c2b96f8
MD5 2b6581b842388cc19e3c9740497ce69f
BLAKE2b-256 2d80d4a18e60c02db842464b84fa1c220c5c4a3281d19172452bd363270eca9b

See more details on using hashes here.

Provenance

File details

Details for the file f5py-0.1.6-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for f5py-0.1.6-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 9101be559b92f85c6f910bc833d736677933b75c53432ad41d71853fb4f3d4b3
MD5 d3c2868a12fbb82babedcd264578842a
BLAKE2b-256 2f6c80581554131b83433d57657111c14b4763215e0cd4ddadd325ee3f93b504

See more details on using hashes here.

Provenance

File details

Details for the file f5py-0.1.6-cp38-none-win_amd64.whl.

File metadata

  • Download URL: f5py-0.1.6-cp38-none-win_amd64.whl
  • Upload date:
  • Size: 725.2 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/0.13.7

File hashes

Hashes for f5py-0.1.6-cp38-none-win_amd64.whl
Algorithm Hash digest
SHA256 e46efb54f0db66bc8a428b2681021344b07dc61be7e583dab6fe996d13af25aa
MD5 3d4260bb570961456c96de2b75496d4c
BLAKE2b-256 412c859131a75d1e259ea752eeaba1b3a8dd543cae9bc26a1a9d95c169cee9d5

See more details on using hashes here.

Provenance

File details

Details for the file f5py-0.1.6-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for f5py-0.1.6-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1691b8e89fbf29f208dc72406776fc26b7102f72fcbbb1c596db75fc56fbaae7
MD5 b22b3551c6f3684a3badcd75631ab131
BLAKE2b-256 841481f8d0bfef266897ca67a42efe68d15d3a9fcecfb13da19bbd69539b5c1b

See more details on using hashes here.

Provenance

File details

Details for the file f5py-0.1.6-cp37-none-win_amd64.whl.

File metadata

  • Download URL: f5py-0.1.6-cp37-none-win_amd64.whl
  • Upload date:
  • Size: 725.3 kB
  • Tags: CPython 3.7, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/0.13.7

File hashes

Hashes for f5py-0.1.6-cp37-none-win_amd64.whl
Algorithm Hash digest
SHA256 6837bccccd8d9e36d72b232308bb82fa5af20028f9b96012808cad0bc657742c
MD5 ea29e1b99945a7749eb92047f0293453
BLAKE2b-256 5b47e39f2c21ccb8849dfcb94a15c6b4c81db16d792b320f182aa080c8b67f09

See more details on using hashes here.

Provenance

File details

Details for the file f5py-0.1.6-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for f5py-0.1.6-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 63ed9dfc917e0c325ee0ce2a083a448ee12d35e6687647601523e5aee8513dbb
MD5 a1779aff331b8d36676f9da6cace9993
BLAKE2b-256 1e0c41cf9ae48ebf5abadc03c88d1134a78910552bc0247e55d4d80529dc9714

See more details on using hashes here.

Provenance

Supported by

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