For more information regarding the security incident at F5, the actions we are taking to address it, and our ongoing efforts to protect our customers, click here.

pyControl Add VS to Server on GTM

Problem this snippet solves:

This script adds a Virtual server to a Server on GTM

Code :

import pycontrol.pyControl as pyControl

b = pyControl.BIGIP(hostname   = '10.10.10.10',
                    username   = 'admin',
                    password   = 'admin',
                    wsdl_files = ['GlobalLB.VirtualServer']
                    )

  
d = b.GlobalLB_VirtualServer
###here we add a VS to a server. 

try:
        
        d.create(
                virtual_servers =  [{'address': '10.10.10.100', 'name': 'v_host1', 'port': 80}],

                                    servers = ['test_bigip12'],    
                        )
        print "VS was created  and added to a Server"



except:      print "VS Creation failed. Check log."
Published Mar 09, 2015
Version 1.0
No CommentsBe the first to comment