Related Documentation
- ACX Series
- Summary of Extension Functions in the jcs and slax Namespaces
- Junos Script Automation: Understanding Extension Functions in the jcs and slax Namespaces
- Specifying the Session Protocol for Connections Using Junos Automation Scripts
- get-hello() Function (jcs Namespace)
- open() Function (jcs Namespace)
- EX Series
- Summary of Extension Functions in the jcs and slax Namespaces
- Junos Script Automation: Understanding Extension Functions in the jcs and slax Namespaces
- Specifying the Session Protocol for Connections Using Junos Automation Scripts
- get-hello() Function (jcs Namespace)
- open() Function (jcs Namespace)
- M Series
- Summary of Extension Functions in the jcs and slax Namespaces
- Junos Script Automation: Understanding Extension Functions in the jcs and slax Namespaces
- Specifying the Session Protocol for Connections Using Junos Automation Scripts
- get-hello() Function (jcs Namespace)
- open() Function (jcs Namespace)
- MX Series
- Summary of Extension Functions in the jcs and slax Namespaces
- Junos Script Automation: Understanding Extension Functions in the jcs and slax Namespaces
- Specifying the Session Protocol for Connections Using Junos Automation Scripts
- get-hello() Function (jcs Namespace)
- open() Function (jcs Namespace)
- PTX Series
- Summary of Extension Functions in the jcs and slax Namespaces
- open() Function (jcs Namespace)
- QFX Series
- Specifying the Session Protocol for Connections Using Junos Automation Scripts
- SRX Series
- Summary of Extension Functions in the jcs and slax Namespaces
- Junos Script Automation: Understanding Extension Functions in the jcs and slax Namespaces
- Specifying the Session Protocol for Connections Using Junos Automation Scripts
- get-hello() Function (jcs Namespace)
- open() Function (jcs Namespace)
- T Series
- Summary of Extension Functions in the jcs and slax Namespaces
- Junos Script Automation: Understanding Extension Functions in the jcs and slax Namespaces
- Specifying the Session Protocol for Connections Using Junos Automation Scripts
- get-hello() Function (jcs Namespace)
- open() Function (jcs Namespace)
get-protocol() Function (jcs Namespace)
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
connection | — | Connection handle generated by a call to the jcs:open() function. |
Return Value
protocol | — | Session 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.
var $netconf := {
<method> "netconf";
<username> "bsmith";
}
var $connection = jcs:open("fivestar", $netconf);
var $protocol = jcs:get-protocol($connection);
expr jcs:output($protocol);
expr jcs:close($connection);
The CLI displays the following output:
bsmith@fivestar's password: netconf
Related Documentation
- ACX Series
- Summary of Extension Functions in the jcs and slax Namespaces
- Junos Script Automation: Understanding Extension Functions in the jcs and slax Namespaces
- Specifying the Session Protocol for Connections Using Junos Automation Scripts
- get-hello() Function (jcs Namespace)
- open() Function (jcs Namespace)
- EX Series
- Summary of Extension Functions in the jcs and slax Namespaces
- Junos Script Automation: Understanding Extension Functions in the jcs and slax Namespaces
- Specifying the Session Protocol for Connections Using Junos Automation Scripts
- get-hello() Function (jcs Namespace)
- open() Function (jcs Namespace)
- M Series
- Summary of Extension Functions in the jcs and slax Namespaces
- Junos Script Automation: Understanding Extension Functions in the jcs and slax Namespaces
- Specifying the Session Protocol for Connections Using Junos Automation Scripts
- get-hello() Function (jcs Namespace)
- open() Function (jcs Namespace)
- MX Series
- Summary of Extension Functions in the jcs and slax Namespaces
- Junos Script Automation: Understanding Extension Functions in the jcs and slax Namespaces
- Specifying the Session Protocol for Connections Using Junos Automation Scripts
- get-hello() Function (jcs Namespace)
- open() Function (jcs Namespace)
- PTX Series
- Summary of Extension Functions in the jcs and slax Namespaces
- open() Function (jcs Namespace)
- QFX Series
- Specifying the Session Protocol for Connections Using Junos Automation Scripts
- SRX Series
- Summary of Extension Functions in the jcs and slax Namespaces
- Junos Script Automation: Understanding Extension Functions in the jcs and slax Namespaces
- Specifying the Session Protocol for Connections Using Junos Automation Scripts
- get-hello() Function (jcs Namespace)
- open() Function (jcs Namespace)
- T Series
- Summary of Extension Functions in the jcs and slax Namespaces
- Junos Script Automation: Understanding Extension Functions in the jcs and slax Namespaces
- Specifying the Session Protocol for Connections Using Junos Automation Scripts
- get-hello() Function (jcs Namespace)
- open() Function (jcs Namespace)