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. The configugurations can be parsed from supported formats as well Objects manipulation and JSON Output/Parsing are already supported

* to_json()
* to_yaml()
* to_toml()
* to_csv() <<-- Default implementation, works only on simple structs

* from_json()
* from_yaml()
* from_toml()

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.partition()
'Common'

v.destination.name()
'35.156.107.63'

v.destination.port()
443

v.destination.address()
'35.156.107.63'

v.to_toml()
'destination = "/Common/35.156.107.63:443"\nip-protocol = "tcp"\nmask = "255.255.255.255"\nname = "/Common/www.ipvx.me"\npool = "/Common/www.ipvx.me"\nsource = "0.0.0.0/0"\ntranslate_address = "enabled"\ntranslate_port = "enabled"\n\n[[profiles]]\ncontext = "clientside"\nname = "/Common/clientssl"\n\n[[profiles]]\ncontext = "serverside"\nname = "/Common/serverssl"\n\n[[profiles]]\nname = "/Common/http"\n\n[[profiles]]\nname = "/Common/tcp"\n\n[source-address-translation]\ntype = "automap"\n'

x = Virtual.from_toml(v.to_toml())
x
VS: 0x7fffce11e778, name: /Common/www.ipvx.me , destination: /Common/35.156.107.63:443


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__',
 'from_json',
 'from_toml',
 'from_yaml',
 'new_default',
 'partitions',
 'pools',
 'snat_pools',
 'to_dict',
 'to_json',
 'to_toml',
 'to_yaml',
 'try_to_csv',
 '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.2.5-cp312-cp312-macosx_11_0_arm64.whl (1.4 MB view details)

Uploaded CPython 3.12 macOS 11.0+ ARM64

f5py-0.2.5-cp311-none-win_amd64.whl (1.2 MB view details)

Uploaded CPython 3.11 Windows x86-64

f5py-0.2.5-cp311-cp311-manylinux_2_28_x86_64.whl (1.3 MB view details)

Uploaded CPython 3.11 manylinux: glibc 2.28+ x86-64

f5py-0.2.5-cp311-cp311-macosx_11_0_arm64.whl (1.2 MB view details)

Uploaded CPython 3.11 macOS 11.0+ ARM64

f5py-0.2.5-cp311-cp311-macosx_10_7_x86_64.whl (1.3 MB view details)

Uploaded CPython 3.11 macOS 10.7+ x86-64

f5py-0.2.5-cp310-none-win_amd64.whl (1.2 MB view details)

Uploaded CPython 3.10 Windows x86-64

