F5 is upgrading its customer support chat feature on My.F5.com. Chat support will be unavailable from 6am-10am PST on 1/20/26. Refer to K000159584 for details.

Forum Discussion

tbledsoe_90582's avatar
tbledsoe_90582
Icon for Nimbostratus rankNimbostratus
Aug 14, 2013

Convert tmsh create ltm virtual to icontrol in python/big-suds

Trying to convert tmsh, "create ltm virtual SERVER_80 { destination 172.17.111.71:80 ip-protocol tcp mask 255.255.255.255 http-class { HTTPS_REDIRECT } profiles add { tcp {} http {} }}" to the equivalent in python/big-suds icontrol.

 

It looks like a couple steps in icontrol:

 

1.) locallb_virtualserver_create(auth, vs_def, wildmasks, vs_resources, vs_profiles) with:

 

vs_def = [{'port': '80', 'protocol': 'PROTOCOL_TCP', 'name': 'SERVER_80', 'address': '172.17.111.71'}] wildmasks = ['255.255.255.255'] vs_resources = [{'type': 'RESOURCE_TYPE_POOL', 'default_pool_name': ''}] vs_profiles = [[{'profile_name': '/Common/fastL4', 'profile_context': 'PROFILE_CONTEXT_TYPE_ALL'}]]

 

In "vs_profiles" I'd like to use the, "Standard" profile instead of, "fastL4" but can't figure out how to make the replacement.

 

2.) Add, "http" and "tcp" profiles with: obj_auth.LocalLB.VirtualServer.add_profile(['SERVER_80'], profile_names)

 

profile_names = [[{'profile_name': '/Common/http', 'profile_context': 'PROFILE_CONTEXT_TYPE_ALL'},{'profile_name': '/Common/tcp', 'profile_context': 'PROFILE_CONTEXT_TYPE_ALL'}]]

 

3.) Add http_class with: \auth.LocalLB.VirtualServer.add_httpclass_profile(['SERVER_80'], vs_http_class)

 

vs_http_class = [[{'priority': 0, 'profile_name': '/Common/HTTPS_REDIRECT'}]]

 

Can this be made to work or is there a shorter path. Not being able to use, "/Common/Standard" in step 1 for the profile name seems to be blocking further progress. Am I on track or is there an easier way to do this?

 

3 Replies

  • Regarding 1, that is is set in resources and the type you need is RESOURCE_TYPE_POOL

     

    Regarding 2, it looks like that parameter needs another option of profile_type:

     

    v.get_profile(vs) [[{'profile_name': '/Common/http', 'profile_context': 'PROFILE_CONTEXT_TYPE_ALL', 'profile_type': 'PROFILE_TYPE_HTTP'}, {'profile_name': '/Common/tcp', 'profile_context': 'PROFILE_CONTEXT_TYPE_ALL', 'profile_type': 'PROFILE_TYPE_TCP'}]]

     

    This can all be bundled into the create method, but you can break it up into the add methods as well.

     

  • I know this is late but look here this may help. However i was looking for the same info.

     

    https://devcentral.f5.com/wiki/iControl.LocalLB__ProfileType.ashx

     

    ccna55