ADC CLI Commands

ns-assignment

The following operations can be performed on “ns-assignment”:

unset add rename set show rm

unset ns assignment

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

Synopsis

unset ns assignment -comment

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 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.

Synopsis

add ns assignment -variable \[-set | -add | -sub | -append | -clear] \[-comment ]

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

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

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.

Example

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

rename ns assignment

Renames an assignment.

Synopsis

rename ns assignment @ @

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

Example

rename ns assignment oldname newname

set ns assignment

Sets an assignment of a value to a variable.

Synopsis

set ns assignment [-variable ] [-set ] [-add ] [-sub ] [-append ] [-clear] [-comment ]

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

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

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.

Example

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

show ns assignment

Displays configured assignements.

Synopsis

show ns assignment []

Arguments

name Name of the assignment

Output

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

rm ns assignment

Removes a rewrite action.

Synopsis

rm ns assignment

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

Example

rm ns assignment set_user_privilege

ns-assignment