Forum Discussion

Steve_Brown_882's avatar
Steve_Brown_882
Historic F5 Account
Oct 13, 2009

pyControl Creating a Virtual Server

I am looking for a little help using the VirtualServer.create method in pyControl. I have tried a bunch of diffrent ways to pass everything, but I still can't get it right.

I think this is close but not wuite right.

 
 b.LocalLB_VirtualServer.create( 
     definitions = [{'name' : 'my.test.vip.01', 'address' : '10.1.2.3', 'port' : 443, 'protocol' : 'PROTOCOL_TCP'}], 
     wildmasks = ['255.255.255.255'], 
     resources = [{'type' : 'RESOURCE_TYPE_POOL', 'default_pool_name' : 'default_pool_name'}], 
     profiles = [{'profile_context' : 'PROFILE_CONTEXT_TYPE_ALL', 'profile_name' : 'tcp'}] 
 ) 
 
  • Steve_Brown_882's avatar
    Steve_Brown_882
    Historic F5 Account
    Well I figured it out. I guess all it took was posting it to the forums for me to get it right. 😄

     

    Anyway for eanyone who is interested, here is the code that works.

     

     

     
     b.LocalLB_VirtualServer.create( 
     definitions = [{'name' : 'my.test.vip.01', 'address' : '10.1.2.3', 'port' : 443, 'protocol' : 'PROTOCOL_TCP'}], 
     wildmasks = ['255.255.255.255'], 
     resources = [{'type' : 'RESOURCE_TYPE_POOL', 'default_pool_name' : 'mypool'}], 
     profiles = [[{'profile_context' : 'PROFILE_CONTEXT_TYPE_ALL', 'profile_name' : 'tcp'}]] 
     )