CodeShare
Have some code. Share some code.
cancel
Showing results for 
Search instead for 
Did you mean: 
Custom Alert Banner
JackofallTrades
Historic F5 Account

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."
Version history
Last update:
‎09-Mar-2015 12:20
Updated by:
Contributors