Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 

CLI Configlets Workflow

 

A CLI Configlet can be defined from the CLI Configlets workspace. Table 1 lists the parameters to be defined for a CLI Configlet.

Table 1: Parameters for a CLI Configlet

Parameter

Description

Name

Name of the CLI Configlet. The name cannot exceed 255 characters. Allowable characters include the hyphen (-), underscore (_), letters, and numbers and the period (.). You cannot have two configlets with the same name.

Category

Category of the CLI Configlet. The category cannot exceed 255 characters. Allowable characters include the hyphen (-), underscore (_), letters, and numbers and the period (.).

Device Family Series

Device family series for which the CLI Configlet is applicable.

Context

Context for which the CLI Configlet is applicable. This is an optional field.

Description

Description of the CLI Configlet. The description cannot exceed 2500 characters. This is an optional field.

Preview options

Selecting the Show Parameters option displays the parameters that are present in the CLI Configlet. The Show Configuration option displays the consolidated configuration before the CLI Configlet is applied.

Post-view options

Selecting the Show Parameters option displays the parameters that are present in the CLI Configlet. The Show Configuration option displays the consolidated configuration after the CLI Configlet is applied.

Configlet Content

The actual CLI Configlet is defined here. The CLI Configlet can contain multiple pages and follows a tablike structure. The configuration being applied onto the device can be split among multiple pages. When the configuration is applied, all the pages are combined in order of the page numbers and applied onto the device in a single commit operation. You must always validate the CLI Configlet before moving to the next page.

Reference Number

The range of values are from 1 to 216.

Note

You cannot move to the next page if the contents of the CLI Configlet are invalid. Validation includes bracket matching.

Parameters are variables defined in the CLI Configlet whose values are either retrieved from the environment or entered by the user during execution. When the user applies CLI Configlets, the user is asked to input values for all variables defined in the CLI Configlet.

To configure a parameter, click the modify icon on the toolbar. The Edit Configlet Parameter page is displayed. Use this page to set the attributes of a parameter.

To add an additional parameter, click the add icon on the toolbar. The Add Configlet Parameter page is displayed. The attributes of a parameter are set from this page.

To delete a parameter, click the delete icon on the toolbar. By default, all variables present in the CLI Configlet are listed on the Parameters page. Local variables must be deleted manually or set to the “Invisible” type.

Table 2 lists the attributes of the CLI Configlet parameters.

Table 2: Attributes of CLI Configlet Parameters

CLI Configlet Parameter Attributes

Description

Parameter

Name of the parameter

If displayed with a name space in the <configlet name>.<parameter.name> format, this parameter belongs to the included CLI Configlet.

Display Name

Display name of the parameter

Description

Description of the parameter

Types

The types of parameters supported are:

  • Text field – You can provide a custom value when executing the CLI Configlet. The default value for this field can be configured with an XPath in the Configured Value Xpath field or with a plain string in the Default Value field. This returns a single value.

  • Selection field – You can select a value from a set of options when executing this CLI Configlet. The default value for this field can be configured with an XPath in the Configured Value Xpath field or with a plain string in the Default Value field. The options can be configured by an XPath in the Selection Values Xpath field, or by using a CSV string in the Selection Values field. This returns a single value.

    Note: Though this returns a single value, the return value is of the array type and the selected value can be taken from index 0.

  • Invisible field – You cannot edit this field. This parameter refers to values defined explicitly as a CSV string in the Default Value field or by an XPath in the Configured Value Xpath field. This field returns an array of values.

  • Password field – You need to enter a value when you apply a CLI Configlet containing the parameter. This hides sensitive information in the Apply CLI Configlet job results.

  • Password Confirm field – You need to enter a value twice when you apply a CLI Configlet containing the parameter. This hides sensitive information in the Apply CLI Configlet job results.

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 parameter. When the parameter type is a text field or selection field, the corresponding value present in the XPath is taken as the default value. This value can be modified. If the XPath returns multiple values, the first value returned is considered. When the parameter type is an invisible field, the list of values returned by the XPath is taken as the value of the parameter.

Invisible field has configured value XPath and selection value XPath only when the parameter scope is either device specific or entity specific. This is disabled if the scope is global.

Note: When using $INTERFACE, $UNIT, Configured Value Xpath field, Invisible field, and Selection field, the variable definition in the Configlet Editor should contain .get(0) in order to fetch the value from the array. For example, $INTERFACE.get(0).

Default Value

Displays the same behavior as the Configured Value Xpath field except that the value is given explicitly. This field is considered only when configured value XPath is not specified or if the XPath does not return any value.

Selection Values XPath

This field is enabled only if the parameter type is a Selection field. This field contains the XPath (with reference to the device XML) to fetch the set of values for the Selection field.

Selection Values

This field is the same as the Selection Values XPath field except that the value is given explicitly. This field is considered only when selection values XPath is not specified or if the XPath does not return any value.

Note: Comma-separated values can be used to provide an array of values in the Default Value and Selection Values fields.

Note: While defining the XPath, you must directly access the text node with the text () function. Otherwise the complete XML path of the node is returned. For example, /device/interface-information/physical-interface/name/text() to fetch the names of all interfaces.

Order

Order of the parameter. This is the relative order in which the field must be displayed for user input at the time of execution.

Regex Value

This field contains regular expression for the parameter that is used to validate the parameter value while you apply the CLI Configlet to the device.

Read-only

Whether the parameter belongs to the base configlet or the included configlet:

  • false – This parameter belongs to the base configlet.

  • true – This parameter belongs to the included configlet. The parameter cannot be modified or deleted from this configlet.