Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

Navigation

Configuring Variable Expressions in Dynamic Profiles

You can create expressions—groups of arithmetic operators, string operators, and operands—for use as variables within dynamic profiles. These expressions are used as variable values to configure dynamic subscriber interfaces.

To configure dynamic profile variable expressions:

  1. Access the dynamic profile for which you want to create variable expressions.
    [edit]user@host# edit dynamic-profiles profile-name
  2. Access the variables hierarchy for the dynamic profile.
    [edit dynamic-profiles profile-name]user@host# edit variables
  3. Define the variable using the expression operators and operands described in Variable Expressions Overview.
    [edit dynamic-profiles profile-name variables]user@host# set expression

Table 1 provides several examples of expressions that you can create using the supported operators and functions.

Table 1: Expression Examples

Example

Description

video-filter equals “’ Filter1’ ”

Assigns the string “ Filter1” to the dynamic $video-filter variable.

video-filter2 equals “$video-filter ## ‘ Filter2’ ”

Converts dynamic variable “$video-filter” to a string and concatenates the new string with the string “ Filter2”. The result is the string “$video-filter Filter2” assigned to the $video-filter2 variable.

tempvar equals “120”

Converts “120” to an integer and assigns the integer to the $tempvar variable.

transmit-rate2 equals “ ( $transmit-rate1 * 2)/3 + $tempvar)”

Multiplies the “transmit-rate1” variable by 2 and divides that value by the sum of 3 and the value of “$tempvar”. The result is assigned to the $transmit-rate2 variable.

host-ip equals “ ’10.0.0.2’ ”

Assigns the string “10.0.02” to the $host-ip variable.

max-val “max($max1,$max2)”

Assigns the greater of value “max1” or “max2” to the $max-val variable.

min-val “$min($var1,30)”

Assign the smaller of value “var1” and “30” to the $min-val variable.

rounded-var equals “round($var1 )”

Rounds off the value of the variable “$var1” to the nearest integer and assigns the value to the $rounded-var variable.

trunc-var equals “trunc(1234.5)”

Truncates the value in parentheses to the left side of the decimal and assigns the resulting value to the $trunc-var variable.

bwg-shaping-rate equals “$ancp-downstream - ($ancp-downstream % 2 * (1 - $sp-qos-cell-mode))”

Evaluates the expression as per the precedence set in the parentheses.

temp-filter1 equals “ ’Filter1’ ## toStr($filter)”

Converts the “$filter” variable to a string value and concatenates the converted string to the string “Filter1”. The resulting combined string is assigned to the $temp-filter1 variable.

Published: 2013-02-11