Skip to content

Commit 1c111be

Browse files
authored
Merge pull request #1511 from jbnance/add-token_to_use-support
Issue #1510 - Initial support for ICR's 'token_to_use' feature
2 parents 7dc1288 + e89c39b commit 1c111be

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

docs/userguide/connections.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ You can, however, supply one or more of the following kwargs (defaults listed):
1919
port 443
2020
icontrol_version ''
2121
token False
22+
token_to_use None
2223
verify False
2324
auth_provider None
2425
================ =====
@@ -30,6 +31,13 @@ You can, however, supply one or more of the following kwargs (defaults listed):
3031
>>> from f5.bigip import ManagementRoot
3132
>>> mgmt = ManagementRoot('192.168.1.1.', 'user', 'pass', port=4443, token=True)
3233
34+
.. topic:: Example: Use existing authentication token
35+
36+
.. code-block:: python
37+
38+
>>> from f5.bigip import ManagementRoot
39+
>>> mgmt = ManagementRoot('192.168.1.1', 'user', 'pass', token=True, token_to_use='2PXGGMT4QR3Y3PAQEEURAPB5DJ')
40+
3341
.. topic:: Example: Enable cert verification
3442

3543
.. code-block:: python

f5/bigip/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ def parse_arguments(self, *args, **kwargs):
6464
port=kwargs.pop('port', 443),
6565
icontrol_version=kwargs.pop('icontrol_version', ''),
6666
token=kwargs.pop('token', False),
67+
token_to_use=kwargs.pop('token_to_use', None),
6768
verify=kwargs.pop('verify', False),
6869
auth_provider=kwargs.pop('auth_provider', None),
6970
debug=kwargs.pop('debug', False)
@@ -82,7 +83,8 @@ def _get_icr_session(self, *args, **kwargs):
8283
username=kwargs['username'],
8384
password=kwargs['password'],
8485
timeout=kwargs['timeout'],
85-
verify=kwargs['verify']
86+
verify=kwargs['verify'],
87+
token_to_use=kwargs['token_to_use']
8688
)
8789
if kwargs['auth_provider']:
8890
params['auth_provider'] = kwargs['auth_provider']

0 commit comments

Comments
 (0)