Customizable Device Support
  • 23 May 2023
  • Dark
    Light
  • PDF

Customizable Device Support

  • Dark
    Light
  • PDF

Article summary

Customizable Device Support

This guide illustrates how to use customizable device support for liveStatusProps and overrideConfig options.

  1. Navigate to IAP → Admin Essentials → Adapters.

  2. Select an adapter from the left sidenav menu. The Configuration Properties page displays.

  3. Toggle the Advanced View switch to open the Service Config editor.

  4. Add the liveStatusProps and overrideConfig property at the properties object.

  5. Go to Automation Studio → Workflows.

  6. Click the plus (+) sign to create a new workflow.

  7. Add the runCommand task and input the variables.

    Variable Description
    device The device of the nedType provided in liveStatusProps.
    command The original command is “show version”. By using liveStatusProps, any word can be entered at "commandPrefix" and the original command will then be replaced by the customizable word. In this case, the original command becomes “fake_command version” or just “version”.

The adapter will use these customizations to construct the JSON RPC call to NSO. With JSON RPC calls, you need to provide the action path and the parameters for the call. Different device types use different action paths and may use different structures for the parameters as well. Using liveStatusProps will be able to customize any of those attributes in order to perform a successful live status call.

Note: Adding liveStatusProps for supported device types will override the default behavior.

liveStatusProps Properties

Use the liveStatusProps parameter to add or override device support for live status calls.

Property Type Default Value Description
nedType String '' The device type. This can be a specific version like "cisco-ios-cli-6.72", or just "cisco-ios" to match all versions of cisco-ios.
Available nedTypes include: cisco-os, cisco-ios-xr, cisco-staros, cisco-nx, cisco-xe, junos, juniper-junos, juniper-junos-set, xml, a10-acos, f5-bigip, alu-sr, ciena-acos, cienacli-acos, adtran-aos, huawei-vrp, huawei-vrp, and arista-dcs.
actions Array [] An array of actions defined for the device type. See the Actions Properties below. Not all the params in “actions” need to be applied, just the configs that you want to change are needed.

Actions Properties

These parameters provide the action path and commands for the call.

Property Type Default Value Description
commandPrefix String '' The command prefix which will be used to match the command for the live status call.
actionPath String '' The execution path for the live status action.
commandParams Object {} The object structure that contains the commands being sent to NSO. Use "${command}" to indicate where the command object will be.
commandParamType Enum 'string' The type of the command object being sent to NSO. It can only be "string" or "array".

Examples

The commandPrefix is used to provide a self-defined shortcut to replace the build-in command line.

"liveStatusProps": [
    {
        "nedType": "cisco-iosxr-cli-7.36",
        "actions": [
        {
            "commandPrefix": "fake_command",
            "actionPath": "live-status/cisco-ios-xr-stats:exec/cisco-ios-xr-stats:show"
        }
        ]
    }
]

If command for live status is show version, the JSON RPC call will be:

actionPath: "live-status/cisco-ios-xr-stats:exec/cisco-ios-xr-stats:show"
command: "fake_command version"/"version"

Use commandParams when the live status action requires some params. User can use "${command}" to add a custom object to send to NSO.

{
    "nedType": "ericsson-sgsnmme",
    "actions": [
      {
        "actionPath": "live-status/ericssonsgsnmme-stats:EXEC/nonconfig-actions",
        "commandParams": {
          "action": {
            "action-payload": "${command}"
          }
        }
      }
    ]
}

If command is show version, the JSPN RPC call will be:

actionPath: "live-status/ericssonsgsnmme-stats:EXEC/nonconfig-actions"
command: {
  "action": {
    "action-payload": "show version"
  }
}

Use commandParamType to change the command object to an array instead of string Props.

"liveStatusProps": [
  {
    "nedType": "junos",
    "actions": [
      {
        "actionPath": "live-status/junoscli:exec/any",
        "commandParams": {
          "commands": "${command}"
        },
        "commandParamType": "array"
      }
    ]
  }
]

If command is show version, the JSON RPC call will be:

actionPath: "live-status/junoscli:exec/any"
command: {
  "commands": ["show version"]
}

overrideConfig Properties

The overrideConfig property is used to dynamically change device default settings.

Property Type Description
nedType String The device type. Note: this can be a specific version like "cisco-ios-cli-6.72", or just "cisco-ios" to match all versions of cisco-ios
actions Object An object of actions; see the Actions Properties defined for the device type.

Actions Properties

These parameters define the actions object.

Property Type Examples
nedFlag String "MAAPI_CONFIG_C", "MAAPI_CONFIG_C_IOS", "MAAPI_CONFIG_J", "MAAPI_CONFIG_XML", null
cleaner String "IOSXRCleaner", "ALUCleaner", "JunosCleaner", "NoCleaner"
nedStr String null, "cisco-ios-xr", "ios"
deviceType String "cli", "netconf", null
nativeCmd String ""
interfacePath String "interface"
deviceActionPath String "live-status/cisco-ios-xr-stats:exec/ci", "live-status/dcs-stats:exec/dcs-stats:show"
cmdArgName String "command","args", null
cmdArg String "cli show configuration", "running-config", "config", null
cmdNS String "cisco-ios.xr-stats", "ios-stats", "staros-stats", "nx-stats", "cisco-xe-xe-stats", "jrpc"
supportNativeConfig boolean true, false
deleteKeyword String "no", "delete"

Example

Not all the params in “actions” need to be applied, just the configs that you want to change are needed.

"overrideConfig": [
    {
        "nedType": "cisco-ios-xr",
        "actions": {
            “nedFlag”: ”MAAPI_CONFIG_C”,
            “cleaner”:”IOSXRCleaner”,
            “nedStr”:”cisco-ios-xr”,
            “deviceType”:”cli”,
            “nativeCmd”:””,
            “interfacePath”:”interface”,
            "deviceActionPath": "live-status/cisco-ios-xr-stats:exec/ci",
            “cmdArgName”:”args”,
            “cmdArg”:”cunnint-config”,
            “cmdNS”:”cisco-ios.xr-stats”,
            “supportNativeConfig”: true,
            “deleteKeyword”:”no”
        }
    }
]

Was this article helpful?

What's Next
Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.