Templates

Templates

UI Navigation

  • Choose Operations > Templates.

You can add, edit, or delete templates that are configured across different Cisco Nexus, IOS-XE, IOS-XR, and Cisco MDS platforms using Cisco Nexus Dashboard Fabric Controller Web client. The following parameters are displayed for each template that is configured on Cisco Nexus Dashboard Fabric Controller Web client. Templates support JavaScript. You can use the JavaScript function in a template to perform arithmetic operations and string manipulations in the template syntax.

Table 1. Template Table Fields and Description
Field Description

Name

Specifies the template name.

Supported Platforms

Specifies the platforms that the template support.

Type

Specifies the template type.

Sub Type

Specifies the template sub type.

Modified

Specifies the date and time of the template modification.

Tags

Specifies if the template is tagged to a fabric or a device.

Description

Specifies the template description.

Reference Count

Specifies the number of times a template is used.

Click the table header to sort the entries in alphabetical order of that parameter.


Note

Templates with errors are not listed in the Templates window. You cannot import templates with errors. To import such templates, fix the errors, and import them.


The following table describes the action items, in the Actions drop-down list, that appears in the Templates window.

Table 2. Templates Actions and Description
Actions Description

Create new template

Allows you to create a new template. For more information, see Creating a New Template.

Edit template properties

Allows you to edit the template properties. You can edit only one template at a time. For more information, see Editing a Template.

Edit template content

Allows you to edit the template content. You can edit only one template at a time. For more information, see Editing a Template.

Duplicate template

Allows you to duplicate the selected template with a different name. You can edit the template as required. You can duplicate only one template at a time.

To duplicate a template, select the check box next to the template that you want to duplicate and choose Duplicate template. The Duplicate Template window appears. Specify a name for the duplicated template. For more information about editing the duplicated template, see Editing a Template.

Delete template

Allows you to delete a template. You can delete more than one template in a single instance.

You can delete the user-defined templates. However, you cannot delete the predefined templates

To delete a template, select the check box next to the template that you want to delete and choose Delete template. A warning message appears. If you are sure you want to delete the template, click Confirm. If not, click Cancel. If the template is in use or is a shipping template, you cannot delete it, and an error message appears.

Note 

Select multiple templates to delete them at the same instance.

To delete the template permanently, delete the template that is located in your local directory: Cisco Systems\dcn\ndfc\data\templates\.

Import

Allows you to import a template from your local directory, one at a time. For more information, see Importing a Template.

Import as Zip

Allows you to import .zip file, that contains more than one template that is bundled in a .zip format

All the templates in the ZIP file are extracted and listed in the table as individual templates.

For more information, see Importing a Template.

Export

Allows you to export the template configuration to a local directory location. You can export only one template at a time.

To export a template, use the check box next to it to select it and choose Export. Select a location on your local system directory to store the template file. Click Save. The template file is exported to your local directory.

You can only view templates with the network-operator role. You cannot create, edit, or save templates with this role. However, you can create or edit templates with the network-stager role.

This section contains the following:

Creating a New Template

Nexus Dashboard Fabric Controller UI Navigation

  • Choose Operations > Templates.

To create user-defined templates and schedule jobs from the Cisco Nexus Dashboard Fabric Controller Web UI, perform the following steps:

Procedure


Step 1

In the Templates window, from the Actions drop-down list, choose Create new template.

The Create Template window appears.

Step 2

In the Template Properties page of the window, specify a template name, description, tags, and choose supported platforms for the new template. Next, choose a template type and a sub template type from the drop-down lists. Choose a content type for the template from the drop-down list.

Note 

The base templates are CLI templates.

Step 3

Click Next to continue editing the template or click Cancel to discard the changes.

The edited template properties are displayed in the Template Content page of the Edit Template window. For information about the structure of the Configuration Template, see the Template Structure section.

Step 4

Click Validate to validate the template syntax.

Note 

You can continue to save the template if there are warnings only. However, if there is an error, you must edit the templates to fix the errors before you proceed. Click the line number under the Start Line column to locate the error in the template content. You will get an error if you validate a template that does not have a template name.

Step 5

Click Help to open the Editor Help pane on the right.

