Space banner This version of the product is in limited support. However, the documentation is available for your convenience. You will not be able to leave comments.

Adding or editing device adapters


Starting with version 20.02.01, you can add and edit a custom action adapter using the TrueSight Network Automation UI. This topic provides an overview of the UI controls that can be used to create elements and attributes.

Overview of the elements and attributes on UI

A device adapter is represented by elements in XML. Network Automation UI represents these XML elements via different UI controls, which define device adapter's behavior. The following figure shows various UI controls such as Assert and Assign that represent XML elements.

AddCustomAction.png

Elements act as building blocks of a device adapter. An element can have a value, represented by the Content field in the UI. Value is case-sensitive. For example, when you add a Pause element in an Interaction element, you provide content for the Pause element in the Content field.

Content_Sample.png                                           

An element can also have advanced features, which are represented by Attributes in the UI. When you add an element to an adapter, you are presented with the attributes available for that element. You select the attributes that you want to be included, and then, for each selected attribute, you define the value. Value is case-sensitive. If you do not select an attribute, default behavior for that attribute takes effect. 

For example, the following figure shows the attributes available for the Interaction element.

 InteractionElement.png

When you select the Treat Prompt, Response, and Error Elements As Regular Expressions option from the Attributes list, the UI control to define its value appears below the Attributes list, as shown in the following figure. 

InteractionElement_Attribute.png

Along with attributes, an element can contain child elements (Inner elements in UI). You can have any number of levels of nesting of child elements in a parent element. For example, as shown in the above figure, the Interaction element can have various child elements, such as Prompt, Command, and Pause (seconds). The attributes and child elements can be mandatory or optional. The mandatory child elements are grayed out in the UI. For example, in the Interaction element, the Command element is mandatory. 


When you add multiple elements inside an element, they need to be in a particular order for the successful implementation of a device adapter. An Info icon OrderIcon.png on the UI shows the required order of the elements. For example, the following figure shows the required order of the elements inside the Interaction elements. You can use the Drag icon Icon_Drag.png to order the elements. UI prevents ordering changes that violate the device adapter ordering rules. You can re-order multiple instances of the same element among themselves (for example, multiple Response elements). However, you cannot move an element to a wrong place (for example, move an Error element to be in the middle of Response elements).

OrderOfElements.png

Preview of the custom action adapter XML

You can preview the generated XML code for an element and its attributes at any point in time in the UI. For example, the following figure shows the UI controls and the corresponding XML code generated for the following elements:

  • Comment element with Content, Device adapter to ping a node
  • Interaction element with:  
    • Treat Prompt, Response, and Error Elements As Regular Expressions attribute selected
    • Command element with the Contentping %runtime.node%

  

CombinedElements.png  XML.png

The option to preview the custom action adapter XML offers the following benefits:

  • Helps you locate the server-side errors: When a server-side error is reported with a line number while saving the adapter changes, you can use the preview option to view the generated code at that line number and then correct the error via UI controls.
  • Helps you save the generated XML code: During a prolonged adding or editing session, the preview option helps you save the changes you made. You can save the XML using a text editor, import it again, and resume the session.

Where to go from here

To add or edit a custom action adapter, see Adding-or-editing-a-custom-action-adapter

For an example of creating a custom action adapter, see Example-of-creating-a-custom-action-adapter-using-UI.

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*