Creating a Parameter for a CLI Configlet
From the Manage Configlets page, you can also add parameters to a CLI Configlet. Parameters are the variables defined in the CLI Configlet whose values are either obtained from the environment or given by the user during execution. The following fields are displayed on this page:
Parameter |
Name of the parameter. |
Display Name |
Display name of the parameter. |
Configured Value XPATH |
This field is used to give the XPath of the configured values. The behavior of this field depends on the type of view. When the view type is form, the corresponding value present in the XPath is taken as the field value. In case XPath returns multiple values, first value returned is considered. In case the XPath returns multiple values, the first value returned is considered. When the view type is grid, the following behavior is followed. If more than one parameters defined then following rules should be met.
For non index parameters, if list of values returned then they are aggregated into comma separated values. |
Description |
Description of the parameter. |
Scope |
Scope of the parameter, such as device/entity specific or global. |
Default Value |
Default value of the parameter. The behavior is same as that of Configured value XPath except that the value is given explicitly. This field is considered only when Configured Value XPATH is not specified or if the XPath doesn't return any value. |
From the Manage Configlets page, if you click the Add Parameter button, you are navigated to the Manage Arguments page. The Manage Arguments panel displays a list of arguments for the adding script and a form to manage the properties for them. When you select an argument from the grid, the lower part of the page displays the properties applicable to the selected argument.
To add a parameter to the CLI Configlet:
From the Manage Configlets page, click the Add Parameter button.
The Add Configlet Parameter pop-up window is displayed.
In the Parameter field, enter the name of the parameter.
The name of the parameter cannot exceed 255 characters. Allowable characters include the hyphen (-), underscore (_), letters, numbers, and the period (.).
In the Display Name field, enter a display name for the parameter.
The display name cannot exceed 255 characters. Allowable characters include the hyphen (-), underscore (_), letters, numbers, and the period (.).
In the Description field, enter a description for the parameter.
From the Parameter Scope drop-down list, select an appropriate scope for the parameter.
The options available are Global, Device Specific, and Entity Specific.
From the Parameter Type drop-down list, select an appropriate type of parameter. The options available are:
Text Field – You can enter any value.
Selection Field – You can select a value from a set of options.
Invisible Field – The field displays a value that is explicitly defined by the user or an XPath.
Password Field – Enter a password to apply the CLI Configlet.
Password Confirm Field – Enter the password again to confirm the password.
From the Regex Value drop-down list, select an appropriate regular expression value.
This field is enabled if you choose the type of parameter as Text Field, Password Field, or Confirm Password Field.
From the Configured Value Xpath drop-down list, select an appropriate XPath value.
This field is enabled if you choose the type of parameter as Text Field, Selection Field, or Invisible Field. This is the XPath (with reference to the device XML) to fetch the set of values.
In the Default Value field, enter a default value.
This field is enabled if you choose the type of parameter as Text Field, Selection Field, or Invisible Field. This field is considered only when the XPath is not specified.
From the Selection Values Xpath drop-down list, select an appropriate XPath value.
This field is enabled if you choose the type of parameter as Selection Field. This is the XPath (with reference to the device XML) to fetch the set of values.
In the Selection Values field, enter an appropriate selection value.
This field is enabled if you choose the type of parameter as Selection Field.
In the Order field, enter the order in which the parameters should be listed while applying the CLI Configlet.
Click Add.
(Optional) Add multiple parameters.
(Optional) To discard the changes and go back to the previous page, click Cancel.
You are redirected to the previous page.
Click Save.
The CLI Configlet is created. You are redirected to the Configlets page.