f5py-0.2.5-cp310-cp310-manylinux_2_28_x86_64.whl (1.3 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.28+ x86-64

f5py-0.2.5-cp310-cp310-macosx_11_0_arm64.whl (1.2 MB view details)

Uploaded CPython 3.10 macOS 11.0+ ARM64

f5py-0.2.5-cp310-cp310-macosx_10_7_x86_64.whl (1.3 MB view details)

Uploaded CPython 3.10 macOS 10.7+ x86-64

f5py-0.2.5-cp39-none-win_amd64.whl (1.2 MB view details)

Uploaded CPython 3.9 Windows x86-64

f5py-0.2.5-cp39-cp39-manylinux_2_28_x86_64.whl (1.3 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.28+ x86-64

f5py-0.2.5-cp39-cp39-macosx_11_0_arm64.whl (1.2 MB view details)

Uploaded CPython 3.9 macOS 11.0+ ARM64

f5py-0.2.5-cp39-cp39-macosx_10_7_x86_64.whl (1.3 MB view details)

Uploaded CPython 3.9 macOS 10.7+ x86-64

f5py-0.2.5-cp38-none-win_amd64.whl (1.2 MB view details)

Uploaded CPython 3.8 Windows x86-64

f5py-0.2.5-cp38-cp38-manylinux_2_28_x86_64.whl (1.3 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.28+ x86-64

f5py-0.2.5-cp38-cp38-macosx_11_0_arm64.whl (1.2 MB view details)

Uploaded CPython 3.8 macOS 11.0+ ARM64

f5py-0.2.5-cp38-cp38-macosx_10_7_x86_64.whl (1.3 MB view details)

Uploaded CPython 3.8 macOS 10.7+ x86-64

f5py-0.2.5-cp37-none-win_amd64.whl (1.2 MB view details)

Uploaded CPython 3.7 Windows x86-64

f5py-0.2.5-cp37-cp37m-manylinux_2_28_x86_64.whl (1.3 MB view details)

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

File details

Details for the file f5py-0.2.5-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for f5py-0.2.5-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 016a2c95db398a744a4ed53cec8689524f19f2ddf9798f070b9e59e68302bb54
MD5 1a74a4566c948ecc8460977f36051da3
BLAKE2b-256 2c4c282bcd9fcddc9c4f8c3605c26eb700ef49b87cf62b9200f1ed4b8cd52050

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: f5py-0.2.5-cp311-none-win_amd64.whl
  • Upload date:
  • Size: 1.2 MB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/0.14.13

File hashes

Hashes for f5py-0.2.5-cp311-none-win_amd64.whl
Algorithm Hash digest
SHA256 06a912d9cc72da52e097eb072524706f17c64b6578f7973ae34c425407bcc571
MD5 b536ef43f2d02d67758ad6713f6797f5
BLAKE2b-256 86bb2bdb4738e7c0484e0330864b457d1c01454436ea5f3f748b54d2a16a5867

See more details on using hashes here.

Provenance

File details

Details for the file f5py-0.2.5-cp311-cp311-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for f5py-0.2.5-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 c4b98d197bc1ef3be7f1ebe7a8aeeecb7c39897b3c42b3a0b0bac1c6281905f3
MD5 762eacff61f14f56a2c1feb5d6f23439
BLAKE2b-256 e966ec4d3a49947e0d57cdfab7da67e6ad2dc104fb3e1ed3f986dc4d2cb09366

See more details on using hashes here.

Provenance

File details

Details for the file f5py-0.2.5-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for f5py-0.2.5-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 af4940c53d6531f1a0e956bdccaf2a0070677188a23d72598ba866be88e32619
MD5 d192a583374efeb909e854f8e0c2f9ad
BLAKE2b-256 696140663a1f24d7c885f0d10bbffe94292297aba8b87e1ae6ad29c9f89573c1

See more details on using hashes here.

Provenance

File details

Details for the file f5py-0.2.5-cp311-cp311-macosx_10_7_x86_64.whl.

File metadata

File hashes

Hashes for f5py-0.2.5-cp311-cp311-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 5469f5b7751813cd286131dbf7b932930f1b48bd94504a70de291f33e689688d
MD5 9429042a0176dc5a7dc2c138ba951315
BLAKE2b-256 5f4b91e4d587684302bcd247392e271a7389d39f7d72359160f2a2c0a3b1172e

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: f5py-0.2.5-cp310-none-win_amd64.whl
  • Upload date:
  • Size: 1.2 MB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/0.14.13

File hashes

Hashes for f5py-0.2.5-cp310-none-win_amd64.whl
Algorithm Hash digest
SHA256 e0429ee89c7c5c3306be5287012bef1df37f4782323eab713e01073a1c3f3222
MD5 47768616813c60f7ecc969c2e69141e8
BLAKE2b-256 e9277118d02dd2d2fe11af473b15321b8e4c149f4fed3e0b6d2b6a30099f14db

See more details on using hashes here.

Provenance

File details

Details for the file f5py-0.2.5-cp310-cp310-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for f5py-0.2.5-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 5b3b8ab9a21f6a1624237df48bfae7a6407efacd807eb28a91ff2e380f804bab
MD5 fa9b24f5abc76ae69638caf0f78f9bbd
BLAKE2b-256 3c2604971db58aff03ae3d56d717054ee6831711f08600c90ac362158be9f994

See more details on using hashes here.

Provenance

File details

Details for the file f5py-0.2.5-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for f5py-0.2.5-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9edfa3e84372c918279f97a35e18c43684042f6d5846d4079f63e17fbd1f66e9
MD5 34d798e56161327e5a213a0e00b2fee6
BLAKE2b-256 6e8ad8f11feffd155424c4211721c7da11725b647db78cb07a8fcc044114ccd0

See more details on using hashes here.

Provenance

File details

Details for the file f5py-0.2.5-cp310-cp310-macosx_10_7_x86_64.whl.

File metadata

File hashes

Hashes for f5py-0.2.5-cp310-cp310-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 072ee6c96c42a7b3278c298627c10a4cf6ea401585038c76d353189770f8c6f5
MD5 0740c8f0be1268ea1fe42a3e7010acd4
BLAKE2b-256 c76845067c59bb43c9d8712fa940e38dce75ec87803b716d9c0164002701bd74

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: f5py-0.2.5-cp39-none-win_amd64.whl
  • Upload date:
  • Size: 1.2 MB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/0.14.13

File hashes

Hashes for f5py-0.2.5-cp39-none-win_amd64.whl
Algorithm Hash digest
SHA256 128aba12780f28693835884494fad496a37fadcd6d7b2f6d6d33cb769a7d0b09
MD5 08159f9c3a8f922d2d94344053850539
BLAKE2b-256 19ffafe4535448cb40fe8d61b3e8e481184654a210c270a1cfbc5602894a9cb1

See more details on using hashes here.

Provenance

File details

Details for the file f5py-0.2.5-cp39-cp39-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for f5py-0.2.5-cp39-cp39-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 439716e01c2833f5c2f7c83b956b05306a27bfa83c7d285d5f5d39f45842afe8
MD5 b5c64955c07721e37e7290a22f1da577
BLAKE2b-256 4a90e6cd94c1b86a432602ff8ffd4b72b824fac7382ec4e3d91e27403225536f

See more details on using hashes here.

Provenance

File details

Details for the file f5py-0.2.5-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for f5py-0.2.5-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c1a44ef8794c78c73fc3a93abcdd2e41928a0b3d921a6295556e36efdbeb4b40
MD5 7fa0747371f9154b1cfbf22fd196cd16
BLAKE2b-256 4509a0557c97fca94182f602d44b9ade33b3c64f5371ac0e99ab382460b31ff6

See more details on using hashes here.

Provenance

File details

Details for the file f5py-0.2.5-cp39-cp39-macosx_10_7_x86_64.whl.

File metadata

File hashes

Hashes for f5py-0.2.5-cp39-cp39-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 a49883bc6466f35244a5d23f75a14b2ddcc6fae2aee1694bc686dd5d7ad14d5b
MD5 60ba7061a136805ff7e0fe431b6bd755
BLAKE2b-256 3e45b068f1d7128603eb609eb6bf3f1610b5835867ae9b54e23c0d8fa7718dc8

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: f5py-0.2.5-cp38-none-win_amd64.whl
  • Upload date:
  • Size: 1.2 MB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/0.14.13

File hashes

Hashes for f5py-0.2.5-cp38-none-win_amd64.whl
Algorithm Hash digest
SHA256 165ba569d0fde1a38d7154105d68ef04a58b652f1dc08a59b62dc2b4fa7c3bc4
MD5 3a19dfe06bc7c33bfab4013eebfe1c81
BLAKE2b-256 dd34f9d3b04f72736a4f1a622f1e69935be908e0c291bd512b7a69a2c9828296

See more details on using hashes here.

Provenance

File details

Details for the file f5py-0.2.5-cp38-cp38-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for f5py-0.2.5-cp38-cp38-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 795482d8b3b3eb16d9832ad0c924dd00ee4fc11e725eba3455d72b10c0249535
MD5 9e4eadc707f66a78dd1dbaf3895af876
BLAKE2b-256 04eac5008db764c997e6f316e1cfea09712fb821976247b3b230d41f69e97d8d

See more details on using hashes here.

Provenance

File details

Details for the file f5py-0.2.5-cp38-cp38-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for f5py-0.2.5-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ac93d3152a11986502fedff5efc0329759378e581b5ffa9dc7790e13882c3c05
MD5 9074f2d15d093bdf07f538ec8cedd400
BLAKE2b-256 c59f9fe896d4d424c33705ff63e509c024a0d750e99e87850d6272dce2f46cbb

See more details on using hashes here.

Provenance

File details

Details for the file f5py-0.2.5-cp38-cp38-macosx_10_7_x86_64.whl.

File metadata

File hashes

Hashes for f5py-0.2.5-cp38-cp38-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 477f9b259463f6389478abe2d98d578a5397c21b1ab5c4e6f940b595d4c949d9
MD5 3a71a0dfb686dd26260709560bd36f63
BLAKE2b-256 37d56cc2de255d99286c680298e3dbea9fd1034eb56f045a75b3e35e54577202

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: f5py-0.2.5-cp37-none-win_amd64.whl
  • Upload date:
  • Size: 1.2 MB
  • Tags: CPython 3.7, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/0.14.13

File hashes

Hashes for f5py-0.2.5-cp37-none-win_amd64.whl
Algorithm Hash digest
SHA256 f7b3c9ecc6523ccc00160ee8ff68ee1ba68771a181945a1799b6b471d3fbd33a
MD5 2aac27a6dba9c58c3cf4658052457355
BLAKE2b-256 e798b0e7d4d72f724c8250e7db5a210fbe16a7c99a583a9727cf71a2aae4eec1

See more details on using hashes here.

Provenance

File details

Details for the file f5py-0.2.5-cp37-cp37m-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for f5py-0.2.5-cp37-cp37m-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 b1160155ae0b0c5be8924ccc2f98a02d3d4ec099bae122d3b285546d5b7a933b
MD5 70c0e49fde33e2e09358ce389f26c90e
BLAKE2b-256 118dfadf72a78e40730af011ac3d1da8ced1fc7cb7731fa1025874716db2ab05

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