TCL Shared Code

f5.app_utils

This covers the contents of the standard TCL include file, f5.app_utils, that is used by the built-in iApp Templates. This file actually contains two types of procedures, those that are meant to be used by the APL code to enhance the UI capabilities in the Presentation section and those meant to be called from the Tcl code in the Implementation section.

Tcl Procs for the APL Presentation Layer

sort_results { results }

Arguments

  • results The list to be sorted

Description

sort_results takes a list of items stored in a string and separated by spaces and sorts them into alphabetical order.

get_items { args }

Arguments

  • args A string containing the TMSH path to the object type to retrieve

Description

get_items returns a list of items found at the TMSH location specified in the args argument. get_items uses the recursive keyword. If the user is not in the folder /Common when get_items is called, then the list returned will contain a combination of the items found in the current folder and also those found in /Common.
Example:
  • get_items / ltm pool Returns the list of pools.

get_items_local_only { args }

Arguments

  • args A string containing the TMSH path to the object type to retrieve

Description

get_items_local_only is just like get_items except that it will not also check /Common when the user is in a different folder.

get_items_not_recursive { args }

Arguments

  • args A string containing the TMSH path to the object type to retrieve

Description

get_items_not_recursive is just like get_items except that it does not use the recursive keyword in the search.

get_items_local_only_not_recursive { args }

Arguments

  • args A string containing the TMSH path to the object type to retrieve

Description

get_items_local_only_not_recursive is just like get_items except that it will not also check /Common when the user is in a different folder and it does not use the recursive keyword in the search.

get_items_filter { field_name field args }

Arguments

  • field_name The name of the field to filter on
  • field The value of the field to match
  • args A string containing the TMSH path to the object type to retrieve

Description

get_items_filter is similar to get_items with the ability to filter the list by a value contained in a particular field.
Example:
  • get_items_filter defaults-from /Common/imap / ltm monitor Returns a list of monitors that contain a defaults-from field set to /Common/imap

get_ltm_monitors_filter { args }

Arguments

  • args a list of monitor types to search for

Description

get_ltm_monitors_filter returns a list of monitors of the types specified.
Example:
  • get_ltm_monitors_filter tcp http https Returns a list of monitors acceptable for either TCP, HTTP, or HTTPS traffic.

get_items_prefix { prefix args }

Arguments

  • prefix The name prefix to filter on.
  • args A string containing the TMSH path to the object type to retrieve

Description

get_items_prefix returns a list of items that all have names that begin with a certain prefix.

get_vlans { }

Arguments

  • None

Description

get_vlans returns the list of VLANs that exist on the BIG-IP.

sort_wa_policy_results { results }

Arguments

  • results The list of WA policies to sort

Description

sort_wa_policy_results is similar to sort_results except that it returns a sorted version of a list separated by \n.

get_custom_wa_policies { }

Arguments

  • None

Description

get_custom_wa_policies returns a list of the custom WebAccelerator policies that exist on the BIG-IP.

get_provisioned { module }

Arguments

  • module The module to check

Description

get_provisioned returns the string provisioned if the module specified is provisioned and not_provisioned otherwise.
Example:
  • get_provisioned ltm Return provisioned is LTM is provisioned and not_provisioned otherwise.

get_platform { }

Arguments

  • None

Description

get_platform returns the platform.

get_is_viprion { }

Arguments

  • None

Description

get_is_viprion returns true if the platform is a Viprion and false otherwise.

get_ssl_keys { }

Arguments

  • None

Description

get_ssl_keys returns the list of SSL keys that exist on the BIG-IP.

get_ssl_certs { }

Arguments

  • None

Description

get_ssl_certs returns the list of SSL certs that exist on the BIG-IP.

Tcl Procs for the TCL Implementation Layer

do_tmsh_create { component arguments }

Arguments

  • component The TMSH path to the object type to create
  • arguments The list of arguments to create that object type, starting with the object name.

Description

do_tmsh_create does a tmsh::create with the inputs and logs the fact that it happened to /var/tmp/scriptd.out along with any error that is generated.

do_tmsh_modify { component arguments }

Arguments

  • component The TMSH path to the object type to create
  • arguments The list of arguments to modify on that object, starting with the object name.

Description

