f5-common-python icon indicating copy to clipboard operation
f5-common-python copied to clipboard

Add GTM Link submodule

Open VelvetRope opened this issue 7 years ago • 3 comments

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 avatar Jul 30 '18 10:07 VelvetRope

@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.

wojtek0806 avatar Aug 07 '18 09:08 wojtek0806

Note to self: The GTM link objects need datacenter object configured

wojtek0806 avatar Aug 07 '18 09:08 wojtek0806

@jasonrahm can you work on this one ?

wojtek0806 avatar Aug 07 '18 10:08 wojtek0806