f5-common-python
f5-common-python copied to clipboard
Add GTM Link submodule
I'm running SDK v3.0.18 with GTM on TMOS v13.1.0.8 I need to access the 'link' submodule but it looks like it hasn't been implemented yet in the SDK:
from f5.bigip import ManagementRoot mgmt = ManagementRoot('172.24.148.47','admin','admin') lin=mgmt.tm.gtm.link Traceback (most recent call last): File "
", line 1, in File "/home/crazyguy/.local/lib/python2.7/site-packages/f5/bigip/mixins.py", line 102, in getattr raise AttributeError(error_message) AttributeError: '<class 'f5.bigip.tm.gtm.Gtm'>' object has no attribute 'link'
I can access the GTM links via REST API:
crazyguy@deb-testing:~$ curl -sk -u admin:admin https://172.24.148.47/mgmt/tm/gtm/link |python -m json.tool { "items": [ { "datacenter": "/Common/Default_DC", "datacenterReference": { "link": "https://localhost/mgmt/tm/gtm/datacenter/~Common~Default_DC?ver=13.1.0.8" }, "duplexBilling": "enabled", "enabled": true, "fullPath": "/Common/test_link", "generation": 112, "kind": "tm:gtm:link:linkstate", <...>
I can't even access the monitor submodule, that should be already implemented (https://f5-sdk.readthedocs.io/en/latest/apidoc/f5.bigip.tm.gtm.html#module-f5.bigip.tm.gtm.monitor) :
mon=mgmt.tm.gtm.monitor Traceback (most recent call last): File "
", line 1, in File "/home/crazyguy/.local/lib/python2.7/site-packages/f5/bigip/mixins.py", line 102, in getattr raise AttributeError(error_message) AttributeError: '<class 'f5.bigip.tm.gtm.Gtm'>' object has no attribute 'monitor'
But maybe I'm missing something here.
@VelvetRope As discussed offline, the first issue with GTM monitors is no longer present, I have tested this on 3.0.19:
>>> from f5.bigip import ManagementRoot
>>> mr = ManagementRoot('10.170.173.177', 'admin', 'admin')
>>> mr.tm.gtm.monitor
<f5.bigip.tm.gtm.monitor.Monitor object at 0x00000000035E3C18>
The second problem is with GTM links, that is not implemented and needs to be done.
Note to self: The GTM link objects need datacenter object configured
@jasonrahm can you work on this one ?