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.

pip install f5-icontrol-rest
INSTALL
IMPORT
SIG · F5-ICONTROL-REST
F
f5-icontrol-rest
devopspythonv1.3.13
Install
3.0s avg
Import
—
Disk
20MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.9–3.13
musl
3.9–3.13
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.10–3.910 runs
installs and imports cleanly · install 0.0s · import 0.000s · 22.6MB
glibc
py 3.10–3.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.

iControlRESTSession
✓ from icontrol.session import iControlRESTSession
✗ 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 issues
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.
fix
Evaluate migration to actively developed F5 SDKs (e.g., `f5-sdk` or `bigrest`) for long-term project stability and security. [5, 7, 19]
affects: <=1.3.13
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]
fix
Implement pagination for requests returning large datasets using OData `$skip` and `$top` query parameters in your API calls (e.g., `?%24skip=0&%24top=100`). [5]
affects: All versions
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]
fix
On the BIG-IP device, consider deleting all current tokens (`restcurl -X DELETE /shared/authz/tokens`), increasing management and REST daemon memory, or restarting the `restjavad` service during a maintenance window. [8, 12]
affects: All versions
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]
fix
For versions older than 1.3.13, explicitly pass the `proxies` dictionary to each method call. For 1.3.13 and newer, it can be passed during `iControlRESTSession` instantiation for global proxy configuration.
affects: <1.3.13
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]
fix
Ensure `urllib3` is compatible with the `requests` version installed. If encountering issues, try reinstalling `requests` to pull a compatible `urllib3` version, or explicitly align `urllib3` version with `requests`' requirements.
affects: >=1.3.9
Upgrade
Version history
1.3.13latest on PyPI · released Apr 10, 2019
Audit
Dependencies
requestsrequiredUsed for HTTP session management and underlying REST communication.
Agent activity
23 hits · last 30 days
node
22
OpenAI (training)
1
Resources
f5-icontrol-rest — pip install f5-icontrol-rest · libregistry