Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

header-navigation
keyboard_arrow_up
close
keyboard_arrow_left
Automation Scripting User Guide
Table of Contents Expand all
list Table of Contents
file_download PDF
{ "lLangCode": "en", "lName": "English", "lCountryCode": "us", "transcode": "en_US" }
English
keyboard_arrow_right

get-hello() Function (SLAX and XSLT)

date_range 13-Jan-21

Namespaces

content_copy zoom_out_map
http://xml.juniper.net/junos/commit-scripts/1.0

SLAX Syntax

content_copy zoom_out_map
var $capabilities = jcs:get-hello(connection);

XSLT Syntax

content_copy zoom_out_map
<xsl:variable name="capabilities" select="jcs:get-hello(connection)"/>

Description

Return the session ID and the capabilities of the NETCONF server during a NETCONF session.

During session establishment, the NETCONF server and client application each emit a <hello> element to specify which operations, or capabilities, they support from among those defined in the NETCONF specification or published as proprietary extensions. The <hello> element encloses the <capabilities> element and the <session-id> element, which specifies the session ID for this NETCONF session.

Within the <capabilities> element, a <capability> element specifies each supported function. Each capability defined in the NETCONF specification is represented by a uniform resource name (URN). Capabilities defined by individual vendors are represented by uniform resource identifiers (URIs), which can be URNs or URLs.

Parameters

connection

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

Return Value

capabilities

XML node set that specifies which operations, or capabilities, the NETCONF server supports. The node set also includes the session ID.

Usage Examples

In the following code snippet, the user, bsmith, establishes a NETCONF session on the default port with the remote device, fivestar, which is running Junos OS. 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-hello() function and stores the return value in the variable $hello, which is then printed to the CLI.

content_copy zoom_out_map
var $netconf := {
     <method> "netconf";
     <username> "bsmith";
}
var $connection = jcs:open("fivestar", $netconf);
var $hello = jcs:get-hello($connection);
expr jcs:output($hello);
expr jcs:close($connection);

The CLI displays the following output:

content_copy zoom_out_map
bsmith@fivestar's password:
  
urn:ietf:params:xml:ns:netconf:base:1.0
urn:ietf:params:xml:ns:netconf:capability:candidate:1.0
urn:ietf:params:xml:ns:netconf:capability:confirmed-commit:1.0
urn:ietf:params:xml:ns:netconf:capability:validate:1.0
urn:ietf:params:xml:ns:netconf:capability:url:1.0?protocol=http,ftp,file
http://xml.juniper.net/netconf/junos/1.0
http://xml.juniper.net/dmi/system/1.0

20847

Release Information

Function introduced in Junos OS Release 11.4.

footer-navigation