This window contains more information about the format, variables, content and data types used to build the template. Close the Editor Help pane.

Step 6

Click Errors and Warnings if the links are displayed. If there are no errors or warnings, the links are not available. If errors or warnings are present, and you click the links, the Errors & Warnings pane appears on the right displaying the errors and warnings. Close the Errors & Warnings pane.

Step 7

To build the template content, select the required theme, key binding, and font size from the drop-down list.

Step 8

Click Finish to complete editing of the template, click Cancel to discard the changes, click Previous to go to the Template Properties page.

The page with the message that the template was created appears. The page also displays the template name, type, and sub type, and the platforms. You can also click Create another template to create one more template or click Edit <template name> template to edit the template that was just edited.

Step 9

Close the Edit Template window or Click Back to template library to go back to the Templates window.


Editing a Template

Nexus Dashboard Fabric Controller UI Navigation

  • Choose Operations > Templates.

You can edit the user-defined templates. However, the predefined templates and templates that are already published cannot be edited.

Use the Edit Template window to first edit the template properties and then edit the template content. Furthermore, you can edit either only the template properties using the Edit template properties action or only the template content using the Edit template content action. In other words, you can edit the template properties at one instance, and then, edit the template content at another instance. You can also use this window to view the template properties and content.

Perform the following steps to edit the template properties and then edit the template content:

Procedure


Step 1

In the Templates window, select a template. From the Actions drop-down list, choose Edit template properties.

The Edit Template window appears.

Step 2

In the Template Properties page of the window displays the name of the template along with its description, supported platforms, tags, and content type. You can edit the template description and tags. To edit the supported platforms, clear the selected check boxes to select other switches. Next, choose a template type and a sub template type from the drop-down lists.

Step 3

Click Next to continue editing the template or click Cancel to discard the changes.

The edited template properties are displayed in the Template Content page of the Edit Template window.

Step 4

Click Validate to validate the template syntax.

Note 

You can continue to save the template if there are warnings only. However, if there is an error, you must edit the templates to fix the errors before you proceed. Click the line number under the Start Line column to locate the error in the template content. You will get an error if you validate a template that does not have a template name.

Step 5

Click Help to open the Editor Help pane on the right.

This window contains more information about the format, variables, content and data types used to build the template. Close the Editor Help pane.

Step 6

Click Errors and Warnings if the links are displayed. If there are no errors or warnings, the links are not available. If errors or warnings are present, and you click the links, the Errors & Warnings pane appears on the right displaying the errors and warnings. Close the Errors & Warnings pane.

Step 7

To build the template content, select the required theme, key binding, and font size from the drop-down list.

Step 8

Click Finish to complete editing of the template, click Cancel to discard the changes, click Previous to go to the Template Properties page.

The page with the message that the template is saved appears. The page also displays the template name, type, and sub type, and the platforms. You can also click Create another template to create one more template or click Edit <template name> template to edit the template that was just edited.

Step 9

Close the Edit Template window or Click Back to template library to go back to the Templates window.


Importing a Template

Nexus Dashboard Fabric Controller UI Navigation

  • Choose Operations > Templates.

Follow the same procedure while importing zipped templates.


Note

The “\n” in the template is considered as a new line character when imported and edited, but it works fine when imported as a ZIP file.


To import a template from the Cisco Nexus Dashboard Fabric Controller Web UI, perform the following steps:

Procedure


Step 1

In the Templates window, from the Actions drop-down list, choose Import template.

The Import Template window appears.

Step 2

Browse and select the template that is saved on your computer.

Step 3

Click OK to import the template or click Cancel to discard the template.

Note 

After importing a zipped template file, either a successful or error message appears. Click OK.

Step 4

You can edit the template parameters and content, if necessary. For more information, see Editing a Template.

Note 

When importing a zipped template file, the Edit Template window may not appear. However, you can edit the template parameters and content, if necessary, using the Edit Template action.

Step 5

If you do not want to edit the template properties or content, then keep clicking Next, then Finish and Back to template library to go back to the Templates window.


Template Structure

The configuration template content mainly consists of four parts. Click the Help icon next to the Template Content for information about editing the content of the template.

This section contains the following:

