Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 

get-protocol() Function (SLAX and XSLT)

 

Namespaces

SLAX Syntax

XSLT Syntax

Release Information

Function introduced in Junos OS Release 11.4.

Description

Return the session protocol associated with the connection handle. The protocol values are junoscript, netconf, and junos-netconf.

Parameters

connectionConnection handle generated by a call to the jcs:open() function.

Return Value

protocolSession protocol associated with the connection handle. The values are junoscript, netconf, and junos-netconf.

Usage Examples

In the following code snippet, the user, bsmith, establishes a NETCONF session on the default port with the remote device, fivestar. Since the code does not specify a value for the password, the user is prompted for a password during script execution. Once authentication is established, the code calls the jcs:get-protocol() function and stores the return value in the variable $protocol, which is then printed to the CLI.

The CLI displays the following output: