cancel
Showing results for 
Search instead for 
Did you mean: 
carldubois_1031
Historic F5 Account

Problem this snippet solves:

In, bigiq-rest-api-device discovery - requests, we provide an example of how to leverage the rest api for BIG-IQ to trust, discover and import modules using python and the requests lib. The example takes advantage of python class inheritance and the requests module python requests.

Because the python requests module is supported with python version 2.7.9 and above, the automation cannot run directly within the BIG-IQ shell. Why you ask, because the distribution of Linux used for the BIG-IQ application of rest framework ships with python 2.4.3.

For simplification the script attached will use httplib client protocol, python httplib, and will provide a good comprehensive example of trust, discover (LTM, AFM, ASM) and import (LTM, AFM, ASM) running directly on BIG-IQ.

How to use this snippet:

  1. Log into BIG-IQ as root.
  2. Create a directory under /shared/. and call it scripts. Or whatever you'd like.
  3. scp discovery.py to root@<bigiq.ip>:/shared/scripts/.
  4. ./discovery.py <bigip.ip> all # trust negotiation, discover (LTM, AFM, ASM), import (LTM, AFM, ASM)
  5. ./discovery.py <bigip.ip> afm # trust negotiation, discover (LTM, AFM), import (LTM, AFM)
  6. ./discovery.py <bigip.ip> asm # trust negotiation, discover (LTM, ASM), import (LTM, ASM)

Code :

https://github.com/carldubois/bigiq-cm-restapi/blob/master/discover.py

Tested this on version:

12.0
Version history
Last update:
‎30-Aug-2016 06:39
Updated by:
Contributors