Template Format

This section describes the basic information of the template. The possible fields are as detailed in the table below.

Property Name

Description

Valid Values

Optional?

name

The name of the template

Text

No

description

Brief description about the template

Text

Yes

userDefined

Indicates whether the user created the template. Value is ‘true’ if user created.

“true” or “false”

Yes

supportedPlatforms

List of device platforms supports this configuration template. Specify ‘All’ to support all platforms.

N1K, N3K, N3500, N4K, N5K, N5500, N5600, N6K, N7K, N9K, MDS, VDC, N9K-9000v, IOS-XE, IOS-XR, Others, All Nexus Switches list separated by comma.

No

templateType

Specifies the type of Template used.

  • CLI

  • POAP

    Note 

    POAP option is not applicable for Cisco Nexus Dashboard Fabric Controller LAN Fabric deployment.

  • POLICY

  • SHOW

  • PROFILE

  • FABRIC

  • ABSTRACT

  • REPORT

Yes

templateSubType

Specifies the sub type associated with the template.

  • CLI

    • N/A

  • POAP

    • N/A

    • VXLAN

    • FABRICPATH

    • VLAN

    • PMN

    Note 

    POAP option is not applicable for Cisco Nexus Dashboard Fabric Controller LAN Fabric deployment.

  • POLICY

    • VLAN

    • INTERFACE_VLAN

    • INTERFACE_VPC

    • INTERFACE_ETHERNET

    • INTERFACE_BD

    • INTERFACE_PORT_CHANNEL

    • INTERFACE_FC

    • INTERFACE_MGMT

    • INTERFACE_LOOPBACK

    • INTERFACE_NVE

    • INTERFACE_VFC

    • INTERFACE_SAN_PORT_CHANNEL

    • DEVICE

    • FEX

    • INTRA_FABRIC_LINK

    • INTER_FABRIC_LINK

    • INTERFACE

  • SHOW

    • VLAN

    • INTERFACE_VLAN

    • INTERFACE_VPC

    • INTERFACE_ETHERNET

    • INTERFACE_BD

    • INTERFACE_PORT_CHANNEL

    • INTERFACE_FC

    • INTERFACE_MGMT

    • INTERFACE_LOOPBACK

    • INTERFACE_NVE

    • INTERFACE_VFC

    • INTERFACE_SAN_PORT_CHANNEL

    • DEVICE

    • FEX

    • INTRA_FABRIC_LINK

    • INTER_FABRIC_LINK

    • INTERFACE

  • PROFILE

    • VXLAN

  • FABRIC

    • NA

  • ABSTRACT

    • VLAN

    • INTERFACE_VLAN

    • INTERFACE_VPC

    • INTERFACE_ETHERNET

    • INTERFACE_BD

    • INTERFACE_PORT_CHANNEL

    • INTERFACE_FC

    • INTERFACE_MGMT

    • INTERFACE_LOOPBACK

    • INTERFACE_NVE

    • INTERFACE_VFC

    • INTERFACE_SAN_PORT_CHANNEL

    • DEVICE

    • FEX

    • INTRA_FABRIC_LINK

    • INTER_FABRIC_LINK

    • INTERFACE

  • REPORT

    • UPGRADE

    • GENERIC

contentType

  • CLI

    • TEMPLATE_CLI

  • POAP

    • TEMPLATE_CLI

    Note 

    POAP option is not applicable for Cisco Nexus Dashboard Fabric Controller LAN Fabric deployment.

  • POLICY

    • TEMPLATE_CLI

    • PYTHON

  • SHOW

    • TEMPLATE_CLI

  • PROFILE

    • TEMPLATE_CLI

    • PYTHON

  • FABRIC

    • PYTHON

  • ABSTRACT

    • TEMPLATE_CLI

    • PYTHON

  • REPORT

    • PYTHON

Yes

implements

Used to implement the abstract template.

Text

Yes

dependencies

Used to select the specific feature of a switch.

Text

Yes

published

Used to Mark the template as read only and avoids changes to it.

“true” or “false”

Yes

Template Variables

