Creating a CLI Configlet
You create a CLI Configlet to push a configuration to devices. 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.
You must create Configlets and the parameters for a CLI Configlet using the Configlets workspace of the Junos Space Network Management Platform GUI, before you can apply the created Configlets to devices and deploy Configlets using the Connectivity Services Director GUI.
To create a CLI Configlet:
- On the Junos Space Network Management Platform user interface,
select CLI Configlets > Configlets.
The Configlets page is displayed.
- Click the Create CLI Configet icon on the toolbar.
The Create CLI Configlet page is displayed.
- In the Name field, enter a name for the CLI
Configlet.
The name cannot exceed 255 characters. Allowable characters include the hyphen (-), underscore (_), letters, numbers, and the period (.). You cannot have two CLI Configlets with the same name.
- In the Category field, enter a name for the
category of the CLI Configlet.
The name of the category cannot exceed 255 characters. Allowable characters include the hyphen (-), underscore (_), letters, numbers, and the period (.).
- From the Device Family Series drop-down list, select the device family for the CLI Configlet.
- (Optional) From the Context drop-down list, select the appropriate context for the CLI Configlet.
- In the Reference Number field, enter a reference
number for the CLI Configlet.
The default value is 1. The maximum value is 216.
- (Optional) In the Description field, enter
a description.
The description cannot exceed 2500 characters.
- For Execution Type, select the type of execution. The
option buttons available are Single Execution and Grouped Execution.
By default, the Single Execution option button is selected.
If you select Single Execution, you can apply the CLI Configlet only to one device at a time.
If you select Grouped Execution, you can apply the CLI Configlet to multiple devices at a time.
- For Preview options , clear the check boxes if you do
not want to view the parameters and the configuration in the CLI Configlet
after downloading it.
The check boxes available are Show Parameters and Show Configuration. By default, both check boxes are selected.
- For Postview options, clear the check boxes if you do
not want to view the parameters and the configuration in the CLI Configlet
before creating it.
The check boxes available are Show Parameters and Show Configuration. By default, both check boxes are selected.
- In the Configlet Editor area, enter the configuration
for the CLI Configlet. You can type or manually paste the configuration
in the Configlet Editor.Note:
You cannot create a CLI Configlet if you do not enter the configuration in the Configlet Editor.
Note:You can also create a CLI Configlet to erase specific configuration from the devices. To do so, include the
delete:
statement above the hierarchy level that should be deleted from the devices. When you apply the CLI Configlet to a device, the physical interface of a device, the logical interface of a device, or the physical inventory element of a device, the configuration in the hierarchy level is erased on the device.For more information about the protocol and syntax used for creating, modifying, and deleting the configuration by using CLI Configlets, see the Junos XML Management Protocol Guide.
Note:When you define a configuration of the CLI Configlet, you should specify variables that accept special characters as input within double quotation marks.
- Click Next.
You can add the parameters for the CLI Configlet on this page.
- To add a parameter to the CLI Configlet:
Click the Add Parameter icon.
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 go back to the previous page, click Back.
You are redirected to the previous page.
- Click Create.
The CLI Configlet is created. You are redirected to the Configlets page.