do_tmsh_modify does a tmsh::modify with the inputs and logs the fact that it happened to /var/tmp/scriptd.out along with any error that is generated.

get_compression_content_type_includes { }

Arguments

  • None

Description

get_compression_content_type_includes returns a standard list of compression content type includes separated by \n.

add_compression_content_type_includes { profile_name }

Arguments

  • profile_name The profile to modify

Description

add_compression_content_type_includes modifies the given profile to include the standard list of compression content types.

get_caching_parent_profle { do_configure_wa }

Arguments

  • do_configure_wa Specifies if WebAccelerator will be enabled Legal values are Yes and No

Description

get_caching_parent_profle returns optimized-acceleration if do_configure_wa is set to Yes and optimized-caching otherwise.

is_lb_method_ratio { lb_method }

Arguments

  • lb_method The load balancing method to check

Description

is_lb_method_ratio returns 1 if the lb_method is a ration load balancing method and 0 otherwise.

create_http_comp_accel_profiles { app_name clients_connect_on_lan_or_wan use_cache do_configure_wa wa_app_name ssl_rewrite }

Arguments

  • app_name The prefix to use for the object names
  • clients_connect_on_lan_or_wan Specifies of the client connect over LAN or WAN. Legal values are LAN and WAN.
  • use_cache Specifies if caching should be turned on Legal values are Yes and No
  • do_configure_wa Specifies if WebAccelerator will be turned on Legal values are Yes and No
  • wa_app_name The name of the WA application to use, if WebAccelerator is going to be turned on.
  • ssl_rewrite Specifies if SSL rewriting should be turned on. Legal values are Yes, No, and all

Description

create_http_comp_accel_profiles creates the HTTP, HTTP Compression, and Web Acceleration profiles.

create_one_connect_and_ntlm_profiles { name_prefix create_ntlm_profile using_snat }

Arguments

  • name_prefix The prefix for the object names
  • create_ntlm_profile Specifies if an NTLM profile needs to be created in this case Legal values are Yes and No
  • using_snat Specifies if SNAT is being turned on Legal values are Yes and No

Description

create_one_connect_and_ntlm_profiles create the OneConnect and, optionally, the NTLM profiles.

create_ssl_profile { app_name key cert }

Arguments

  • app_name The prefix to use for the SSL profile name
  • key The SSL key to use
  • cert The SSL cert to use

Description

create_ssl_profile creates an SSL profile using the specified key and cert.

create_https_redirect_irule { app_name }

Arguments

  • app_name The prefix to use for the iRule name

Description

create_https_redirect_irule creates an iRule that redirects traffic from port 80 to port 443 on the same IP address.

create_wa_app { app_name wa_policy_name wa_description hosts }

Arguments

  • app_name The prefix to use for the WA application name
  • wa_policy_name The WA policy to use
  • wa_description The string to use for the description field
  • hosts The list of hosts that the WA application should operate on.

Description

create_wa_app creates a WebAccelerator application.

create_wa_app_new { app_name wa_policy_name wa_description hosts x_wa_info_header perf_monitor data_retention_period }

Arguments

  • app_name The prefix to use for the WA application name
  • wa_policy_name The WA policy to use
  • wa_description The string to use for the description field
  • hosts The list of hosts that the WA application should operate on.
  • x_wa_info_header An info-header to insert
  • perf_monitor A perf-monitor to use
  • data_retention_period The data retention period for that perf monitor

Description

create_wa_app creates a WebAccelerator application with extended options.

is_safe_app_name { app_name }

Arguments

  • app_name The name to check

Description

is_safe_app_name returns true if the app_name contains only legal characters for names of objects on BIG-IP and false otherwise.

create_http_class { app_name asm_predefined_policy_name asm_language_choice wa_enabled }

Arguments

  • app_name The prefix for the HTTPClass name
  • asm_predefined_policy_name the ASM predefined policy to use
  • asm_language_choice the language choice
  • wa_enabled Specifies if WA should be enabled on the HTTPClass This is deprecated and should be set to No

Description

create_http_class creates an HTTPClass for enabling ASM.

create_monitor { app_name monitor_type monitor_interval monitor_send monitor_recv http_version dns_name }