This section contains declared variables, the data type, default values, and valid values conditions for the parameters that are used in the template. These declared variables are used for value substitution in the template content section during the dynamic command generation process. Also these variables are used in decision making and in iteration blocks in the template content section. Variables have predefined data types. You can also add a description about the variable. The following table describes the syntax and usage for the available datatypes.

Variable Type

Valid Value

Iterative?

boolean

true|false

No

enum


Example: running-config, startup-config

No

float

Floating number format

No

floatRange


Example: 10.1,50.01

Yes

Integer

Any number

No

integerRange

Contiguous numbers separated by “-“

Discrete numbers separated by “,”


Example: 1-10,15,18,20

Yes

interface

Format: <if type><slot>[/<sub slot>]/<port>


Example: eth1/1, fa10/1/2 etc.

No

interfaceRange


Example: eth10/1/20-25, eth11/1-5

Yes

ipAddress

IPv4 OR IPv6 address

No

ipAddressList

You can have a list of IPv4, IPv6, or a combination of both types of addresses.

Example 1: 172.22.31.97,
           172.22.31.99,
           172.22.31.105,
           172.22.31.109
Example 2: 2001:0db8:85a3:0000:0000:8a2e:0370:7334, 
           2001:0db8:85a3:0000:0000:8a2e:0370:7335,
           2001:0db8:85a3:1230:0000:8a2f:0370:7334
Example 3: 172.22.31.97, 172.22.31.99,
           2001:0db8:85a3:0000:0000:8a2e:0370:7334, 
           172.22.31.254

Yes

ipAddressWithoutPrefix

Example: 192.168.1.1

or

Example: 1:2:3:4:5:6:7:8

No

ipV4Address

IPv4 address

No

ipV4AddressWithSubnet

Example: 192.168.1.1/24

No

ipV6Address

IPv6 address

No

ipV6AddressWithPrefix

Example: 1:2:3:4:5:6:7:8 
22 

No

ipV6AddressWithSubnet

IPv6 Address with Subnet

No

ISISNetAddress

Example: 49.0001.00a0.c96b.c490.00

No

long

Example: 100

No

macAddress

14 or 17 character length MAC address format

No

string

Free text, for example, used for the description of a variable


Example:
string scheduledTime
{
    regularExpr=^([01]\d|2[0-3]):([0-5]\d)$;
}

No

string[]


Example: {a,b,c,str1,str2}

Yes

struct

Set of parameters that are bundled under a single variable.


struct <structure name declaration > {
<parameter type> <parameter 1>;
<parameter type> <parameter 2>;
…..
} [<structure_inst1>] [, <structure_inst2>] [, <structure_array_inst3 []>];


struct interface_detail {
	string inf_name;
	string inf_description;
	ipAddress inf_host;
	enum duplex {
		validValues = auto, full, half;
	};
 }myInterface, myInterfaceArray[];

No

Note 

If the struct variable is declared as an array, the variable is iterative.

wwn

(Available only in Cisco Nexus Dashboard Fabric Controller Web Client)


Example: 20:01:00:08:02:11:05:03

No

Variable Meta Property

Each variable that is defined in the template variable section has a set of meta properties. The meta properties are mainly the validation rules that are defined for the variable.

The following table describes the various meta properties applicable for the available variable types.

Variable Type

Description

Variable Meta Property

default Value

valid Values

decimal Length

min

max

min Slot

max Slot

min Port

max Port

min Length

max Length

regular Expr

boolean

A boolean value.

Example: true

Yes

enum

Yes

float

signed real number.

Example: 75.56, -8.5

Yes

Yes

Yes

Yes

Yes

floatRange

range of signed real numbers

Example: 50.5 - 54.75

Yes

Yes

Yes

Yes

Yes

integer

signed number

Example: 50, -75

Yes

Yes

Yes

Yes

integerRange

Range of signed numbers

Example: 50-65

Yes

Yes

Yes

Yes

interface

specifies interface/port

Example: Ethernet 5/10

Yes

Yes

Yes

Yes

Yes

Yes

interfaceRange

Yes

Yes

Yes

Yes

Yes

Yes

ipAddress

IP address in IPv4 or IPv6 format

Yes

ipAddressList

