A Base Cartridge Generation Properties

This appendix provides details on the parameters you can configure in the skeleton.properties file used to generate base cartridge source files.

This file contains a number of properties that customize the generated base cartridge source.

Property names are of the form sdk_context_type and are composed of three parts:

  • sdk: indicates an SDK variable

  • context: describes of the context in which the variable applies

  • type: indicates how the variable is being used, and may imply a restriction on the possible values:

    • If supported appears in the type, a boolean value should be entered.

    • If pattern appears in the type, a regular expression (regex) pattern should be entered.

    • If prompt appears in the type, a device response should be entered in the form of a regex pattern.

    • If cmd appears in the type, a device specific command should be entered.

Boolean variables are validated to ensure that the values conform to boolean values (true or false).

Regex patterns are validated to ensure that they can be compiled.

Note:

For certain regular expressions in the skeleton.properties file, it maybe necessary to use an escape character to precede certain special characters in order for them to be translated to the generated source code correctly. This is dependent on whether you are using XQuery or Java based transforms. For example, many regexes specifying prompt string matches appear in dm2cli-common.xq.

Table A-1 shows the naming and packaging properties.

Table A-1 Naming and Packaging Properties

Property Description Example

sdk_global_cartridgeName

This is the cartridge name. This variable is used throughout the cartridge code in generating file names and source code variable names.

This property is mandatory.

cisco

sdk_global_cartridgeVersion

This is the cartridge version that is being developed. It is used at run time to verify that a device model is still valid in the event of an upgrade of the cartridge.

This property is mandatory.

1.0

sdk_global_package

This is the cartridge path in dotted notation used for packaging. Its value is translated to a directory structure for the source files path generation. The value is used in build scripts, java source code and support files.

The generated files are placed in:

SDK_home\baseCartridges\sdk_global_cartridgeName\src\sdk_global_package

This property is mandatory.

com.metasolv.serviceactivator.cisco becomes com\metasolv\servicectivator\cisco

Table A-2 shows the device type identification properties used in the JUnit test environment.

Table A-2 Device Type Identification Properties

Property Description Example

sdk_global_deviceName

Device name as it will be used with the Registry.xml for which this cartridge is being constructed.

This property is a key property that is used to assign the driverType value for this base cartridge. The driverType value will be set to the value of this property converted to all lowercase characters. For more details about base cartridge Registry.xml, see IP Service Activator SDK Developer Overview Guide for more details.

This property is mandatory.

Cisco

sdk_global_deviceDescription

Device description as it will be used with the Service Model for which this cartridge is being constructed.

This property is mandatory.

Cisco Internetwork Operating System Software IOS (tm) RSP Software (RSP-PV-M), Version 12.2(8)T, RELEASE SOFTWARE (fc2) TAC

sdk_global_deviceModel

Device Model that this cartridge is being constructed for. Used in Registry.xml and in the test environment.

This property is mandatory

2611

sdk_global_deviceVersion

Device version that this cartridge is being constructed for.

This property is mandatory.

12.2(11)T8

Table A-3 shows the Device Model schema properties.

Table A-3 Device Model Schema Properties

Property Description Example

sdk_deviceModel_namespace

Target namespace of the device model schema for this base cartridge.

This property is mandatory.

--

sdk_deviceModel_namespaceAbbr

Abbreviation of the target namespace of the device model schema for this base cartridge. This is used as a namespace prefix.

This property is mandatory.

dmcisco

sdk_deviceModel_prefix

A complex type with the name sdk_deviceModel_prefixDevice which extends BaseDevice will be generated in the deviceModel schema for this base cartridge.

This property is mandatory.

Cisco becomes CiscoDevice

Table A-4 shows the options schema properties.

Table A-4 Options Schema Properties

Property Description Example

sdk_options_namespace

Target namespace of the options schema for this service cartridge.

This property is mandatory.

--

sdk_options_namespaceAbbr

Abbreviation of the target namespace of the options schema for this cartridge. This is used as a namespace prefix.

This property is mandatory.

ciscopt

Table A-5 shows the test environment properties.

Note:

Be aware of the final usage of properties and code appropriately - they could end up in either dm2cli-common.xq or in java.

Table A-5 Test Environment Properties

Property Description Example

sdk_test_userName

Login userid for device to be used in testing the cartridge.

Note: TACACS access is only supported for testing.

This property is mandatory

userid

sdk_test_userPasswd

Login password for device to be used in testing the cartridge.

Note: TACACS access is only supported for testing.

This property is mandatory.

userPasswd

sdk_test_hostip

IP address for the device to be used in testing the cartridge.

This property is mandatory.

2.2.2.2

sdk_test_cmd

A simple command to be used to determine if device access is available.

This property is mandatory.

show run

sdk_test_matchPattern

Pattern to match the general device prompt.

The sample matchPattern matches zero or more characters with the exception of: >, #, or \n (newline), and is followed by either one of > or #.

The group of characters preceding the > or # is the hostname.

Note: You must use a syntax that conforms to java.

This property is mandatory.

