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.7-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (797.5 kB view details)

Uploaded PyPy manylinux: glibc 2.17+ x86-64

f5py-0.1.7-cp311-none-win_amd64.whl (724.0 kB view details)

Uploaded CPython 3.11 Windows x86-64

f5py-0.1.7-cp310-none-win_amd64.whl (724.0 kB view details)

Uploaded CPython 3.10 Windows x86-64

f5py-0.1.7-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (795.2 kB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

f5py-0.1.7-cp39-none-win_amd64.whl (724.3 kB view details)

Uploaded CPython 3.9 Windows x86-64

f5py-0.1.7-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (795.5 kB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

f5py-0.1.7-cp38-none-win_amd64.whl (724.8 kB view details)

Uploaded CPython 3.8 Windows x86-64

f5py-0.1.7-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (795.4 kB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

f5py-0.1.7-cp37-none-win_amd64.whl (725.0 kB view details)

Uploaded CPython 3.7 Windows x86-64

f5py-0.1.7-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (795.5 kB view details)

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

File details

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

File metadata

File hashes

Hashes for f5py-0.1.7-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 02d96b350737a37b592f9c279eb4ca5aa6a930f8199170385df836ed3305d0aa
MD5 1e9e1d70d6393086352b4b78c3616b22
BLAKE2b-256 bee2493f39690015f1b3ba733a0a555f3ad716653981dd24ca613ff8736179ac

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: f5py-0.1.7-cp311-none-win_amd64.whl
  • Upload date:
  • Size: 724.0 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.7-cp311-none-win_amd64.whl
Algorithm Hash digest
SHA256 43d39f498963ed05bf65701192e6728937775737da4a4d5dc4a8fb11c62929ec
MD5 995a38c50636e3b6767087d9e3c07a1d
BLAKE2b-256 bff611ecafc294d171d0dd84933878cc1d2b6afd15b5cd91e381e70bd2b27957

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: f5py-0.1.7-cp310-none-win_amd64.whl
  • Upload date:
  • Size: 724.0 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.7-cp310-none-win_amd64.whl
Algorithm Hash digest
SHA256 ee314adb1d0edda8c9d928236287a9321fab24d2d06fd977f093db26b6d2830a
MD5 262d4fce72057012f4bd816f9f5d1085
BLAKE2b-256 f59eff3e9bb86883ba6b71c23184ec50506d9439ec2f2ecfcc935e765ea8233e

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for f5py-0.1.7-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ee2a0681ee9aa9269893acf4d2eaa9deade58c986b4f615c3b8fa6590699f55e
MD5 33e837e468b2c1ca381a68196bd56233
BLAKE2b-256 730abf39a9ffccb54e1c27cbfd97404cd37b05ba2c2443ac886ac2a5ef659ed9

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: f5py-0.1.7-cp39-none-win_amd64.whl
  • Upload date:
  • Size: 724.3 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.7-cp39-none-win_amd64.whl
Algorithm Hash digest
SHA256 7af3a7302a558619b79c89f252cb229692f30277f699205dde3ea7fe25bf89c1
MD5 fd77b57ab12fc5f48a9264a1dffb3b61
BLAKE2b-256 602b389a6e088085097f8bdfbd475887ddf25d4cdc0b549468dd1853d1ca0050

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for f5py-0.1.7-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 5fb7ced7f1301e4249a96c5f8bc93a0a304c381766edc916a5b8accf1ef759a1
MD5 9b822f6a59a7c3ad5661ab7eaff6c7e8
BLAKE2b-256 202179b6c7ef92132cff6ff6ae461c439fe778719afd95241e56018d5d96bea8

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: f5py-0.1.7-cp38-none-win_amd64.whl
  • Upload date:
  • Size: 724.8 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.7-cp38-none-win_amd64.whl
Algorithm Hash digest
SHA256 d402af4e13e8a588bead1475bcabcc79da6bfb6068d7afb34946a6c024f42542
MD5 bfb8b79fc11e9071a2378c86409ba4b2
BLAKE2b-256 f9907f0e6a61a458d920962467d0add4ccc1ff2dd4ac67bd62cfcaf03a097fcd

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for f5py-0.1.7-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d8c57177c62817944120043c22ff829fc029f5a7a6ffd2b68d11c624c9569c0e
MD5 acd41de109e87a2d9688ac6cd18bef55
BLAKE2b-256 2a3eb54df8e0e65ff55b91160ee1ca019a50dd594516d09f9efcf25bbb304c09

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: f5py-0.1.7-cp37-none-win_amd64.whl
  • Upload date:
  • Size: 725.0 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.7-cp37-none-win_amd64.whl
Algorithm Hash digest
SHA256 51e2660ff4ed7c0a7781e3e438f223a0ca24d756fb5af3e777d4dea7e6c6fa1d
MD5 917e26361bdbec79fa86d7f3aab597df
BLAKE2b-256 a021aec021e82e9ce8e55cfce83b1090f8c64e6d6dc6cf048c51f288b69a3fee

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for f5py-0.1.7-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 81c2e5ec579b6165707c383d20b24b3a8c38b5c927a031f40acf044c7b83ce33
MD5 1d53983d4b50609cbd0f9f6f8f874554
BLAKE2b-256 fab9e9ce318acbc4dfbf71d1a03225fb939721164cd3775fb9172394c70132eb

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