You can have a list of IPv4, IPv6, or a combination of both types of addresses.
Example 1: 172.22.31.97, 172.22.31.99, 172.22.31.105, 172.22.31.109
Example 2: 2001:0db8:85a3:0000:0000:8a2e:0370:7334, 2001:0db8:85a3:0000:0000:8a2e:0370:7335, 
2001:0db8:85a3:1230:0000:8a2f:0370:7334
Example 3: 172.22.31.97, 172.22.31.99, 2001:0db8:85a3:0000:0000:8a2e:0370:7334, 172.22.31.254
Note 

Separate the addresses in the list using commas and not hyphens.

Yes

ipAddressWithoutPrefix

IPv4 or IPv6 Address (does not require prefix/subnet).

ipV4Address

IPv4 address

Yes

ipV4AddressWithSubnet

IPv4 Address with Subnet

Yes

ipV6Address

IPv6 address

Yes

ipV6AddressWithPrefix

IPv6 Address with prefix

Yes

ipV6AddressWithSubnet

IPv6 Address with Subnet

Yes

ISISNetAddress

Example: 49.0001.00a0.c96b.c490.00

long

Example: 100

Yes

Yes

Yes

macAddress

MAC address

string

literal string

Example for string Regular expression:
string scheduledTime
{
    regularExpr=^([01]\d|2[0-3]):([0-5]\d)$;
}

Yes

Yes

Yes

Yes

string[]

string literals that are separated by a comma (,)

Example: {string1, string2}

Yes

struct

Set of parameters that are bundled under a single variable.

struct <structure name declaration > {
<parameter type> <parameter 1>;
<parameter type> <parameter 2>;
…..
} [<structure_inst1>] [, <structure_inst2>] [, <structure_array_inst3 []>];

wwn

WWN address

Example: Meta Property Usage

##template variables

integer VLAN_ID {
min = 100;
max= 200;
};

string USER_NAME {
defaultValue = admin123;
minLength = 5;
};

struct interface_a{
	string inf_name;
	string inf_description;
	ipAddress inf_host;
	enum duplex {
		validValues = auto, full, half;
	};
}myInterface;

##

Variable Annotation

You can configure the variable properties marking the variables using annotations.


Note

Variable Annotations are available for POAP only. However, the annotations do not impact on the template type ‘CLI’.

The following annotations can be used in the template variable section.

Annotation Key

Valid Values

Description

AutoPopulate

Text

Copies values from one field to another

DataDepend

Text

Description

Text

Description of the field appearing in the window

DisplayName

Text

Note 
Enclose the text with quotes, if there is space.

Display name of the field appearing in the window

Enum

Text1, Text2, Text3, and so on

Lists the text or numeric values to select from

IsAlphaNumeric

“true” or “false”

Validates if the string is alphanumeric

IsAsn

“true” or “false”

IsDestinationDevice

“true” or “false”

IsDestinationFabric

“true” or “false”

IsDestinationInterface

“true” or “false”

IsDestinationSwitchName

“true” or “false”

IsDeviceID

“true” or “false”

IsDot1qId

“true” or “false”

IsFEXID

“true” or “false”

IsGateway

“true” or “false”

Validates if the IP address is a gateway

IsInternal

“true” or “false”

Makes the fields internal and does not display them on the window

Note 

Use this annotation only for the ipAddress variable.

IsManagementIP

“true” or “false”

Note 
This annotation must be marked only for variable “ipAddress”.

IsMandatory

“true” or “false”

Validates if a value should be passed to the field mandatorily

IsMTU

“true” or “false”

IsMultiCastGroupAddress

“true” or “false”

IsMultiLineString

“true” or “false”

Converts a string field to multiline string text area

IsMultiplicity

“true” or “false”

IsPassword

“true” or “false”

IsPositive

“true” or “false”

Checks if the value is positive

IsReplicationMode

“true” or “false”

IsShow

“true” or “false”

Displays or hides a field on the window

IsSiteId

“true” or “false”

IsSourceDevice

“true” or “false”

IsSourceFabric

“true” or “false”

IsSourceInterface

“true” or “false”

IsSourceSwitchName

“true” or “false”

IsSwitchName

“true” or “false”

IsRMID

“true” or “false”