([ˆ>#\\n]*)[>#]

sdk_test_prePendPattern

Pattern that can prefix the general prompt.

The prepend pattern is prepended to the prompt pattern. It should be used if the prompt has something at its beginning that must be explicitly matched.

The sample prepend pattern matches \n (the newline character).

Note: You must use a syntax that conforms to java.

This property is mandatory.

\\n

sdk_test_appendPattern

Pattern to match the config t prompt.

The append pattern is appended to the prompt pattern. It should be used if the prompt has something at its end that must be explicitly matched.

The sample append pattern matches one of the following:

>, #, or zero or more characters in parentheses followed by #

Note: You must use a syntax that conforms to java.

This property is mandatory.

(([>#])|(\\\\(.*\\\\)#))

Table A-6 shows the properties to support saving of the running configuration.

Table A-6 Properties to Support Saving of the Running Configuration

Property Description Example

sdk_saveRunningConfig_supported

Boolean value to indicate if running config should be saved to the device after each configuration change.

This property is mandatory.

True

sdk_saveRunningConfig_cmd

Command to send to the device to save running config.

This property is optional.

copy running-config startu-config

sdk_startUpSavedConfig_timeout

Timeout in seconds for sdk_start command.

This property is optional.

600

Table A-7 shows the Audit properties.

Table A-7 Audit Properties

Property Description Example

sdk_audit_supported

Command sent to the device to determine if device is supported.

This property is mandatory

True

sdk_auditTerminalLengthZero_supported

Boolean value to indicate if the device needs to have a command sent that sets the terminal length to 0.

This property is mandatory.

True

sdk_auditTerminalLengthZero_cmd

Command to send to the device to set terminal length to 0.

This property is optional.

terminal length 0

sdk_auditShowRunningConfig_cmd

Command to instruct the device to display all of the running configuration

This property is optional.

show running-config

sdk_auditShowRunningConfig_conditionalPrompt

Regular expression which matches the returned running configuration - the successful response to sdk_auditShowRunningConfig_cmd (see above).

The example matches multiple lines of text consisting of any characters followed by the text end on a separate line followed by zero or more characters.

This property is optional.

.*(?m)ˆend$.*

sdk_auditShowCommandsLogout_cmd

Command to send to the device to log out after executing sdk_auditshowRunningConfig_cmd.

This property is optional

Logout

sdk_auditShowCommandsLogout_conditionalPrompt

Regular expression to match the device's successful response after executing the sdk_auditShowCommandsLogout_cmd to logout after displaying the running configuration.

The example matches any character zero or more times

This property is optional.

.*

Table A-8 shows the Restore properties.

Table A-8 Restore Properties

Property Description Example

sdk_restore_supported

Boolean value to indicate if the device supports the ability to copy all configuration from a network server to the device startup configuration.

This property is optional.

True

sdk_restore_copyTftpCmd

Command to send to the device to copy all configuration from a network server.

This property is optional.

copy tftp startup-config

sdk_restore_copyTftpAddressPrompt

Device prompt for the location after executing sdk_restore_copyTftpCmd.

This property is optional.

.*Address or name of remote host.*

sdk_restore_copyTftpSourceFilePrompt

Device prompt for the source after executing sdk_restore_copyTftpCmd

This property is optional.

.*Source filename.*

sdk_restore_copyTftpDestinationFilePrompt

Device prompt for the destination after executing sdk_restore_copyTftpCmd.

This property is optional.

.*Destination filename.*

sdk_restore_copyTftpDestinationFileCmd

Destination to send to the device to set the destination for the sdk_restore_copyTftpCmd command to be the device startup configuration

This property is optional.

startup-config

sdk_restore_reloadCmd

Command to send to the device to reload the operating system after all configuration is restored to the startup configuration.

This property is optional.

reload

sdk_restore_reloadPrompt

Device prompt for confirmation to proceed with reloading the operating system after executing sdk_restore_reloadCmd.

This property is optional.

.*Proceed with reload.*

sdk_restore_reloadConfirmationCmd

Command to send to the device to confirm that the reload should proceed after receiving the device prompt sdk_restore_reloadPrompt.

This property is optional.

y

Table A-9 shows the properties for support of Network Processor DM synchronization with the device.

Table A-9 Properties for Support of Network Processor DM Synchronization with the Device

Property Description Example

sdk_configversion_supported

Boolean value to indicate if the cartridge should support the ability to specify configuration versions.

This property is mandatory

True

sdk_configversion_text

The text that specifies the configuration version on the device. When reading back the configuration version, the configuration version is found by searching for the variable's value.

This property is optional.

IpsaConfigVersion

sdk_configversion_updateCmd

Prefix of the CLI command that updates the configuration version on the device. The entire command is formed by appending the configuration version to it.

This propety is optional.

alias exec IpsaConfigVersion

sdk_configversion_removeCmd

Prefix of the CLI command that removes the configuration version from the device. The entire command is formed by appending the configuration version to it.

This property is optional.

no alias execc IpsaConfigVersion

sdk_configversion_showCmd

The CLI command that retrieves the configuration version from the device. The result from this command is expected to be a single line which among other tokens must contain the configuration version.

This property is optional.

show aliases exec | include IpsaConfigVersion

sdk_configversion_extractCmd

This is a regular expression that when applied against to the result from sdk_configversion_showCmd must match, so that its first group is bound to the configuration version string.

This property is optional

IpsaConfigVersion +(.+)

Table A-10 shows Prompt Matching properties.

Table A-10 Prompt Matching Properties

Property Description Example

sdk_getConfiguration_matchPattern

Pattern to match the general device prompt.

Note: You must use syntax that conforms with XM

This property is optional.

([ˆ>#\\n]*)[>#]

sdk_getConfiguration_prePendPattern

Pattern that can prefix the general prompt.

Note: You must use syntax that conforms with XML.

This property is optional.

\\n

sdk_getConfiguration_appendPattern

Pattern to match the config t prompt

Note: You must use syntax that conforms with XML.

This property is optional.

(([>#])|(\\(.*\\)#))

sdk_getConfiguration_errorPattern

Prompt from device if login failed.

This property is optional.

.*Username:

sdk_getConfiguration_hostPattern

Pattern to match the hostname within the prompt

Note: You must use syntax that conforms with XML.

This property is optional.

[\\w\\.\\-]+

Table A-11 shows the TACACS authentication support properties.

Table A-11 TACACS Authentication Support Properties

Property Description Example

sdk_authenticationTacacs_supported

Boolean value to indicate if cartridge is to support this type of login access to device.

This property is mandatory.

True

sdk_authenticationTacacs_useridPrompt

Prompt from device to enter userid.

This property is optional.

.*Username:

sdk_authenticationTacacs_passwdPrompt

Prompt from device to enter password.

This property is optional.

.*Password:

sdk_authenticationTacacs_errorPrompt

Prompt from device if userid or password is bad.

This property is optional.

.*Username:

sdk_authenticationTacacs_enablePasswdPrompt

Prompt from device to enter enable userid if applicable.

This property is optional.

.+

sdk_authenticationTacacs_enablePasswdPasswdPrompt

Prompt from device to enter enable password if applicable.

This property is optional.

.*Password:

sdk_authenticationTacacs_enablePasswdErrorPrompt

Prompt from device if enable userid\password is bad.

This property is optional.

.*Bad secrets

Table A-12 shows the SSH authentication support properties.

Table A-12 SSH Authentication Support Properties

Property Description Example

sdk_authenticationSsh_supported

Boolean value to indicate if cartridge is to support this type of login access to device.

This property is mandatory.

True

sdk_authenticationSsh_useridPrompt

Prompt from device to enter userid.

This property is optional.

.+

sdk_authenticationSsh_passwdPrompt

Prompt from device to enter password.

This property is optional.

.*Password:

sdk_authenticationSsh_enablePasswdErrorPrompt

Prompt from device if enable password is bad.

This property is optional.

.*Bad secrets

Table A-13 shows anonymous authentication support properties.

Table A-13 Anonymous Authentication Support Properties

Property Description Example

sdk_authenticationAnonymous_supported

Boolean value to indicate if cartridge is to support this type of login access to device.

This property is mandatory.

True

sdk_authenticationAnonymous_passwdPrompt

Prompt from device to enter password.

This property is optional.

.*Password:

sdk_authenticationAnonymous_useridPrompt

Prompt from device to enter the userid.

This property is optional.

.+

sdk_authenticationAnonymous_enablePasswdPrompt

Prompt from device to enter enable password if applicable.

This property is optional.

.*Password:

sdk_authenticationAnonymous_enablePasswdErrorPrompt

Prompt from device if enable password is bad.

This property is optional.

.*Bad secrets

Table A-14 shows the password only authentication support properties.

Table A-14 Password Only Authentication Support Properties

Property Description Example

sdk_authenticationPasswordOnly_supported

Boolean value to indicate if cartridge is to support this type of login access to device.

This property is mandatory.

True

sdk_authenticationPasswordOnly_passwdPrompt

Prompt from device to enter password.

This property is optional.

.*Password:

Note:

You must set at least one of the sdk_authenticationauthentication_style_supported parameters from to true.

Table A-15 shows the logout properties.

Table A-15 Logout Properties

Property Description Example

sdk_logoutCommand_cmd

Command to exit the device session.

Exit

Table A-16 shows the configuration behavior properties.

Table A-16 Configuration Behavior Properties

Property Definition Example

sdk_configMode_retryNum

Property to tell the network processor how many times to retry a command.

This property is mandatory.

2

sdk_configMode_waitTime

Property to tell the network processor how long to wait to see if a command is successful or not.

This property is mandatory.

20

sdk_configMode_cmd

Command to enter the device config entry mode.

This property is optional.

config

sdk_configModeTerminate_cmd

Command to exit the device config entry mode.

This property is optional.

end

sdk_testBadRegex_Pattern

This property is not used in the generated skeleton files. It is for testing the SkeletonGenerator to determine if bad regexes are being caught. You can remove the property from the file if desired.

This property is optional.

|)_*