Forum Discussion
Local Traffic Policies in an iApp
- Feb 21, 2014
I had to fiddle around with a copy of the iApp to get it working.
I think you were missing a close curly bracket in your multichoice in the presentation section.
I did this with the f5.http template, but it should be similar for any iApp (profiles assignment has to come first if your traffic policy requires any profiles added by the iApp):
virtual server array in implementation array set vs_arr { 1,1 { [iapp::conf create ltm virtual ${app}_vs \ destination [iapp::destination $::pool__addr $::pool__port_secure] \ mask $mask \ $vs_params \ ip-protocol tcp \ mirror $mirror_action \ profiles replace-all-with \{ $vs_profiles \} \ policies replace-all-with \{ $::policies__policies\}] \ \ [iapp::conf create ltm virtual ${app}_redir_vs \ destination [iapp::destination $::pool__addr [expr {[info exists \ ::pool__redirect_port] ? $::pool__redirect_port : 80}]] \ mask $mask \ $redir_vs_params \ ip-protocol tcp \ mirror $mirror_action \ profiles replace-all-with \{ $tcp_profiles http \} \ rules \{ [iapp::substa redirect_irule($::pool__port_secure)] \}]} 1,0 { [iapp::conf create ltm virtual ${app}_vs \ destination [iapp::destination $::pool__addr $::pool__port_secure] \ mask $mask \ $vs_params \ ip-protocol tcp \ mirror $mirror_action \ profiles replace-all-with \{ $vs_profiles \} \ policies replace-all-with \{ $::policies__policies\}] \ } * { [iapp::conf create ltm virtual ${app}_vs \ destination [iapp::destination $::pool__addr $::pool__port] \ mask $mask \ $vs_params \ ip-protocol tcp \ mirror $mirror_action \ profiles replace-all-with \{ $vs_profiles \} \ policies replace-all-with \{ $::policies__policies\}] \ } } policies section in presentation section policies { multichoice policies tcl { set objs [tmsh::get_config ltm policy] foreach obj $objs { append results [tmsh::get_name $obj] append results "\n" } return $results } } questions for policy section in presentation policies "Local Traffic Policies" policies.policies "Select the Local Traffic Policies you like to attach to the BIG- IP Virtual Server:"
I had to fiddle around with a copy of the iApp to get it working.
I think you were missing a close curly bracket in your multichoice in the presentation section.
I did this with the f5.http template, but it should be similar for any iApp (profiles assignment has to come first if your traffic policy requires any profiles added by the iApp):
virtual server array in implementation
array set vs_arr {
1,1 { [iapp::conf create ltm virtual ${app}_vs \
destination [iapp::destination $::pool__addr $::pool__port_secure] \
mask $mask \
$vs_params \
ip-protocol tcp \
mirror $mirror_action \
profiles replace-all-with \{ $vs_profiles \} \
policies replace-all-with \{ $::policies__policies\}] \
\
[iapp::conf create ltm virtual ${app}_redir_vs \
destination [iapp::destination $::pool__addr [expr {[info exists \
::pool__redirect_port] ? $::pool__redirect_port : 80}]] \
mask $mask \
$redir_vs_params \
ip-protocol tcp \
mirror $mirror_action \
profiles replace-all-with \{ $tcp_profiles http \} \
rules \{ [iapp::substa redirect_irule($::pool__port_secure)] \}]}
1,0 { [iapp::conf create ltm virtual ${app}_vs \
destination [iapp::destination $::pool__addr $::pool__port_secure] \
mask $mask \
$vs_params \
ip-protocol tcp \
mirror $mirror_action \
profiles replace-all-with \{ $vs_profiles \} \
policies replace-all-with \{ $::policies__policies\}] \ }
* { [iapp::conf create ltm virtual ${app}_vs \
destination [iapp::destination $::pool__addr $::pool__port] \
mask $mask \
$vs_params \
ip-protocol tcp \
mirror $mirror_action \
profiles replace-all-with \{ $vs_profiles \} \
policies replace-all-with \{ $::policies__policies\}] \ }
}
policies section in presentation
section policies {
multichoice policies
tcl {
set objs [tmsh::get_config ltm policy]
foreach obj $objs {
append results [tmsh::get_name $obj]
append results "\n"
}
return $results
}
}
questions for policy section in presentation
policies "Local Traffic Policies"
policies.policies "Select the Local Traffic Policies you like to attach to the BIG- IP Virtual Server:"
Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com