Product Documentation

ns assignment

Sep 12, 2016

The following operations can be performed on "ns assignment":

add | set | unset | rm | show | rename

add ns assignment

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 a default syntax 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.

Synopsys

add ns assignment <name> -variable <expression> [-set <expression> | -add <expression> | -sub <expression> | -append <expression> | -clear] [-comment <string>]

Arguments

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 NetScaler 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?).

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 a default syntax expression that evaluates to a text string and provides the key to select a map entry

set

Right hand side of the assignment. The default syntax expression is evaluated and assigned to theleft hand variable.

add

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

sub

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

append

Right hand side of the assignment. The default syntax 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.

Example

add ns assignment set_user_privilege -var $user_privilege_map[client.ip.src.typecast_text_t]    -set sys.http.callout(get_user_privilege)

set ns assignment

Sets an assignment of a value to a variable.

Synopsys

set ns assignment <name> [-variable <expression>] [-set <expression>] [-add <expression>] [-sub <expression>] [-append <expression>] [-clear] [-comment <string>]

Arguments

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 NetScaler 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?).

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 a default syntax expression that evaluates to a text string and provides the key to select a map entry

set

Right hand side of the assignment. The default syntax expression is evaluated and assigned to theleft hand variable.

add

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

sub

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

append

Right hand side of the assignment. The default syntax 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.

Example

set ns assignment set_user_privilege -var $user_privilege_map[client.ip.src.typecast_text_t]    -set sys.http.callout(get_user_privilege)

unset ns assignment

Use this command to remove ns assignment settings.Refer to the set ns assignment command for meanings of the arguments.

Synopsys

unset ns assignment <name> -comment

rm ns assignment

Removes a rewrite action.

Synopsys

rm ns assignment <name>

Arguments

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 NetScaler 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?).

Example

rm ns assignment set_user_privilege

show ns assignment

Displays configured assignements.

Synopsys

show ns assignment [<name>]

Arguments

name

Name of the assignment

Outputs

stateflag

variable

Left hand side of the assignment.

set

Right hand side of the assignment, variable set to expression value.

add

Right hand side of the assignment, expression value added to variable.

sub

Right hand side of the assignment, expression value subtracted from variable.

append

Right hand side of the assignment, expression value appended to vari able.

clear

Variable cleared.

hits

The number of times the action has been taken.

undefHits

The number of times the action resulted in UNDEF.

referenceCount

The number of references to the action.

comment

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

devno

count

Example

show ns assignment

rename ns assignment

Renames an assignment.

Synopsys

rename ns assignment <name>@ <newName>@

Arguments

name

Existing name of the assignment.

newName

New 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 rewrite policy is added.

The following requirement applies only to the NetScaler 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?).

Example

rename ns assignment oldname newname