IsVPCDomainID

“true” or “false”

IsVPCID

“true” or “false”

IsVPCPeerLinkPort

“true” or “false”

IsVPCPeerLinkPortChannel

“true” or “false”

IsVPCPortChannel

“true” or “false”

Password

Text

Validates the password field

PeerOneFEXID

“true” or “false”

PeerTwoFEXID

“true” or “false”

PeerOnePCID

“true” or “false”

PeerTwoPCID

“true” or “false”

PrimaryAssociation

ReadOnly

“true” or “false”

Makes the field read-only

ReadOnlyOnEdit

“true” or “false”

SecondaryAssociation

Text

Section

UsePool

“true” or “false”

UseDNSReverseLookup

Username

Text

Displays the username field on the window

Warning

Text

Provides text to override the Description annotation

Example: AutoPopulate Annotation
##template variables
string BGP_AS;
 @(AutoPopulate="BGP_AS")
  string SITE_ID;
##
Example: DisplayName Annotation
##template variables
@(DisplayName="Host Name", Description = "Description of the host")
String hostname;
@(DisplayName="Host Address", Description = " test description" IsManagementIP=true)
ipAddress hostAddress;
##
Example: IsMandatory Annotation
##template variables
@(IsMandatory="ipv6!=null")
ipV4Address ipv4;
@(IsMandatory="ipv4!=null")
ipV6Address ipv6;
##
Example: IsMultiLineString Annotation
##template variables
@(IsMultiLineString=true)
string EXTRA_CONF_SPINE;
##
IsShow Annotation

##template variables
boolean isVlan;
@(IsShow="isVlan==true")
integer vlanNo;
##

##template variables
boolean enableScheduledBackup;
@(IsShow="enableScheduledBackup==true",Description="Server time")
string scheduledTime;
##
The condition "enableScheduledBackup==true" evaluates to true/false
 
##template variables
@(Enum="Manual,Back2BackOnly,ToExternalOnly,Both")
string VRF_LITE_AUTOCONFIG;
@(IsShow="VRF_LITE_AUTOCONFIG!=Manual",  Description="Target Mask")
integer DCI_SUBNET_TARGET_MASK
##
The condition "VRF_LITE_AUTOCONFIG!=Manual" matches string comparison to evaluate to true or false
Example: Warning Annotation
##template variables
@(Warning="This is a warning msg")
  string SITE_ID;
##

Templates Content

This section includes the configuration commands and any parameters that you want to include in the template. These commands can include the variables declared in the template variables section. During the command generation process the variable values are substituted appropriately in the template content.


Note

You must specify the commands that you include as if you were entering them in the global configuration command mode on any device. You must consider the command mode when you include commands.

Template content is governed by the usage of variables.

  • Scalar variables: does not take a range or array of values which cannot be used for iteration (In the variable types table those marked iterate-able as 'No'). Scalar variables must be defined inside the template content.

    
    Syntax: $$<variable name>$$
    Example: $$USER_NAME$$
    
  • Iterative variables: used for block iteration. These loop variable must be accessed as shown below inside the iteration block.

    
    Syntax:@<loop variable>
    Example:
    foreach val in $$INTEGER_RANGE_VALUE$$ {
    @val
    }
    
  • Scalar Structure Variable: Structure member variables can be accessed inside the template content.

    
    Syntax: $$<structure instance name>.<member variable name>$$
    Example: $$myInterface.inf_name$$
    
  • Array Structure Variable: Structure member variables can be accessed inside the template content.

    
    Syntax: $$<structure instance name>.<member variable name>$$
    Example: $$myInterface.inf_name$$
    

