Home > Configuration > NS > addnsassignment

addnsassignment

Use this method to creates an assignment of a value to a variable. The variable (the left hand side) may be a singleton variable or a map with a key expression. The value (the right hand side) is computed from an expression and may be used to set the variable or may be added to or subtracted from the current value of a ulong variable or appended to a text variable. The key expression, if present, is evaluated before the value expression. The left hand side variable value may also be cleared, in which case there is no value expression.

Syntax



Parameters

name

Name for the assignment. Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) hash (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Can be changed after the assignment is added. The following requirement applies only to the Citrix ADC CLI: If the name includes one or more spaces, enclose the name in double or single quotation marks (for example, "my assignment" or my assignment).
This is mandatory parameter.

variable

Left hand side of the assigment, of the form $variable-name (for a singleton variabled) or $variable-name[key-expression], where key-expression is an expression that evaluates to a text string and provides the key to select a map entry.
This is mandatory parameter.

set

Right hand side of the assignment. The expression is evaluated and assigned to the left hand variable.

add

Right hand side of the assignment. The expression is evaluated and added to the left hand variable.

sub

Right hand side of the assignment. The expression is evaluated and subtracted from the left hand variable.

append

Right hand side of the assignment. The expression is evaluated and appended to the left hand variable.

clear

Clear the variable value. Deallocates a text value, and for a map, the text key.

comment

Comment. Can be used to preserve information about this rewrite action.

Return Value

Returns simpleResult

See Also