Registry / devops / f5-icontrol-rest

f5-icontrol-rest

JSON →
library1.3.13pypypiunverified

The `f5-icontrol-rest` Python library simplifies interaction with the F5 BIG-IP iControl REST API. It manages HTTP sessions (leveraging `requests.Session`), handles URI validation, and provides integrated logging. This generic library is used by other F5 SDKs and projects for programmatic communication with BIG-IP and BIG-IQ devices via the REST API. [1, 4, 5, 7] As of version 1.3.13, the project's GitHub repository is archived and no longer maintained.

devopshttp-networking
Install & Compatibility
Where this runs
tested against v1.3.13 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.910 runs
installs and imports cleanly · install 0.0s · import 0.000s · 22.6MB
glibc
py 3.103.910 runs
installs and imports cleanly · install 3.0s · import 0.000s · 23MB
20MB installed
● package 20MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

from icontrol.session import iControlRESTSession

This quickstart demonstrates how to establish a session with an F5 BIG-IP device using `iControlRESTSession` and perform a basic GET request to retrieve LTM NAT objects. Ensure to replace placeholder credentials and host with actual values, preferably using environment variables for security. It disables SSL verification for simplicity, which should be avoided in production environments. [1, 5]

import os from icontrol.session import iControlRESTSession BIGIP_HOST = os.environ.get('F5_BIGIP_HOST', 'your_bigip_ip_or_hostname') BIGIP_USER = os.environ.get('F5_BIGIP_USER', 'admin') BIGIP_PASS = os.environ.get('F5_BIGIP_PASSWORD', 'password') try: # Initialize the session icr_session = iControlRESTSession(BIGIP_USER, BIGIP_PASS, address=BIGIP_HOST) # Example: Get a list of all LTM NAT objects in Common partition # Note: For versions < 1.3.13, 'proxies' kwarg only works on method calls, not instantiation. response = icr_session.get( f'https://{BIGIP_HOST}/mgmt/tm/ltm/nat', name='*', partition='Common', uri_as_parts=True, verify=False # Use with caution in production without proper certs ) print(f"Successfully connected to {BIGIP_HOST}.") print("LTM NAT objects:") for item in response.json().get('items', []): print(f" - Name: {item.get('name')}, Partition: {item.get('partition')}") except Exception as e: print(f"An error occurred: {e}")
Debug
Known footguns
breakingThe `f5-icontrol-rest-python` GitHub repository is archived and explicitly marked as no longer maintained. This means there will be no further feature development, bug fixes, or security updates. Users are advised to consider migrating to actively maintained alternatives like `f5-sdk` or `BIGREST` for ongoing support and new features.
gotchaFetching a large number of objects via iControl REST can result in 'HTTP 500 - Internal Server Error' or 'AsyncContext timeout' on the BIG-IP. This is due to resource limitations on the device. [1, 5, 11]
gotchaIntermittent 'HTTP 400 Bad Request' or '401 Unauthorized' errors can occur during API authentication or subsequent calls. Common causes include insufficient memory on the BIG-IP for management daemons, exhaustion of login tokens, or corrupted REST storage. [8, 12]
gotchaPrior to version 1.3.13, the `proxies` keyword argument was only functional when passed directly to individual HTTP method calls (e.g., `icr_session.get(..., proxies=...)`) and was ignored if provided during the `iControlRESTSession` instantiation. [v1.3.13 release notes from prompt]
gotchaVersion 1.3.9 removed a hard dependency on `urllib3`, instead relying on the version installed by the `requests` library. This change could cause conflicts or unexpected behavior if your environment had a specific `urllib3` version pinned independently of `requests`. [v1.3.9 release notes from prompt]
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
15 hits · last 30 days
gptbot
4
ahrefsbot
4
amazonbot
4
script
1
bytedance
1
Resources