In addition to the template variables, you can use the conditional and iterative command generation using the following statements:

  • if-else if-else Statement: makes a logical decision in inclusion/exclusion of set of configuration command based on the value assigned for the variable in it.

    
    Syntax: if(<operand 1>  <logical operator>  <operand 2>){
    command1 ..
    command2..
    ..
    }
    else  if (<operand 3> <logical operator> <operand 4> )
    {
    Command3 ..
    Command4..
    ..
    }
    else
    {
    Command5 ..
    Command6..
    ..
    }
    Example: if-else if-else statement
    if($$USER_NAME$$ == 'admin'){
    Interface2/10
    no shut
    }
    else {
    Interface2/10
    shut
    }
    
  • foreach Statement: used for iterating a block of commands. The iteration is performed based on the assigned loop variable value.

    
    Syntax:
    foreach <loop index variable> in $$<loop variable>$$ {
    @<loop index variable> ..
    }
    Example: foreach Statement
    foreach ports in $$MY_INF_RANGE$${
    interface @ports
    no shut
    }
    
  • Optional parameters: By default all parameters are mandatory. To make a parameter optional, you must annotate the parameter.

In the variable section, you can include the following command:

  • @(IsMandatory=false)

  • Integer frequency;

    In the template content section, a command can be excluded or included without using “if” condition check, by assigning a value to the parameter. The optional command can be framed as below:

  • probe icmp [frequency frequency-value] [timeout seconds] [retry-count retry-count-value]

Advanced Features

The following are the advanced features available to configure templates.

  • Assignment Operation

    Config template supports assignment of variable values inside the template content section. The values are validated for the declared data type of the variable. If there is a mismatch, the value is not assigned.

    Assignment operation can be used under the following guidelines:

    • The operator on the left must be any of the template parameters or a for loop parameter.

    • The operator on the right values can be any of the values from template parameters, for loop parameters, literal string values surrounded by quotes or simple string values.

    If a statement does not follow these guidelines, or if it does not suit this format, it will not be considered as assignment operation. It is substituted during command generation like other normal lines.
    
    Example: Template with assignment operation
    ##template properties
    name =vlan creation;
    userDefined= true;
    supportedPlatforms = All;
    templateType = CLI;
    published = false;
    ##
    ##template variables
    integerRange vlan_range;
    @(internal=true)
    integer vlanName;
    ##
    ##template content
    foreach vlanID in $$vlan_range$${
    vlan @vlanID
    $$vlanName$$=@vlanID
    name myvlan$$vlanName$$
    }
    ##
  • Evaluate methods

    Config template uses the Java runtime provided Java script environment to perform arithmetic operations (such as ADD, SUBTRACT, and so on), string manipulations, and so on.

    Locate the JavaScript file in the template repository path. This file contains primary set of arithmetic, string functions. You can also add custom JavaScript methods.

    These methods can be called from config template content section in below format:
    
    Example1:
    $$somevar$$ = evalscript(add, "100", $$anothervar$$)
    Also the evalscript can be called inside if conditions as below:
    
    if($$range$$ > evalscript(sum, $$vlan_id$$,  -10)){
    do something...
    }

    You can call a method that is located at the backend of the Java script file.

  • Dynamic decision

    Config template provides a special internal variable “LAST_CMD_RESPONSE”. This variable stores the last command response from the device during the execution of the command. This can be used in the config template content to make dynamic decisions to deliver the commands that are based on the device condition.


    Note

    The if block must be followed by an else block in a new line, which can be empty.


    An example use case to create a VLAN, if it is does not exist on the device.
    Example: Create VLAN
    ##template content
    show vlan id $$vlan_id$$
    if($$LAST_CMD_RESPONSE$$ contains "not found"){
    vlan $$vlan_id$$
    }
    else{
    }
    ##

    This special implicit variable can be used only in the “IF” blocks.

  • Template referencing

    You can have a base template with all the variables defined. This base template can be imported to multiple templates. The base template content is substituted in the appropriate place of the extending template. The imported template parameters and the contents can be accessed inside the extending template.

    Example: Template Referencing
    Base template:
    ##template properties
    	name =a vlan base;
    	userDefined= true;
    	supportedPlatforms = All;
    	templateType = CLI;
    	published = false;
    	timestamp = 2015-07-14 16:07:52;
    	imports = ;
    ##
    ##template variables
    	integer vlan_id;
    ##
    ##template content
    	vlan $$vlan_id$$
    ##
    
    Derived Template:
    ##template properties
    	name =a vlan extended;
    	userDefined= true;
    	supportedPlatforms = All;
    	templateType = CLI;
    	published = false;
    	timestamp = 2015-07-14 16:07:52;
    	imports = a vlan base,template2;
    ##
    ##template variables
    	interface vlanInterface;
    ##
    ##template content
    	<substitute a vlan base>
    	interface $$vlanInterface$$
    	<substitute a vlan base>
    ##

    When you launch the extended template, the parameter inputs for the base template are also obtained. In addition, the substituted content is used for complete CLI command generation.

