User-Defined Variables
Alert: Cisco has made the end-of-life (EOL) announcement for the Cisco Edge Device Manager (EDM).
User-defined variables are used by IoT OD to store values and use during the configuration process. They are similar to predefined Cisco config variables and can include text strings, numbers, IP addresses, URLs, etc. User-defined variables are used to customize the configuration, which would enable users to parameterize config values that could be unique to every device in a particular configuration group. The reason for parameterization in any large scale deployment is that values can differ across devices in a configuration group, and they are not the same for all devices. You can also search for devices based on specific custom variable values in the Inventory.
A Tenant Admin can grant permissions to specific users to access and manage these variables within the EDM UI. These users will also need to be assigned appropriate user role permissions. Once granted privileges, you can create, edit, clone, and delete variables for the organization.
To enable and assign user permissions
Click the (people) icon at the far right of the header and go to Access Control->Roles->Create Custom Role.
Click the (>) symbol beside the Edge Device Manager service. A list of permissions is displayed.
Select Manage User Defined Variables. Click Save.
To assign this permission to the user, go to Access Control->Users.
Use the search function to select the user(s) from the list displayed.
Click More Actions->Edit.
In the Update User dialog, click the drop-down under Select Role to add the new role you assigned and click Save.
Note: By default, the user-defined variable permission is enabled for the Device Operator role.
Variable Parameters
- User-defined variables are used in the configuration of the groups and templates.
- User-defined variables are organization-specific. That means they cannot be shared; they only function in the specific organization and they are not available in the sub-organizations, either.
- User-defined variable names (Field names) must be alphanumeric only. No special characters.
- By default, the list shows 10 records. Use the drop-down menu to change the view to display 10, 25, 50, 100, or 200 variables.
- By default, the Variable Names sort. You can also sort by Display Name(Field name). Use the caret(^) next to each heading to change the sorting.
- Variable Name is mandatory and is used as an identifier in the CLI configuration.
- Display Name is mandatory and is the label that is displayed in the Form View configuration.
To create a User-Defined Variable:
- In the Configuration->User-Defined Variables screen, click Create Variable.
- (Required) Enter a Variable Name to provide an identifier in the CLI configuration (limit 100 characters). The Variable Name is not editable, once it is created and used in a group configuration.
- (Required) Enter a Display Name(Field name) for the label that is displayed in the Form View configuration. It must start and end with an alphanumeric character.
- (Optional) Enter a Description (limit 250 characters)
- Click Yes, it is mandatory.
- (Required) Select the type of Variable Type from the drop-down menu
- Boolean–true or false
- String–alphanumeric text
- Integer–numerals only
- IPv4
If you select anything but Boolean from the Variable Type drop-down menu, the Provide Selectable Options for the Variable can be enabled. Display Order, Option CLI Value, Option Display Name and Actions are displayed.
- Hover over the "i" icons for information about the Option CLI Value and Option Display Name. Fill in the fields. Only alphanumeric characters are allowed.
- Click Create Variable to save your variable configuration.
To edit a user-defined variable
Important: The variable name cannot be edited at anytime.
To edit the variable information, click the variable name. The Edit Variable screen is displayed.
- When the variable is in use, you can only edit the variable's display name and the description.
Note: To check the usage of the variable see To View Variable Usage section below.
- When the variable is not in use, you can edit all the fields on this screen except the variable name and click Save.
To view usage of the variable
This features allows you to view the usage of the user-defined variable in the config group and the eCVD template.
It also provides the last updated time stamp of the group or template.
- Click the three dots under the Action button.
- Click View Usage.
- The View Variable Usage screen is displayed.
Note: For more details on viewing variable usage and its limitations within Legacy and Standard groups, see Using user-defined variables for CLI-based group configuration
Clone a Variable
Clone a variable when you want to create different variables with similar characteristics (or exactly, except for one parameter).
To clone a variable
- Select a variable.
- Click the Action three dots > Clone. The Clone Variable window appears.
- By default, the word "Clone" is appended to the variable name. Type a unique, alphanumeric name. You cannot change the name later.
- Click Clone to create a clone of the variable.
- Make any changes in the Edit Variable window for the Clone.
- Click Save. A success message appears in the bottom right.
You can update the variable name (user-defined variable) or the variable display (Field name) name while cloning. This displays the variable name and the corresponding variable display name.
Delete a Variable
You can delete a variable when you no longer require it.
- Select a variable.
- Click the Action three dots > Delete. Consider the following instances:
- When the user-defined variable is not in use, you are provided with an option to delete and confirm the deletion as shown in the example below:
- When the user-defined variable is in use, you cannot delete the variable. Trying to delete the variable will trigger a pop-up as shown below:
You can click on View Usage tab to view the user-defined variables used in the respective groups or templates.
Click the group or template to view and remove the user-defined variable that is not required.
Click Edit Group. The user-defined variable is displayed.
Select the user-defined variable and press the delete key to remove. Click Save
Filter
Use the Filter funnel icon to search for a variable by a unique string.
To use filter option for a variable
- Click the Filter funnel icon. The search fields display under the parameters.
- Type an allowed text/numeric string in the field you want to filter. Press Enter.
- The list displays all your matches.
Notes:
- For the Last Updated field, use from:(date) to(date) to depict the time period.
Hover on to the info (i) icon beside the Last Updated field to view an example of the filter content format.