Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

Navigation
Guide That Contains This Content
[+] Expand All
[-] Collapse All
     

    Related Documentation

     

    Substituting Parameters in Policy Templates

    The SRC software can substitute values for variables in the policy templates. The following variables are supported in the policy templates:

    • Attributes of the ServiceSessionInfo object in the SAE script service API
    • Variables from parameter acquisition
    • Variables defined in the dpiRules parameter that are acquired in the context of a <for-each-rule> element

    Note: If the same variable is defined in both the ServiceSessionInfo interface and parameter acquisition, the value in the ServiceSessionInfo interface is used. However, the value defined in the dpiRules parameter override the other values.

    For information about the ServiceSessionInfo interface, see the script service documentation in the SAE core API documentation on the Juniper Networks website at https://www.juniper.net/techpubs/software/management/src/api-index.html.

    The value of the variable can be used in the policy templates as defined. You can also specify how to use the value of a variable by extracting part of the value from the variable or replacing nonalphanumeric characters in the value with underscores.

    • To extract part of the value from the variable, follow the variable with a tilde (~) and a Java regular expression pattern. The regular expression is matched against the value of the variable, and the value of the last capture group is the result of instantiating the variable expression. For more information about using regular expressions, see http://java.sun.com/javase/6/docs/api/java/util/regex/Pattern.html.

      For example: [[[ variable~[^.]+\.(\d+) ]]]

      If we replace variable with interfaceName and the value of interfaceName is ge-1/2/3.4, then this expression would evaluate to 4.

    • To replace all nonalphanumeric characters in the value with underscores, follow the variable with an underscore (_).

      For example: [[[ variable_ ]]]

      If we replace variable with interfaceName and the value of interfaceName is ge-1/2/3.4, then this expression would evaluate to ge_1_2_3_4.

    Note: You can use the underscore and the tilde expressions together, but the underscore must precede the tilde in the expression.

     

    Related Documentation

     

    Modified: 2015-06-21