Report Template

The template type of REPORT template is python, and it has two subtypes, UPGRADE and GENERIC.

UPGRADE

The UPGRADE template is used for pre-ISSU and post-ISSU scenarios. These templates are listed in the ISSU wizard.

Refer to the default upgrade template packaged in Nexus Dashboard Fabric Controller for more information on pre-ISSU and post-ISSU handling. The default upgrade template is issu_vpc_check.

GENERIC

The GENERIC template is used for any generic reporting scenarios, such as, collecting information about resources, switch inventory, SFPs, and NVE VNI counters. You can also use this template to generate troubleshooting reports.

Resources Report

This report displays information about resource usage for a specific fabric.

The Summary section shows all resource pools with the current usage percentages. Use the horizontal scroll bar at the bottom of the window to display more columns.

POOL NAME: Specifies the name of the pool.

POOL RANGE: Specifies the IP address range of the pool.

SUBNET MASK: Specifies the subnet mask.

MAX ENTRIES: Specifies the maximum number of entries that can be allocated from the pool.

USAGE INSIDE RANGE: Specifies the current number of entries allocated inside the pool range.

USAGE OUTSIDE RANGE: Specifies the current number of entries set outside the pool range.

USAGE PERCENTAGE: This is calculated by using the formula: (Usage Inside Range/Max Entries) *100.

Click View Details to display a view of resources allocated or set in each resource pool. For example, the detailed section for a SUBNET has information about the resources that have been allocated within the subnet.

Switch Inventory Report

This report provides a summary about the switch inventory.

Click View Details to display more information about the modules and licenses.

SFP Report

This report provides information about utilization of SFPs at a fabric and device level.


Note

The switch inventory and SFP reports are supported only on Cisco Nexus devices.


Troubleshooting Reports

These reports are generated to help in troubleshooting scenarios. Currently, the NVE VNI Counters report is the only pre-defined troubleshooting report. Generating NVE VNI Counters reports involves performing periodic checks to identify the VNIs that are among the top hits based on network traffic. In a large-scale setup, we recommend limiting the report generation frequency to a minimum of 60 minutes.

NVE VNI Counters Report

This report collects the show nve vni counters command output for each VNI in the fabric.

After comparing the oldest report and the newest report, the Summary section shows the top-10 hit VNIs. The top hit VNIs are displayed in these categories:

  • L2 or L3 VNIs for unicast traffic

  • L2 or L3 VNIs for multicast traffic

  • L2 only VNIs for unicast traffic

  • L2 only VNIs for multicast traffic

  • L3 only VNIs for unicast traffic

  • L3 only VNIs for multicast traffic

The oldest report refers to the first report that is saved in the current reporting task. If you want to select a specific report as the first report against which the current report has to be compared, delete all reports that are older than the one selected so that the selected report becomes the first and oldest report.

For example, three reports were run yesterday at 8:00 a.m, 4:00 p.m. and 11:00 p.m. If you want to use the report at 11:00 p.m. as the first and oldest report for today’s reporting, delete the two reports that were run yesterday at 8:00 a.m. and 4:00 p.m.

For a periodic report, the oldest report is the first report that is run at the start time of a period. For daily and weekly reports, the current report is compared against the previously generated report.

The Summary section displays a column-wise report with information about the total transmitted bytes and the VNIs. Use the horizontal scroll bar at the bottom of the window to display more columns.


Note

The Summary section in the NVE VNI Counters report displays negative numbers in the TOTAL TX BYTES column if a report is generated after a switch reload or after clearing the counters on the switch. The numbers are displayed correctly in the subsequent reports. As a workaround, we recommend deleting all old reports or creating a new job before reloading switches or clearing counters.


Click View Details to display more information. This section shows NVE VNIs and counters on a per-switch basis.

For more information on how the reports are displayed, refer Programmable Reports chapter.