Arguments

  • app_name The prefix for the monitor name
  • monitor_type The monitor type Legal values are http and https
  • monitor_interval How often in seconds the monitor should fire
  • monitor_send The monitor send string
  • monitor_recv The monitor recv string
  • http_version The http version Legal values are Version 1.0 and Version 1.1
  • dns_name The DNS name used to reach the VS, if the version is Version 1.1

Description

create_monitor creates an HTTP or HTTPS monitor

create_pool { app_name monitor_name servers lb_method }

Arguments

  • app_name The prefix to use for the pool name
  • monitor_name The monitor to use on the pool
  • servers The servers to apply to the pool in the form that they are returned by the table used for gathering pool members in the standard form of the iApp templates.
  • lb_method The load balancing method to use

Description

create_pool creates a pool.

create_pool_with_port_override { app_name monitor_name servers lb_method port_number }

Arguments

  • app_name The prefix to use for the pool name
  • monitor_name The monitor to use on the pool
  • servers The servers to apply to the pool in the form that they are returned by the table used for gathering pool members in the standard form of the iApp templates.
  • lb_method The load balancing method to use
  • port_number The alternate port number to use

Description

create_pool creates a pool but uses a different port number than the one specified in the UI.

do_tcp_request_queue_settings { pool_name do_request_queuing queue_depth timeout }

Arguments

  • pool_name The pool to modify
  • do_request_queuing Specifies if request queuing be turned on or off Legal values are Yes and No
  • queue_depth The Queue Depth
  • timeout The timeout value

Description

do_tcp_request_queue_settings modifies the pool to add or remove TCP request queuing settings to or from it.

get_file_contents { filename }

Arguments

  • filename The file to open

Description

get_file_contents returns the contents of a file on the BIG-IP file system.

create_vs { vs_name destination snat pool_name profile_names persist_profile tcp_server_profile_name tcp_client_profile_name }

Arguments

  • vs_name The name to use for the virtual server name
  • destination The IP address and port destination in the form IP:Port
  • snat The SNAT option. Legal values are none, automap, or a list of IP addresses inside a { } to use for the SNAT pool.
  • pool_name The name of the pool to connect to the VS, or $::EMPTY_STRING if no pool is to be used.
  • profile_names A list of profile names contained inside a { } or none
  • persist_profile The persist profile to use
  • tcp_server_profile_name The server-side TCP profile
  • tcp_client_profile_name The client-side TCP profile

Description

Creates a TCP based virtual server

create_http_vs { app_name destination snat pool_name profile_names persist_profile tcp_server_profile_name tcp_client_profile_name }

Arguments

  • vs_name The name to use for the virtual server name
  • destination The IP address and port destination in the form IP:Port
  • snat The SNAT option. Legal values are none, automap, or a list of IP addresses inside a { } to use for the SNAT pool.
  • pool_name The name of the pool to connect to the VS, or $::EMPTY_STRING if no pool is to be used.
  • profile_names A list of profile names contained inside a { } or none
  • persist_profile The persist profile to use
  • tcp_server_profile_name The server-side TCP profile
  • tcp_client_profile_name The client-side TCP profile

Description

create_http_vs appends the string _http to the end of the app_name variable and then calls create_vs.

create_https_vs { app_name destination snat pool_name profile_names persist_profile tcp_server_profile_name tcp_client_profile_name }

Arguments

  • vs_name The name to use for the virtual server name
  • destination The IP address and port destination in the form IP:Port
  • snat The SNAT option. Legal values are none, automap, or a list of IP addresses inside a { } to use for the SNAT pool.
  • pool_name The name of the pool to connect to the VS, or $::EMPTY_STRING if no pool is to be used.
  • profile_names A list of profile names contained inside a { } or none
  • persist_profile The persist profile to use
  • tcp_server_profile_name The server-side TCP profile
  • tcp_client_profile_name The client-side TCP profile

Description

create_http_vs appends the string _https to the end of the app_name variable and then calls create_vs.

The BIG-IP API Reference documentation contains community-contributed content. F5 does not monitor or control community code contributions. We make no guarantees or warranties regarding the available code, and it may contain errors, defects, bugs, inaccuracies, or security vulnerabilities. Your access to and use of any code available in the BIG-IP API reference guides is solely at your own risk.