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'}

print(v.to_yaml())
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.8-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (929.1 kB view details)

Uploaded PyPy manylinux: glibc 2.17+ x86-64

f5py-0.1.8-cp311-none-win_amd64.whl (852.6 kB view details)

Uploaded CPython 3.11 Windows x86-64

f5py-0.1.8-cp310-none-win_amd64.whl (852.6 kB view details)

Uploaded CPython 3.10 Windows x86-64

f5py-0.1.8-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (927.0 kB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

f5py-0.1.8-cp39-none-win_amd64.whl (853.0 kB view details)

Uploaded CPython 3.9 Windows x86-64

f5py-0.1.8-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (927.4 kB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

f5py-0.1.8-cp38-none-win_amd64.whl (852.7 kB view details)

Uploaded CPython 3.8 Windows x86-64

f5py-0.1.8-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (927.4 kB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

f5py-0.1.8-cp37-none-win_amd64.whl (852.7 kB view details)

Uploaded CPython 3.7 Windows x86-64

f5py-0.1.8-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (927.3 kB view details)

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

File details

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

File metadata

File hashes

Hashes for f5py-0.1.8-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b90115aedd0c65380cd4abc9207a0becf5ceeaa2f0cbaa34cf8fb721f34310fc
MD5 8db67e0d8fe77e3172f2e72b1e455d75
BLAKE2b-256 4dd4ecedc77369eab8656b6dd7281684f13dfb855de796dbd0ca95265c7e9481

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: f5py-0.1.8-cp311-none-win_amd64.whl
  • Upload date:
  • Size: 852.6 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.8-cp311-none-win_amd64.whl
Algorithm Hash digest
SHA256 c9c6f794268d853ff24515dc631f09cd86f00b3aee33ca7c178e15b7de8b2d6a
MD5 97ffa705801229dc43d22b4b8e190aab
BLAKE2b-256 b58e79d3590982917da58a6b90f0baf39ac53262478f7c513275162faca0e51e

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: f5py-0.1.8-cp310-none-win_amd64.whl
  • Upload date:
  • Size: 852.6 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.8-cp310-none-win_amd64.whl
Algorithm Hash digest
SHA256 88e6bd01e0bad6c59c34098a9c1ccfb5438dae3bdba33428fc32f77cb4740c45
MD5 f00715a29e5e7aa71c4ae8cbcd066ec9
BLAKE2b-256 8379f1ec78cb47f491c9ddea5e44e5372fdeabde84ddbcbe556439c8330f8185

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for f5py-0.1.8-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b3f494c39a934a11c373be5519496f71dbcf568a4a6446da1f3cb50130c5e3b1
MD5 4b27787093ea3bb674aa95d5e4d86b93
BLAKE2b-256 73835396f2ace846e7fb9b22802e6bfb99770744ba897ce3e545e2f551a49ec2

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: f5py-0.1.8-cp39-none-win_amd64.whl
  • Upload date:
  • Size: 853.0 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.8-cp39-none-win_amd64.whl
Algorithm Hash digest
SHA256 1da7b34df390d07b8c12b26f804a2c58bd29727e6966cc88ad26aff90eb8a6da
MD5 894f4b465fcea9a71a2b3a38a212d993
BLAKE2b-256 a0e7560b2d524eea2764ca4afba2bec33ec9ba1dbb2a2187fd83ed2741d421a1

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for f5py-0.1.8-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 70986fc0b2af9d1f2a7306148b6dac498851d34260b826c8353b02fa196671bc
MD5 611e4f4b6e4fc6fc7236cb3842e6e899
BLAKE2b-256 9d740d40814a0f497edd11e72346f70ab215f6c02fc73b53f634fe8f11994acf

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: f5py-0.1.8-cp38-none-win_amd64.whl
  • Upload date:
  • Size: 852.7 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.8-cp38-none-win_amd64.whl
Algorithm Hash digest
SHA256 e2158b5e61356b32e0b7d70cffd51f18155748930d4586c7dcd0b5c30b17ed46
MD5 17739d17e4a8a81ce30d3d52dace358b
BLAKE2b-256 b2ea6dd1324f2c9fcb98a42fceba0c21e94d6cb90a16c0e53d1a7164b314b49c

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for f5py-0.1.8-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 fb975cf2e2dbf25379b543566c14af493ef8cfa1b558019384dced459f2a0e92
MD5 7a9a612dd93811610372bc887cb71924
BLAKE2b-256 5265206d91f83f6a90fb8ef3d96dff7060996c4a2a89ce55ae48a0c3da3b8976

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: f5py-0.1.8-cp37-none-win_amd64.whl
  • Upload date:
  • Size: 852.7 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.8-cp37-none-win_amd64.whl
Algorithm Hash digest
SHA256 bb9d75ff36dedec467bfe91fbfe2f7b19c6f4b841c0170fb2e1da833db17c9c9
MD5 38ebeca28c682d5aeab0e0b44abc2631
BLAKE2b-256 220df4516b908643b5b3b72e277af305c7c9c52921f38daff99e44f33d5f9959

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for f5py-0.1.8-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b337f55146c6ffd4f36522a89e3d549fd3fa492e0125b04b8f6696c73abf6142
MD5 427d524157cfdef25d2902547acb41fa
BLAKE2b-256 3cb6d0adaeb7233a217c198fe07dc5aa0781977d5b4feadd622f7f08ce5b04c5

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