yangcli-pro Command Reference

This section describes all the yangcli-pro local and remote commands built-in when using the netconfd-pro server.

There may be more or less commands available, depending on the YANG modules actually loaded at the time.

The specific NETCONF capabilities needed are listed for each remote command. No capabilities are ever needed for a local command.

It is possible that other servers will support protocol operations that netconfd-pro does not support. If yangcli-pro has the YANG file available for the module, then it can be managed with the high level commands. Low-level commands can still be used with external data (e.g., @mydatafile.xml).

Any YANG 'rpc' statement can be used as a remote yangcli-pro command. Refer to the server vendor documentation for details on the protocol operations, database contents, and notification definitions that they support.

action

The 'action' command is a high-level operation to invoke a YANG 1.1 action. This is essentially an RPC operation that is specific to a data resource. It is defined within a YANG container or list. It is used to invoke data model specific actions that are unrelated to editing.

A target node must be an action, and then any missing key leafs (if any) within the data structure are filled in. If the specified action node has input parameters, they will be filled in.

A target node is specified (in 1 of 2 ways), and then the data structure is filled in. Only mandatory nodes will be filled in unless the $$optional system variable is set to 'true' or the –optional parameter is provided.

Refer to the fill command for more details on interactive mode data structure completion.

+---x action
   +---w input
      +---w (from)
      |  +--:(varref)
      |  |  +---w varref?                string
      |  +--:(from-cli)
      |     +---w (target-parm)?
      |     |  +--:(target)
      |     |  |  +---w target           yang:xpath1.0
      |     |  +--:(urltarget-case)
      |     |     +---w urltarget        ywt:UrlPath
      |     |     +---w match-names?     ywt:NameMatchMode
      |     |     +---w alt-names?       ywt:AltNameMode
      |     |     +---w wildcard-keys?   boolean
      |     +---w optional?              empty
      |     +---w value?                 <anyxml>
      +---w timeout?                     nt:Timeout

Command type:

remote

Default parameter:

target

Min parameters:

1

Max parameters:

5

Return type:

status

YANG file:

yangcli-pro.yang

Capabilities needed:

none

Command Parameters:

  • choice 'from' (not entered)

    • type: choice of case 'varref' or case 'from-cli'

    • usage: mandatory

    • default: none

    • This parameter specifies the where yangcli-pro should get the data from, for the action. It is either a user variable or from interactive input at the command line.

      • varref

        • type: string

        • usage: mandatory

        • default: none

        • This parameter specifies the name of the user variable to use for the target of the action. The parameter must exist (e.g., created with the fill command) or an error message will be printed.

      • case from-cli (not entered)

        • target

          • type: string

          • usage: mandatory

          • default: none

          • This parameter specifies the database target node of the action. This is an ncx:schema-instance string, so any instance identifier, or absolute path expression, or something in between, is accepted.

        • urltarget

          • type: string

          • usage: optional

          • default: none

          • This parameter specifies the database target node of the action. This is an UrlPath string.

        • optional

          • type: empty

          • usage: optional

          • default: controlled by $$optional system variable

          • This parameter controls whether optional nodes within the target will be filled in. It can be used to override the $$optional system variable, when it is set to 'false'.

        • value

          • type: anyxml

          • usage: mandatory

          • default: none

          • TBD: THIS PARAMETER IS NOT SUPPORTED YET

            • This parameter specifies the value that should be used for the contents of the input parameters for the action. If it is entered, then the interactive mode prompting for missing parameters will be skipped, if this parameter is complete (or all mandatory nodes present if the $$optional system variable is 'false').

  • timeout

    • type: uint32 (0 = no timeout, otherwise the number of seconds to wait)

    • usage: optional

    • default: set to the $$timeout system variable, default 30 seconds

    • This parameter specifies the number of seconds to wait for a response from the server before giving up. The session will not be dropped if a remote command times out, but any late response will be dropped. A value of zero means no timeout should be used, and yangcli-pro will wait forever for a response.

Positive Response:

  • the server returns <ok/>

Negative Response:

  • An error message will be printed if errors are detected locally.

  • An <rpc-error> message will be printed if the server detected an error.

Usage:

YANG Module Example:

module act1 {
  yang-version 1.1;
  namespace "http://netconfcentral.org/ns/act1";
  prefix a;
  revision "2017-10-14";

  container objs {
   config false;
   list obj {
     key "idx";
     leaf idx { type int32; }
     leaf col1 { type string; }
     action draw {
       description "Draw this object";
       input {
         leaf i { type uint32; mandatory true; }
         leaf j { type uint32; }
       }
     }
    }
  }
}

Invoke “draw” action:

andy@localhost> action /objs/obj[idx="10"]/draw

Filling mandatory action /objs/obj/draw:
Enter uint32 value for leaf <i>
andy@localhost:action> 10

RPC OK Reply 2 for session 3 [default]:

andy@localhost>

XML sent to NETCONF server:

<?xml version="1.0" encoding="UTF-8"?>
<rpc message-id="2"
 xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
 <action xmlns="urn:ietf:params:xml:ns:yang:1">
  <objs xmlns="http://netconfcentral.org/ns/act1">
   <obj>
    <idx>10</idx>
    <draw>
     <i>10</i>
    </draw>
   </obj>
  </objs>
 </action>
</rpc>

Reference:

alias

The 'alias' command is used to set or display a specific command alias, or display all command aliases if no parameter is given. It is similar to the 'alias' command in unix shells such as 'bash'.

Note: This command can be disabled with the --no-aliases CLI parameter.

There are 3 forms of the alias command:

  1. alias: display all command aliases in memory

  2. alias <name>: display the command alias with the specified name

  3. alias <name>=<value>: set the command alias with the specified name to the string value

Use the unset command to delete an alias.

+---x alias
    +---w input
       +---w var?   string

Command type:

local

Default parameter:

var

Min parameters:

0

Max parameters:

1

Return type:

status

YANG file:

yangcli-pro.yang

Command Parameters:

  • var

    • type: string

    • usage: optional

    • default: none

    • The 'var' string must contain either a valid alias name or a string setting an alias. There cannot be any whitespace between the '=' and other characters when setting an alias. The alias value must be quoted if it contains whitespace.

      • A double-quoted string can contain single quotes:

        > alias get-eth0=”xget /interfaces/interface[name='eth0']
      • A single-quoted string can contain double quotes:

        alias get-eth0='xget /interfaces/interface[name=”eth0”]'
        
      • An unquoted string can be used if the <value> does not contain any whitespace:

        > alias gc=get-config
        

Positive Response:

  • If no parameter given:

    • The current list of command aliases is displayed.

  • If a <name> parameter given:

    • The specified alias is displayed.

  • If a <name>=<value> parameter is given:

    • 'Updated alias foo' if alias foo already exists.

    • 'Added alias foo' if this is a new alias

Negative Response:

  • If no parameter given:

    • Not applicable

  • If a <name> parameter given:

    • Error: alias 'foo' not found

  • If a <name>=<value> parameter is given:

    • Error message printed if value is invalid

Usage:

> alias get-running=”get-config --source=running”

Added alias 'get-running'

>

apply

This command is available in configuration mode only.

The 'apply' command is available in config mode to apply pending edits to the server configuration.

+---x apply

Command type:

config mode

Default parameter:

none

Min parameters:

0

Max parameters:

0

Return type:

none

YANG file:

none

Command Parameters:

  • none

Positive Response:

  • A message indicated action performed will be printed if --log-level is info or above.

Negative Response:

  • An error message will be printed

Usage:

Example with --config-commit-mode=false (default):

server1# nacm groups group mygroup

server1(group)# !us

server1(group)# user-name fred

server1(group)# user-name barney

server1(group)# apply

Applying 1 edit

server1(group)#

Example with --config-commit-mode=true:

server1# nacm groups group mygroup

server1(group)# user-name fred

server1(group)# user-name barney

server1(group)# apply

Applying 1 edit

Warning:edits have been made to candidate, but no commit done.
Use config-commit to commit the current configuration to the running datastore.

server1(group)#

aliases

The 'aliases' command is used to load, save, or clear the command aliases, or display all command aliases if no parameter is given.

Note: This command can be disabled with the --no-aliases CLI parameter.

There are 4 forms of the aliases command:

  1. aliases [show]: display all command aliases in memory

  2. aliases clear: clear all command aliases in memory

  3. aliases save [alias-filespec]: save the command aliases in memory in an '.aliases' file.

  4. aliases load [alias-filespec]: load the command aliases from an '.aliases' file into memory.

+---x aliases
   +---w input
      +---w (alias-action)?
         +--:(show)
         |  +---w show?    empty
         +--:(clear)
         |  +---w clear?   empty
         +--:(load)
         |  +---w load?    string
         +--:(save)
            +---w save?    string

Command type:

local

Default parameter:

none

Min parameters:

0

Max parameters:

1

Return type:

status

YANG file:

yangcli-pro.yang

Command Parameters:

  • alias-action

    • type: choice

    • usage: optional

    • default: show

    • clear

      • Delete all aliases from memory. This will not affect the aliases file until the 'aliases save' command is used, or the program exits and the --autoaliases parameter is set to 'true'.

    • load [alias-filespec]

      • Load an aliases file into memory. If the 'alias-filespec' parameter is not given, then the default aliases file ($HOME/.yumapro/.yangcli_pro_aliases) will be used.

    • save [alias-filespec]

      • Save the command aliases into memory to an alias file. If the 'alias-filespec' parameter is not given, then the default aliases file ($HOME/.yumapro/.yangcli_pro_aliases) will be used.

    • show

      • Displays all aliases in memory.

Positive Response:

  • show:

    • The current list of command aliases is displayed.

  • clear, load, save:

    • A status message is displayed.

Negative Response:

  • An error message is printed if any error occurs.

Usage:

> aliases save

Saved aliases OK to '~/.yumapro/.yangcli_pro_aliases'

>

auto-test

The 'auto-test' command is used to test edit operations and performance on a NETCONF server.

It can be used to generate pseudo-random <edit-config> operations for a specified data node. All configuration descendant nodes will be created. Each time an edit is done the NETCONF “replace” operation is used.

If the :startup capability is not present then the edit will be saved to non-volatile storage by the server after each edit is completed. Otherwise the auto-test command will automatically save all edits at the end of the test.

The 'target' parameter is used to specify the database configuration node to use for the test. This is a schema identifier string. No key value predicates are allowed, just object names.

The 'iterations' parameter specifies how many edits to complete. If the candidate database is the server target, then an edit is an <edit-config> operation, followed by a <commit> operation. If the running database is the server target, then an edit is simply an <edit-config> operation.

If the session-name parameter is present, then that named session will be used, or else the current session will be used. The session must be connected to the server and the session must be active. The user must have read and write access to all the nodes indicated by the target parameter. Access to the <edit-config>, <commit>, and <copy-config> operations is also required.

Note: choice statements are not supported at this time. Only string and numeric simple types are supported at this time.

+---x auto-test
   +---w input
      +---w target          string
      +---w session-name?   nt:NcxIdentifier
      +---w iterations?     uint32

Command type:

local

Default parameter:

target

Min parameters:

1

Max parameters:

3

Return type:

status

YANG file:

yangcli-pro.yang

Command Parameters:

  • target

    • type: schema identifier string

    • usage: mandatory

    • default: none

    • This parameter specifies the data node to test.

  • session-name

    • type: identifier string

    • usage: optional

    • default: current session

    • This parameter specifies the session name to use for the test

  • iterations

    • type: uint32

    • usage: optional

    • default: 1

    • This parameter specifies the number of edits to perform for the test.

Positive Response:

  • show:

    • The current list of command aliases is displayed.

  • clear, load, save:

    • A status message is displayed.

Negative Response:

  • An error message is printed if any error occurs.

Usage:

andy@myserver> auto-test target=/ptest1 iterations=100

[edits done on current session]

andy@myserver>

cache

The 'cache' command is used to clear 1 or all entries from the YANG module cache.

There are 3 forms of the cache command:

  1. cache clear: Clear the YANG module cache on disk.

  2. cache delete= module-name Delete the specified module name from the YANG module cache. All revisions will be deleted from the cache.

  3. cache delete= module-name [revision=revision-date] Delete the specified module name and revision date from the YANG module cache.

+---x cache
   +---w input
      +---w (cache-input)
         +--:(clear)
         |  +---w clear?      empty
         +--:(delete-cache)
            +---w delete      nt:NcxIdentifier
            +---w revision?   nt:Date

Command type:

local

Default parameter:

none

Min parameters:

1

Max parameters:

2

Return type:

none

YANG file:

yangcli-pro.yang

Command Parameters:

  • cache-action

    • type: choice

    • usage: optional

    • default: none

    • clear

      • Clear the YANG module cache on disk.

    • delete [name of module]

      • delete the specified YANG modules from YANG module cache.

    • revision [revision-date of module]

      • deletes the specified YANG modules from YANG module cache.

Positive Response:

  • none. Use 'show cache' to verify the result of the action.

Negative Response:

  • none. Use 'show cache' to verify the result of the action.

Usage:

Example: show the cache

> show cache
yumaworks-event-filter@2014-02-09
ietf-netconf-notifications@2012-02-06
yuma-ncx@2013-09-23
yuma-types@2012-06-01
yuma-netconf@2013-09-28
t79@2014-06-19
yumaworks-types@2013-02-11
ietf-netconf-partial-lock@2009-10-19
test1a@2011-07-14
ietf-inet-types@2013-07-15
yuma-proc@2013-07-16
yuma-mysession@2013-10-05
test1c@2008-10-12
yumaworks-system@2014-05-27
yang-attributes@2013-02-18
ietf-netconf-with-defaults@2011-06-01
ietf-netconf-monitoring@2010-10-04
yuma-interfaces@2012-01-13
ietf-netconf-acm@2012-02-22
test1@2008-10-12
yuma-system@2013-07-15
ietf-yang-types@2013-07-15
yuma-app-common@2012-08-16
test1b@2008-10-12
test@2009-12-26
yuma-time-filter@2012-11-15

Example: delete all revisions of one module in the cache

andy@myserver> cache delete=test1b
andy@myserver>
andy@myserver> show cache

yumaworks-event-filter@2014-02-09
ietf-netconf-notifications@2012-02-06
yuma-ncx@2013-09-23
yuma-types@2012-06-01
yuma-netconf@2013-09-28
t79@2014-06-19
yumaworks-types@2013-02-11
ietf-netconf-partial-lock@2009-10-19
test1a@2011-07-14
ietf-inet-types@2013-07-15
yuma-proc@2013-07-16
yuma-mysession@2013-10-05
test1c@2008-10-12
yumaworks-system@2014-05-27
yang-attributes@2013-02-18
ietf-netconf-with-defaults@2011-06-01
ietf-netconf-monitoring@2010-10-04
yuma-interfaces@2012-01-13
ietf-netconf-acm@2012-02-22
test1@2008-10-12
yuma-system@2013-07-15
ietf-yang-types@2013-07-15
yuma-app-common@2012-08-16

Example: delete one revision of one module in the cache

andy@myserver> cache delete=test1 revision=2008-10-12
andy@myserver>
andy@myserver> show cache

yumaworks-event-filter@2014-02-09
ietf-netconf-notifications@2012-02-06
yuma-ncx@2013-09-23
yuma-types@2012-06-01
yuma-netconf@2013-09-28
t79@2014-06-19
yumaworks-types@2013-02-11
ietf-netconf-partial-lock@2009-10-19
test1a@2011-07-14
ietf-inet-types@2013-07-15
yuma-proc@2013-07-16
yuma-mysession@2013-10-05
test1c@2008-10-12
yumaworks-system@2014-05-27
yang-attributes@2013-02-18
ietf-netconf-with-defaults@2011-06-01
ietf-netconf-monitoring@2010-10-04
yuma-interfaces@2012-01-13
ietf-netconf-acm@2012-02-22
test@2009-12-26 yuma-arp@2012-01-13
test@2009-9-26
yuma-system@2013-07-15
ietf-yang-types@2013-07-15
yuma-app-common@2012-08-16
yuma-time-filter@2012-11-15
yuma-arp@2012-01-13
ietf-netconf@2011-06-01
nc-notifications@2008-07-14
notifications@2013-03-15
ietf-netconf@2011-06-01
nc-notifications@2008-07-14
notifications@2013-03-15
yuma-time-filter@2012-11-15
yuma-arp@2012-01-13
ietf-netconf@2011-06-01
nc-notifications@2008-07-14
notifications@2013-03-15
ietf-netconf@2011-06-01
nc-notifications@2008-07-14
notifications@2013-03-15

Example: clear the cache

andy@myserver> cache clear

empty cache: ./yumapro/.yangcli

andy@myserver>

Reference:

callhome-server

The 'callhome-server' command allows access and control of the Call Home server.

  • callhome-server start

  • callhome-server stop

This command can be used in addition or instead of the CLI parameters to control the Call Home server.

+---x callhome-server
|  +---w input
|     +---w (callhome-server-input)
|        +--:(start)
|        |  +---w start                empty
|        |  +---w callhome-address?    inet:ip-address
|        |  +---w callhome-port?       inet:port-number
|        |  +---w callhome-tls-port?   inet:port-number
|        |  +---w restart-ok?          empty
|        +--:(stop)
|           +---w stop                 empty

Note

These CLI parameters will be used as the default values for the 'callhome start' operation if no parameter is provided:

The --callhome-enabled CLI parameter is automatically set to 'true' if the 'callhome-server start' operation is used.

Command type:

local

Default parameter:

N/A

Min parameters:

1

Max parameters:

5

Return type:

none

YANG file:

yangcli-pro.yang

Introduced:

23.10T-7

Command Parameters:

  • choice 'callhome-server-input' (not entered)

    • usage: mandatory

    • default: none

    • This parameter specifies the Call Home server operation.

      • case start

        • start

          • type: empty

          • usage: mandatory

          • default: none

          • This parameter specifies that the Call Home server should be started.

        • callhome-address

          • type: ip-address

          • usage: optional

          • default: --callhome-address CLI parameter or YANG default

          • This parameter specifies the Call Home server IP address.

        • callhome-port

          • type: port-number

          • usage: optional

          • default: --callhome-port CLI parameter or YANG default

          • This parameter specifies the Call Home server TCP port for NETCONF over SSH sessions.

        • callhome-tls-port

          • type: port-number

          • usage: optional

          • default: --callhome-tls-port CLI parameter or YANG default

          • This parameter specifies the Call Home server TCP port for NETCONF over TLS sessions.

        • restart-ok

          • type: empty

          • usage: optional

          • default: Do not restart if already running

          • If present, then it is OK to stop the Call Home server if running, and restart it. Otherwise it will be an error to start the Call Home server if it is already running. Stopping the server does not affect any Call Home sessions already successfully started.

      • stop

        • type: empty

        • usage: mandatory

        • default: none

        • This parameter specifies that the Call Home server should be stopped.

Positive Response:

  • The Call Home server is started or stopped.

Negative Response:

  • An error message is printed.

Usage:

> show callhome

Call Home Enabled: false
Call Home Active: false
Call Home Users: 0
Call Home Sessions: 0
> callhome-server start

Call Home server started OK

> show callhome

Call Home Enabled: true
Call Home Active: true
  NETCONF over SSH Socket: 0.0.0.0:4334
  NETCONF over TLS Socket: 0.0.0.0:4335
Call Home Users: 0
Call Home Sessions: 0
> callhome-server stop

Call Home server stopped OK

> show callhome

Call Home Enabled: true
Call Home Active: false
Call Home Users: 0
Call Home Sessions: 0
  • Starting the Call Home server with a non-default 'callhome-address'

> callhome-server start callhome-address=192.168.2.215

Call Home server started OK

> show callhome

Call Home Enabled: true
Call Home Active: true
  NETCONF over SSH Socket: 192.168.2.215:4334
  NETCONF over TLS Socket: 192.168.2.215:4335
Call Home Users: 0
Call Home Sessions: 0

callhome-user

The 'callhome-user' command allows Call Home user entry names to be configured, similar to the --callhome-user CLI parameter.

  • Entries can be added and deleted at run-time.

  • These entries do not persist across a reboot.

  • New entries are added last.

  • TBD: Support ordered-by user insert modes.

+---x callhome-user
|  +---w input
|     +---w (callhome-user-input)
|        +--:(add)
|        |  +---w add       nt:NcxIdentifier
|        +--:(remove)
|           +---w remove    nt:NcxIdentifier

Note

There must be a corresponding user config created with the user-cfg command, for a Call Home user entry to be used.

Command type:

local

Default parameter:

N/A

Min parameters:

1

Max parameters:

1

Return type:

none

YANG file:

yangcli-pro.yang

Introduced:

23.10T-7

Command Parameters:

  • choice 'callhome-user-input' (not entered)

    • usage: mandatory

    • default: none

    • This parameter specifies the Call Home user operation.

      • add

        • type: NcxIdentifier

        • usage: mandatory

        • default: none

        • This parameter specifies that the Call Home user identifier to be added.

      • remove

        • type: NcxIdentifier

        • usage: mandatory

        • default: none

        • This parameter specifies that the Call Home user identifier to be removed.

Positive Response:

  • The Call Home user is added or deleted.

Negative Response:

  • An error message is printed.

Usage:

  • Creating a Call Home user named 'user1'.

    • Since there is no user config entry named 'user1' yet, the 'show callhome' command output includes [cfg: N] to indicate that no user-cfg entry was found.

> callhome-user add user1

Adding Call Home user 'user1'

> show callhome

Call Home Enabled: true
Call Home Active: true
  NETCONF over SSH Socket: 192.168.2.215:4334
  NETCONF over TLS Socket: 192.168.2.215:4335
Call Home Users: 1
  user1 [cfg: N]
Call Home Sessions: 0
  • Creating a user config for 'user1':

> user-cfg create=user1 user-name=user1 password=mypassword

A new user is created: user-id=user1 name=user1 password=mypassword
  • After creating a user config for 'user1':

> show callhome

Call Home Enabled: true
Call Home Active: true
  NETCONF over SSH Socket: 192.168.2.215:4334
  NETCONF over TLS Socket: 192.168.2.215:4335
Call Home Users: 1
  user1 [cfg: Y]
Call Home Sessions: 0

cancel-commit

The 'cancel-commit' command is used to stop a confirmed commit procedure on the server. A commit operation must be done before this command is relevant.

This command is provided by the NETCONF server, not yangcli-pro. Refer to the <cancel-commit> operation for parameter details.

Usage:

server1> commit confirmed

RPC OK Reply 3 for session 3 [default]:

server1> cancel-commit

RPC OK Reply 4 for session 3 [default]:

server1>

cancel-subscription

The cancel-subscription command is used to stop receiving notifications from the server, from a previous create-subscription command.

The :notification capability must be supported by the server to use this command.

Unless the :interleave capability is also supported by the server, then only the close-session command can be used while notifications are being delivered.

This command is provided by the NETCONF server, not yangcli-pro.

Refer to the <cancel-subscription> operation for parameter details.

Usage:

andy@myserver> cancel-subscription

RPC OK Reply 13 for session 10:

OR

andy@myserver>

Reference:

  • none

cd

The 'cd' command is used to change the current working directory.

+---x cd
   +---w input
      +---w dir    string

Command type:

local

Default parameter:

dir

Min parameters:

1

Max parameters:

1

Return type:

status

YANG file:

yangcli-pro.yang

Command Parameters:

  • dir

    • type: string

    • usage: mandatory

    • default: none

    • The 'dir' string must contain a valid directory specification

Positive Response:

  • the new current working directory is printed

Negative Response:

  • an error message will be printed describing the error

Usage:

> cd ~/modules

Current working directory is /home/andy/modules

> cd --dir=$YUMAPRO_HOME

Current working directory is /home/andy/swdev/yumapro/trunk/netconf

>

clear

The 'clear' command is used to clear the screen and reposition the prompt at the top of the screen.

This command is only applied in interactive mode, and has no affect in batch mode.

+---x clear

Command type:

local

Default parameter:

N/A

Min parameters:

0

Max parameters:

0

Return type:

none

YANG file:

yangcli-pro.yang

Command Parameters: none

Positive Response:

  • the screen is cleared

Negative Response:

  • no change to screen

Usage:

> clear

After the command the screen is cleared and a new prompt is printed in on the first line.

close-session

The 'close-session' command is used to terminate the current NETCONF session. A NETCONF server should always accept this command if it is valid, and not reject it due to access control enforcement or if the server is in notification delivery mode. This command is provided by the NETCONF server, not yangcli-pro.

This is a server command. Refer to the <close-session> operation for parameter details.

Usage:

andy@myserver> close-session

RPC OK Reply 2 for session 10:

>

Reference:

commit

The 'commit' command is used to save the edits in the <candidate> database into the <running> database. If there are no edits it will have no effect.

This command is provided by the NETCONF server, not yangcli-pro. Refer to the <commit> operation for parameter details.

Usage:

andy@myserver> commit

RPC OK Reply 5 for session 10:

andy@myserver>

Reference:

config

The 'config' command is used to enter configuration mode. It can only be used if the current session is connected to a NETCONF or RESTCONF server.

  • The configuration source is given as the only parameter

  • The value 'terminal' is the only supported configuration source at this time.

  • The max command line length is 4095 character.

+---x config
    +---w input
       +---w (config-source)?
          +--:(term)
             +---w term?   empty

Command type:

local

Default parameter:

term

Min parameters:

1

Max parameters:

1

Return type:

none (enter configuration mode)

YANG file:

yangcli-pro.yang

Command Parameters:

  • term

    • type: empty

    • usage: mandatory

    • default: present

    • This parameter specifies that the terminal is the configuration source

Positive Response:

  • the prompt will change indicating configuration mode is active

Negative Response:

  • An error message will be printed

Usage:

andy@myserver> config term

andy@myserver#

config-commit

This command is available in configuration mode only.

The 'config-commit' command is used to commit the candidate datastore to the running datastore in config mode.

This command is only used in config mode when --config-commit-mode=true.

+---x config-commit

Command type:

config

Default parameter:

0

Min parameters:

0

Max parameters:

0

Return type:

none

YANG file:

none

Command Parameters:

  • none.

Positive Response:

  • No error message.

Negative Response:

  • An error message will be printed

Usage:

andy@myserver> config term

andy@myserver# config-commit

connect

The 'connect' command is used to start a session with a NETCONF server.

This command can be used in 3 forms:

  1. Default session: All required connection parameters are specified and the default session is used. The parameters are only saved as defaults for the next connect command. They are not saved in any template.

  2. Named Session: Only the 'session-name` parameter is used. The specified session-cfg template is used for all connection parameters.

  3. Modified Named Session: The 'session-name' parameter is used and additional parameters are also specified, which will cause the session-cfg template to be updated if the connection is successful.

If there already is a NETCONF session active, then an error message will be printed and the command will not be executed.

+---x connect
   +---w input
      +---w user                 nt:NcxUserName
      +---w server               inet:host
      +---w (pass)
      |  +--:(password)
      |  |  +---w password?      string
      |  +--:(no-password)
      |     +---w no-password?   empty
      +---w ncport?              uint16
      +---w timeout?             nt:Timeout
      +---w public-key?          string
      +---w private-key?         string
      +---w ssl-fallback-ok?     boolean
      +---w ssl-certificate?     string
      +---w ssl-key?             string
      +---w ssl-trust-store?     string
      +---w protocols?           bits
      +---w entry-point?         string
      +---w transport?           ywt:transport-type
      +---w encoding?            ywt:encoding-type
      +---w session-name?        nt:NcxIdentifier

Command type:

remote

Default parameter:

server

Min parameters:

1

Max parameters:

10

Return type:

status

YANG file:

yangcli-pro.yang

Command Parameters:

  • server

    • type: inet:ip-address (string containing IP address or DNS name

    • usage: mandatory unless session-name parameter is used and refers to a previously saved session configuration.

    • default: previous server used, if any, will be presented as the default, but not used automatically

    • This parameter specifies the server address for the session.

  • password

    • type: string (ncx:password)

    • usage: mandatory unless session-name parameter is used and refers to a previously saved session configuration, of if no-password parameter is present.

    • default: previous password used, if any, will be presented as the default, but not used automatically

    • This parameter specifies the password string to use to establish the session. It will not be echoed in parameter mode or saved in the command history buffer.

  • no-password

    • type: empty

    • usage: mandatory unless session-name parameter is used and refers to a previously saved session configuration, of if password parameter is present.

    • default:not present

    • This parameter specifies that there is no password needed for this connection

  • ncport

    • type: uint16

    • usage: optional

    • default: 830

    • This parameter specifies the TCP port number that should be used for the session.

  • timeout

    • type: uint32 (0 = no timeout, otherwise the number of seconds to wait)

    • usage: optional

    • default: set to the $$timeout system variable, default 30 seconds

    • This parameter specifies the number of seconds to wait for a response from the server before giving up. The session will not be dropped if a remote command times out, but any late response will be dropped. A value of zero means no timeout should be used, and yangcli-pro will wait forever for a response.

  • user

    • type: string

    • usage: mandatory unless session-name parameter is used and refers to a previously saved session configuration.

    • default: previous user name used, if any, will be presented as the default, but not used automatically

    • This parameter specifies the user name to use for the session. This must be a valid user name on the NETCONF server.

  • protocols

    • type: bits (netconf1.0 netconf1.1 yang-api restconf)

    • usage: optional

    • default: --protocols configuration parameter setting

    • Specifies which NETCONF protocol versions to enable. Overrides --protocols configuration parameter.

      • netconf1.0: request RFC 4741 NETCONF

      • netconf1.1: request RFC 6241 NETCONF

      • yang-api: request Yuma YANG-API protocol

      • restconf: request IETF RESTCONF protocol

  • private-key

    • type: string

    • usage: optional

    • default: --private-key configuration parameter setting

    • Specifies the SSH private key file to use. Overrides --private-key configuration parameter.

  • public-key

    • type: string

    • usage: optional

    • default: --public-key configuration parameter setting

    • Specifies the SSH public key file to use. Overrides the --public-key configuration parameter.

  • session-name

    • type: identifier string

    • usage: optional

    • default: none

    • Specifies the named session configuration entry to use for the connection information. Sessions can be saved while active with the 'session-cfg save' command.

      • If this parameter is used and the named session configuration is found, then that session will be used for connection parameters. Any additional parameters will be used to update the existing named session entry.

      • If this parameter is used and the named session configuration is not found, then other parameters will be checked, and a connection attempt will be made. If successful, the session parameters will be saved as a new saved session.

  • transport

    • type: enumeration (ssh, tcp, tcp-ncx, tls)

    • usage: optional

    • default: ssh

    • This parameter specifies the transport protocol to use.

      • ssh:

        Selects the standard NETCONF transport (and 'ncport' specifies the SSH port to use).

      • tcp:

        Selects the tail-f NETCONF over TCP protocol.

        • The 'ncport' value is set to 2023.

        • The 'protocols' value is set to netconf1.0.

        • The 'password' value will be ignored if present.

        • A direct TCP connection will be used instead of SSH, using the tail-f structured connection string protocol.

      • tcp-ncx:

        Selects the YumaWorks NETCONF over TCP protocol.

        • The 'ncport' value is set to 2023.

        • The 'protocols' value is set to netconf1.0.

        • The 'password' value will be ignored if present.

        • A direct TCP connection will be used instead of SSH, using the YumaWorks <ncx-connect> protocol.

      • tls:

        Selects the TLS protocol

  • entry-point

    • type: string

      usage: RESTCONF entry point. Use this string instead of retrieving the XRD from the RESTCONF server to discover the entry point.

Positive Response:

  • the session is started and the prompt changes to include the user@server string.

Negative Response:

  • One or more error messages will be printed. Refer to the section on trouble-shooting NETCONF Session problems for more details.

Usage:

> connect myserver user=andy password=yangrocks

<startup screen printed>

andy@myserver>

copy-config

The 'copy-config' command is used to copy one entire NETCONF database to another location.

Not all possible parameter combinations will be supported by every server. In fact, the NETCONF protocol does not require any parameters to be supported unless the :startup or :url capabilities is supported by the server.

If the server supports the :startup capability, then it must support the following operation:

andy@myserver> copy-config source=running target=startup

This is the standard way to save a snapshot of the current running configuration in non-volatile storage, if the server has a separate startup database. If not, the server will automatically save any changes to the running configuration to non-volatile storage.

This command is provided by the NETCONF server, not yangcli-pro. Refer to the <copy-config> operation for parameter details.

Usage:

andy@myserver> copy-config source=candidate

Enter a number of the selected case statement:

  1: case candidate:
       leaf candidate
  2: case running:
       leaf running
  3: case startup:
       leaf startup
  4: case url:
       leaf url

Enter choice number [1 - 4]:
andy@myserver:copy-config> 4

Enter string value for leaf <url>:
andy@myserver:copy-config> file:///myconfig.xml

RPC OK Reply 12 for session 10:
andy@myserver>

Reference:

create

The 'create' command is a high-level <edit-config> operation. It is used to create some new nodes in the default target database.

A target node is specified (in 1 of 2 ways), and then the data structure is filled in. Only mandatory nodes will be filled in unless the $$optional system variable is set to 'true'.

Refer to the fill command for more details on interactive mode data structure completion.

+---x create
   +---w input
      +---w (from)
      |  +--:(varref)
      |  |  +---w varref?                string
      |  +--:(from-cli)
      |     +---w (target-parm)?
      |     |  +--:(target)
      |     |  |  +---w target           yang:xpath1.0
      |     |  +--:(urltarget-case)
      |     |     +---w urltarget        ywt:UrlPath
      |     |     +---w match-names?     ywt:NameMatchMode
      |     |     +---w alt-names?       ywt:AltNameMode
      |     |     +---w wildcard-keys?   boolean
      |     +---w optional?              empty
      |     +---w value?                 <anyxml>
      +---w timeout?                     nt:Timeout

Command type:

remote

Default parameter:

target

Min parameters:

1

Max parameters:

5

Return type:

status

YANG file:

yangcli-pro.yang

Capabilities needed:

:candidate or :writable-running

Command Parameters:

  • choice 'from' (not entered)

    • type: choice of case 'varref' or case 'from-cli'

    • usage: mandatory

    • default: none

    • This parameter specifies the where yangcli-pro should get the data from, for the create operation. It is either a user variable or from interactive input at the command line.

      • varref

        • type: string

        • usage: mandatory

        • default: none

        • This parameter specifies the name of the user variable to use for the target of the create operation. The parameter must exist (e.g., created with the fill command) or an error message will be printed.

      • case from-cli (not entered)

        • target

          • type: string

          • usage: mandatory

          • default: none

          • This parameter specifies the database target node of the create operation. This is an ncx:schema-instance string, so any instance identifier, or absolute path expression, or something in between, is accepted.

        • urltarget

          • type: string

          • usage: optional

          • default: none

          • This parameter specifies the database target node of the create operation. This is an UrlPath string.

        • optional

          • type: empty

          • usage: optional

          • default: controlled by $$optional system variable

          • This parameter controls whether optional nodes within the target will be filled in. It can be used to override the $$optional system variable, when it is set to 'false'.

        • value

          • type: anyxml

          • usage: mandatory

          • default: none

          • This parameter specifies the value that should be used for the contents of the 'target' parameter. If it is entered, then the interactive mode prompting for missing parameters will be skipped, if this parameter is complete (or all mandatory nodes present if the $$optional system variable is 'false'). For example, if the target is a leaf, then specifying this parameter will always cause the interactive prompt mode to be skipped.

  • timeout

    • type: uint32 (0 = no timeout, otherwise the number of seconds to wait)

    • usage: optional

    • default: set to the $$timeout system variable, default 30 seconds

    • This parameter specifies the number of seconds to wait for a response from the server before giving up. The session will not be dropped if a remote command times out, but any late response will be dropped. A value of zero means no timeout should be used, and yangcli-pro will wait forever for a response.

System Variables:

  • $$default-operation

    • The <default-operation> parameter for the <edit-config> operation will be derived from this variable.

  • $$error-option

    • The <error-option> parameter for the <edit-config> operation will be derived from this variable

  • $$test-option

    • The <test-option> parameter for the <edit-config> operation will be derived from this variable

Positive Response:

  • the server returns <ok/>

Negative Response:

  • An error message will be printed if errors are detected locally.

  • An <rpc-error> message will be printed if the server detected an error.

Usage:

andy@myserver> create varref=myvar

RPC OK Reply 10 for session 10:

andy@myserver> create /nacm/rules/data-rule

(user will be prompted to fill in the data-rule contents)

RPC OK Reply 11 for session 10:

andy@myserver> create target=/nacm/rules/data-rule[name='test rule']/comment value=”this test rule is temporary. Do not remove!”

(no user prompting; <edit-config> request sent right away)

RPC OK Reply 12 for session 10:

andy@myserver>

Reference:

create-subscription

The 'create-subscription' command is used to start receiving notifications from the server.

The :notification capability must be supported by the server to use this command.

Unless the :interleave capability is also supported by the server, then only the close-session command can be used while notifications are being delivered.

This command is provided by the NETCONF server, not yangcli-pro.

Refer to the <create-subscription> operation for parameter details.

Usage:

andy@myserver> create-subscription

RPC OK Reply 13 for session 10:

OR

andy@myserver> create-subscription startTime=2009-01-01T00:00:00Z

RPC OK Reply 14 for session 10:

andy@myserver>

Reference:

device-cfg

The 'device-cfg' command is used to access a named device.

There are 3 sub-commands:

  • delete

  • save

  • show (default)

Refer to the section on NETCONF Device Configuration for more details on using saved devices.

+---x device-cfg
   +---w input
      +---w (device-action)?
         +--:(show-case)
         |  +---w show?           IdentifierOrZero
         |  +---w (help-mode)?
         |     +--:(brief)
         |     |  +---w brief?    empty
         |     +--:(normal)
         |     |  +---w normal?   empty
         |     +--:(full)
         |        +---w full?     empty
         +--:(delete)
         |  +---w delete?         nt:NcxIdentifier
         +--:(save)
         |  +---w save?           nt:NcxIdentifier
         +--:(create)
            +---w create          nt:NcxName
            +---w server          inet:host
            +---w ncport?         uint16
            +---w entry-point?    string
            +---w protocols?      bits

Command type:

local

Default parameter:

show

Min parameters:

1

Max parameters:

2

Return type:

status

YANG file:

yangcli-pro.yang

Capabilities needed:

none

Command Parameters:

  • delete

    • type: name string

    • This parameter specifies the name of the device to delete from the saved devices in memory. An active device cannot be deleted.

  • save

    • type: name string

    • This parameter specifies the name of the device to save in the saved devices in memory.

  • show

    • type: name string; default: empty string == current device

    • This parameter specifies the name of the device to show. An empty string indicates that the current device should be used.

    • The --brief, --normal, or --full parameter can be used for this sub-command.

Positive Response:

  • A message indicating the save or delete was done will be printed. The show command will generate some formatted output showing information on the requested device.

Negative Response:

  • An error message will be printed if errors are detected locally.

andy@myserver> device-cfg save device-A

Saving current device as 'device-A'

andy@myserver>

devices-cfg

The 'devices-cfg' command is used to access the named device files.

There are 4 sub-commands:

  • clear

  • load

  • save

  • show (default)

Refer to the section on NETCONF Device Configuration for more details on using saved devices.

+---x devices-cfg
   +---w input
      +---w (devices-action)?
         +--:(show-case)
         |  +---w show?           empty
         |  +---w (help-mode)?
         |     +--:(brief)
         |     |  +---w brief?    empty
         |     +--:(normal)
         |     |  +---w normal?   empty
         |     +--:(full)
         |        +---w full?     empty
         +--:(clear)
         |  +---w clear?          empty
         +--:(load)
         |  +---w load?           string
         +--:(save)
            +---w save?           string

Command type:

local

Default parameter:

show

Min parameters:

1

Max parameters:

2

Return type:

status

YANG file:

yangcli-pro.yang

Capabilities needed:

none

Command Parameters:

  • clear

    • type: empty

    • This parameter indicates that all saved devices in memory be deleted. This cannot be done if any of the devices are currently active. Use 'device-cfg load' to restore the saved devices.

  • load

    • type: string

    • This parameter identifies the file specification for the saved devices to load. Any new named devices will be added to the named devices in memory.

  • save

    • type: name string

    • This parameter identifies the file specification for the saved devices config file to load. The saved devices in memory will be saved to this file.

  • show

    • type: name string; default: empty string == all devices

    • This parameter specifies the name of the device to show.

    • The --brief, --normal, or --full parameter can be used for this sub-command.

Positive Response:

  • A message indicating the load, save or clear was done will be printed. The show command will generate some formatted output showing information on the requested devices.

Negative Response:

  • An error message will be printed if errors are detected locally.

session-A> devices-cfg load ~/more-devices.conf

Loading saved devices from '/home/andy/more-devices.conf'

Loaded saved devices OK from '~/more-devices.conf'

session-A>

delete

The 'delete' command is a high-level <edit-config> operation. It is used to delete an existing subtree in the default target database.

A target node is specified, and then any missing key leafs (if any) within the data structure are filled in. If the target is a leaf-list, then the user will be prompted for the value of the leaf-list node to be deleted.

Refer to the fill command for more details on interactive mode data structure completion.

+---x delete
   +---w input
      +---w (delete-target)
      |  +--:(target)
      |  |  +---w target?      string
      |  +--:(urltarget)
      |     +---w urltarget?   ywt:UrlPath
      +---w value?             <anyxml>

Command type:

remote

Default parameter:

target

Min parameters:

1

Max parameters:

2

Return type:

status

YANG file:

yangcli-pro.yang

Capabilities needed:

:candidate or :writable-running

Command Parameters:

  • target

    • type: string

    • usage: optional (urltarget or target must be present)

    • default: none

    • This parameter specifies the database target node of the delete operation. This is an ncx:schema-instance string, so any instance identifier, or absolute path expression, or something in between, is accepted.

  • urltarget

    • type: string

    • usage: optional

    • default: none

    • This parameter specifies the database target node of the delete operation. This is an UrlPath string.

System Variables:

  • $$default-operation

    • The <default-operation> parameter for the <edit-config> operation will be derived from this variable.

  • $$error-option

    • The <error-option> parameter for the <edit-config> operation will be derived from this variable

  • $$optional

    • Controls whether optional descendant nodes will be filled into the target parameter contents

  • $$test-option

    • The <test-option> parameter for the <edit-config> operation will be derived from this variable

Positive Response:

  • the server returns <ok/>

Negative Response:

  • An error message will be printed if errors are detected locally.

  • An <rpc-error> message will be printed if the server detected an error.

Usage:

andy@myserver> delete /nacm/rules/data-rule

(user will be prompted to fill in the data-rule 'name' key leaf)

RPC OK Reply 15 for session 10:

andy@myserver> delete target=/nacm/rules/data-rule[name='test rule']/comment

(no user prompting; <edit-config> request sent right away)

RPC OK Reply 16 for session 10:

andy@myserver>

Reference:

delete-all

The 'delete-all' command is a high-level <edit-config> operation. It is used to delete all instances of a list or leaf-list in the default target database.

A target node is specified, and then any missing key leafs (if any) within the data structure are filled in. If the target is a leaf-list, then the user will be prompted for the value of the leaf-list node to be deleted.

Refer to the fill command for more details on interactive mode data structure completion.

+---x delete-all
   +---w input
      +---w (delete-target)
         +--:(target)
         |  +---w target?      string
         +--:(urltarget)
            +---w urltarget?   ywt:UrlPath

Command type:

remote

Default parameter:

target

Min parameters:

1

Max parameters:

2

Return type:

status

YANG file:

yangcli-pro.yang

Capabilities needed:

:candidate or :writable-running

Command Parameters:

  • target

    • type: string

    • usage: optional (urltarget or target must be present)

    • default: none

    • This parameter specifies the database target node of the delete operation. This is an ncx:schema-instance string, so any instance identifier, or absolute path expression, or something in between, is accepted.

  • urltarget

    • type: string

    • usage: optional

    • default: none

    • This parameter specifies the database target node of the delete operation. This is an UrlPath string.

System Variables:

  • $$default-operation

    • The <default-operation> parameter for the <edit-config> operation will be derived from this variable.

  • $$error-option

    • The <error-option> parameter for the <edit-config> operation will be derived from this variable

  • $$optional

    • Controls whether optional descendant nodes will be filled into the target parameter contents

  • $$test-option

    • The <test-option> parameter for the <edit-config> operation will be derived from this variable

Positive Response:

  • the server returns <ok/>

Negative Response:

  • An error message will be printed if errors are detected locally.

  • An <rpc-error> message will be printed if the server detected an error.

Usage:

andy@myserver> delete-all /nacm/rules/data-rule

(user will be prompted to fill in the data-rule 'name' key leaf)

RPC OK Reply 15 for session 10:

andy@myserver>

Reference:

  • none

delete-config

The 'delete-config' command is used to delete an entire NETCONF database.

Not all possible 'target' parameter values will be supported by every server. In fact, the NETCONF protocol does not require that any database be supported by this operation.

If the server supports the :url capability, then it may support deletion of local file databases in this manner.:

This command is provided by the NETCONF server, not yangcli-pro. Refer to the <delete-config> operation for parameter details.

Usage:

andy@myserver> delete-config target=startup

RPC OK Reply 17 for session 10:

andy@myserver>

Reference:

delete-subscription

The 'delete-subscription' command is used to terminate your own notification subscription on the connected NETCONF server. The netconfd-pro server must have the yang-push bundle enabled for this operation to be available.

The subscription-id returned in the establish-subscription command must be used as the parameter, since a session can have multiple subscriptions active at once.

The server should also send a <subscription-terminated> Event notification as a result of the operation.

This command is provided by the NETCONF server, not yangcli-pro. Refer to the <delete-subscription> operation for parameter details.

Usage:

server1> delete-subscription id=1

Incoming notification for session 2 [default]:
notification {
  eventTime 2022-01-13T02:56:35Z
  subscription-terminated {
    id 1
    reason sn:no-such-subscription
  }
}

RPC OK Reply 5 for session 3 [default]:

server1>

discard-changes

The 'discard-changes' command is used to delete any edits that exist in the <candidate> database, on the NETCONF server. The server will only accept this command if the :candidate capability is supported. If the <candidate> database is locked by another session, then this request will fail with an 'in-use' error.

This command is provided by the NETCONF server, not yangcli-pro. Refer to the <discard-changes> operation for parameter details.

Usage:

andy@myserver> discard-changes

RPC OK Reply 18 for session 10:

andy@myserver>

Reference:

do

The 'do' command is available in config mode to invoke a non-config mode command, such as show.

Only 3 sub-commands are supported:

Command type:

config mode

Default parameter:

none

Min parameters:

1

Max parameters:

1

Return type:

none

YANG file:

none

Command Parameters:

  • 1 parameter expected, which is start of 1 of the 3 supported commands

Positive Response:

  • No error message.

Negative Response:

  • An error message will be printed

Usage:

server1# do show var optional

optional false

server1#

edit-config

The 'edit-config' command allows a subset of a NETCONF database on the server to be changed.

If the server supports the :url capability, then it may support editing of local file databases.

If the server supports the :candidate capability, then it will allow edits to the <candidate> database.

If the server supports the :writable-running capability, it will support edits to the <running> database.

It is not likely that a server will support the <candidate> and <running> database as targets at the same time, since changes to the <running> configuration would not be reflected in the <candidate> database, while it was being edited by a different session.

This command is provided by the NETCONF server, not yangcli-pro. Refer to the <edit-config> operation for parameter details.

Usage:

andy@myserver> edit-config target=candidate default-operation=merge test-option=test error-option=stop-on-error config=@myconfig.xml

RPC OK Reply 19 for session 10:

andy@myserver>

Reference:

elif

The 'elif' command is used to define a conditional command block after an if command.

This command must be entered within the same script as the if command, when used within a script. It can be used zero or more times within an if command sequence.

The 'expr' parameter is used to specify the XPath expression to test if the elif conditional block is true or false. A false block will be skipped and a true block will be executed. The command prompt will contain the string '[F]' while inside a false conditional block in interactive mode. This expression string should be entered with quotes to avoid misinterpreting any whitespace or special characters.

The 'docroot' parameter (if present) specifies the XML document that the 'expr' parameter should be evaluated against. This is optional, since only XPath path expressions need to refer to a document.

Even if the 'expr' expression is true, the conditional block will only be executed if no conditional block in the if command sequence has already been executed.

if command

  ....

[elif command]

  ....

[elif-command]

  ...

[else command]

  ...

end

The 'elif' command must be paired with a matching end command. It can also be continued with consecutive 'elif' statements.

+---x elif
   +---w input
      +---w expr       yang:xpath1.0
      +---w docroot?   <anyxml>

Command type:

local

Default parameter:

expr

Min parameters:

1

Max parameters:

2

Return type:

status

YANG file:

yangcli-pro.yang

Command Parameters:

  • expr

    • type: XPath expression string

    • usage: mandatory

    • default: none

    • This parameter specifies the XPath expression to determine if the following commands are within a true or false conditional block.

  • docroot

    • type: anyxml

    • usage: optional (typically a variable reference is used)

    • default: none

    • This parameter specifies the XML document that should be used if the expr XPath expression references any path nodes.

Positive Response:

  • the server returns <ok/>

Negative Response:

  • An error message will be printed if errors are detected locally.

    • elif without a previous if command will cause an error

    • elif following an 'else' command will cause an error

    • invalid XPath expression or invalid docroot reference will cause an error

Usage:

andy@myserver> elif expr='$x > 4'

andy@myserver>

else

The 'else' command is used to define a final conditional command block after an if command. It must eventually be terminated by a end command.

This command must be entered within the same script as the if command, when used within a script. It can be used zero or one time within an if command sequence.

if command

  ....

[elif command]

  ....

[elif-command]

  ...

[else command]

  ...

end

The conditional command block following the else command will only be executed if no conditional block has already been executed in the same if command sequence.

+---x else

Command type:

local

Default parameter:

none

Min parameters:

0

Max parameters:

0

Return type:

status

YANG file:

yangcli-pro.yang

Command Parameters: none

Positive Response:

  • the server returns <ok/>

Negative Response:

  • An error message will be printed if errors are detected locally.

    • else without a previous if command will cause an error

Usage:

> else

enable

The 'enable' command is used to enter enable mode.

This command is available in yp-shell and only if yp-shell is started with the --with-enable-mode parameter set to true.

+---x enable
   +---w input
      +---w (pass)?
         +--:(password)
         |  +---w password?      string
         +--:(no-password)
            +---w no-password?   empty

Command type:

local

Default parameter:

none

Min parameters:

0

Max parameters:

1

Return type:

none

YANG file:

yangcli-pro.yang

Command Parameters:

  • password

    • type: string (ncx:password)

    • usage: optional

    • default: none

    • This parameter specifies the password string to use to enter the enable mode.

  • no-password

    • type: empty

    • usage: optional

    • default: none

    • This parameter specifies that there is no password needed to enter the enable mode.

Usage:

server1> enable

server1# enable

enable-password

The 'enable-password' command is used to configure the password in config mode for yp-shell.

This command is available in yp-shell and only if yp-shell is started with the --with-enable-mode parameter set to true.

+---x enable-password
   +---w input
      +---w password    string

Command type:

config-mode

Default parameter:

password

Min parameters:

1

Max parameters:

1

Return type:

none

YANG file:

yangcli-pro.yang

Command Parameters:

  • password

    • type: string (ncx:password)

    • usage: optional

    • default: none

    • This parameter specifies the password string to use to enter the enable mode.

Usage:

server1> enable-password my-password

end

The 'end' command is used to terminate a conditional command block after an 'if' command block, or after a 'while' command block.

This command must be entered within the same script as the if or while command that started the conditional block.

if command

  ....

[elif command]

  ....

[elif-command]

  ...

[else command]

  ...

end


while command

   ...

end command
+---x end

Command type:

local

Default parameter:

none

Min parameters:

0

Max parameters:

0

Return type:

status

YANG file:

yangcli-pro.yang

Command Parameters: none

Positive Response:

  • the server returns <ok/>

Negative Response:

  • An error message will be printed if errors are detected locally.

    • else without a previous if command will cause an error

Usage:

> end

>

establish-subscription

The 'establish-subscription' command is used to start a notification subscription on the connected NETCONF server. The netconfd-pro server must have the yang-push bundle enabled for this operation to be available.

The server is expected to return the subscription-id if the operation succeeds.

This command is provided by the NETCONF server, not yangcli-pro. Refer to the <establish-subscription> operation for parameter details.

Usage:

session1> establish-subscription stream=mystream

RPC Data Reply 1 for session 3 [default]:

rpc-reply {
  id 1
}

server1>

eval

The 'eval' command is used to evaluate an XPath expression..

The 'expr' parameter is used to specify the XPath expression to evaluate. This expression string should be entered with quotes to avoid misinterpreting any whitespace or special characters.

The 'docroot' parameter (if present) specifies the XML document that the 'expr' parameter should be evaluated against. This is optional, since only XPath path expressions need to refer to a document.

+---x eval
   +---w input
   |  +---w expr       yang:xpath1.0
   |  +---w docroot?   <anyxml>
   +--ro output
      +--ro data    <anyxml>

Command type:

local

Default parameter:

expr

Min parameters:

1

Max parameters:

2

Return type:

data

YANG file:

yangcli-pro.yang

Command Parameters:

  • expr

    • type: XPath expression string

    • usage: mandatory

    • default: none

    • This parameter specifies the XPath expression to determine if the following commands are within a true or false conditional block.

  • docroot

    • type: anyxml

    • usage: optional (typically a variable reference is used)

    • default: none

    • This parameter specifies the XML document that should be used if the expr XPath expression references any path nodes.

Positive Response:

  • the server returns <ok/>

Negative Response:

  • An error message will be printed if errors are detected locally.

    • elif without a previous if command will cause an error

    • elif following an 'else' command will cause an error

    • invalid XPath expression or invalid docroot reference will cause an error

Output:

  • data

    • type: anyxml

    • This element will contain the result from the XPath expression. A node-set result will produce a complex element return value, and all other XPath result types will produce a string return value.

Usage:

session1> $x = eval '$x + 1'

session1> $sysname = eval '//sysName' docroot=$backup

event-handler-cfg

The 'event-handler-cfg' command is used to access a named event-handler.

There are 4 sub-commands:

  • delete

  • save

  • show (default)

  • create

+---x event-handler-cfg
    +---w input
       +---w (user-action)?
          +--:(show-case)
          |  +---w show?                 IdentifierOrZero
          |  +---w (help-mode)?
          |     +--:(brief)
          |     |  +---w brief?          empty
          |     +--:(normal)
          |     |  +---w normal?         empty
          |     +--:(full)
          |        +---w full?           empty
          +--:(delete)
          |  +---w delete?               nt:NcxIdentifier
          +--:(save)
          |  +---w save?                 nt:NcxIdentifier
          +--:(create)
             +---w create                nt:NcxName
             +---w module-name?          nt:NcxName
             +---w event-name?           nt:NcxName
             +---w (script-type)
                +--:(script)
                |  +---w script?         string
                +--:(shell-script)
                   +---w shell-script?   string

Command type:

local

Default parameter:

show

Min parameters:

1

Max parameters:

3

Return type:

status

YANG file:

yangcli-pro.yang

Capabilities needed:

none

Command Parameters:

  • delete

    • type: name string

    • This parameter specifies the name of the event-handler to delete from the saved event-handlers in memory.

  • save

    • type: name string

    • This parameter specifies the name of the event-handler to save in the saved event-handlers in memory.

  • show

    • This parameter specifies the name of the event-handler to show.

    • The --brief, --normal, or --full parameter can be used for this sub-command.

  • create

    • type: name string

    • This parameter specifies a new event-handler to create.

Positive Response:

  • A message indicating the save or delete was done will be printed. The show command will generate some formatted output showing information on the requested user.

Negative Response:

  • An error message will be printed if errors are detected locally.

event-handlers-cfg

The 'event-handlers-cfg' command is used to access the named event-handlers files.

There are 4 sub-commands:

  • clear

  • load

  • save

  • show (default)

+---x event-handlers-cfg
    +---w input
       +---w (event-handlers-action)?
          +--:(show-case)
          |  +---w show?           empty
          |  +---w (help-mode)?
          |     +--:(brief)
          |     |  +---w brief?    empty
          |     +--:(normal)
          |     |  +---w normal?   empty
          |     +--:(full)
          |        +---w full?     empty
          +--:(clear)
          |  +---w clear?          empty
          +--:(load)
          |  +---w load?           string
          +--:(save)
             +---w save?           string

Command type:

local

Default parameter:

show

Min parameters:

1

Max parameters:

2

Return type:

status

YANG file:

yangcli-pro.yang

Capabilities needed:

none

Command Parameters:

  • clear

    • type: empty

    • This parameter indicates that all saved event-handlers in memory be deleted. This cannot be done if any of the event-handlers are currently active. Use 'event-handlers-cfg load' to restore the saved users.

  • load

    • type: string

    • This parameter identifies the file specification for the saved event-handlers to load. Any new named event-handlers will be added to the named users in memory.

  • save

    • type: name string

    • This parameter identifies the file specification for the saved event-handlers config file to load. The saved event-handlers in memory will be saved to this file.

  • show

    • type: name string; default: empty string == all devices

eventlog

The 'eventlog' command is used to view or clear all or part of the notification event log. This log will be empty if no well-formed notifications have been received from any server.

The 'eventlog show' command is used to display some event log entries.

The 'eventlog clear' command is used to delete some event log entries.

If no parameters are entered, it is the same as entering eventlog show=-1.

The event log is not automatically emptied when a session terminates, in case the session was dropped unexpectedly. New entries will be appended to the event log as new sessions and/or subscriptions are started.

+---x eventlog
    +---w input
       +---w (eventlog-action)?
          +--:(show-case)
          |  +---w show?           LogCount
          |  +---w start?          LogIndex
          |  +---w (help-mode)?
          |     +--:(brief)
          |     |  +---w brief?    empty
          |     +--:(normal)
          |     |  +---w normal?   empty
          |     +--:(full)
          |        +---w full?     empty
          +--:(clear)
             +---w clear?          LogCount

Command type:

local

Default parameter:

show

Min parameters:

0

Max parameters:

3

Return type:

status

YANG file:

yangcli-pro.yang

Command Parameters:

  • choice eventlog-action (not entered):

    • type: choice of case 'show-case' or leaf 'clear'

    • usage: optional

    • default: show=-1 is used as the default if nothing entered

    • This parameter specifies the event log action that should be performed.

      • clear

        • type: int32 (-1 to clear all entries; 1 to max to delete N entries)

        • usage: optional

        • default: -1

        • This parameter specifies the maximum number of event log entries to be deleted, starting from the oldest entries in the event log. The value -1 means delete all the entries. Otherwise the value must be greater than zero, and up to that many entries will be deleted.

      • case show-case (not entered)

        • choice help-mode (not entered) (default choice is 'normal')

          • brief

            • type: empty

            • usage: optional

            • default: none

            • This parameter specifies that brief documentation mode should be used. The event log index, sequence ID, and <eventType> will be displayed in this mode.

          • normal

            • type: empty

            • usage: optional

            • default: none

            • This parameter specifies that normal documentation mode should be used. The event log index, <eventTime>, sequence ID, and <eventType> will be displayed in this mode.

          • full

            • type: empty

            • usage: optional

            • default: none

            • This parameter specifies that full documentation mode should be used. The event log index, <eventTime>, sequence ID, and <eventType> will be displayed in this mode. In addition, the entire contents of the notification PDU will be displayed, using the current $$display-mode setting.

        • show

          • type: int32 (-1 for all, 1 to max for N entries)

          • usage: optional

          • default: -1

          • This parameter specifies the number of event log entries that should be displayed. The value '-1' indicates all the entries should be displayed. Otherwise, the value must be greater than zero, indicating the number of entries to display.

        • start

          • type: uint32

          • usage: optional

          • default: 0

          • This parameter specifies the start position in the event log to start displaying entries. The first entry is number zero. Each time the event log is cleared, the numbering restarts.

System Variables:

  • $$display-mode

    • The log entries printed when help-mode='full' are formatted according to the current value of this system variable.

Positive Response:

  • the event log entries are printed or cleared as requested

Negative Response:

  • An error message will be printed if errors are detected.

Usage:

> eventlog show=5 start=3

 [3]     [2009-07-10T02:21:10Z] (4)     <sysSessionStart>
 [4]     [2009-07-10T02:23:14Z] (5)     <sysSessionEnd>
 [5]     [2009-07-10T02:23:23Z] (6)     <sysSessionStart>
 [6]     [2009-07-10T02:24:52Z] (7)     <sysConfigChange>
 [7]     [2009-07-10T02:24:57Z] (8)     <sysSessionEnd>

>

exit

This command is available in configuration mode only.

The 'exit' command is used to exit configuration editing mode or exit the current editing sub-mode if the configuration context node is not the root.

  • If the $$config-edit-mode system parameter is set to 'level', then this command will cause any pending edits to be applied to the current session.

  • If the $$config-edit-mode system parameter is set to 'line', then exiting from a sub-mode to the top-level configuration mode will cause any pending edits to be applied to the current session.

There are no parameters for this command.

+---x exit

Command type:

local

Default parameter:

none

Min parameters:

0

Max parameters:

0

Return type:

none (prompt is changed)

YANG file:

yangcli-pro.yang

Command Parameters:

  • none

System Variables:

  • none

Positive Response:

  • the prompt is changed to indicate the new level. If edits are applied a message will be displayed indicating edits were applied to the session.

Negative Response:

  • An error message will be printed if errors are detected.

Usage:

andy@myserver# exit

andy@myserver>

fill

The 'fill' command is used to create a user variable for reuse in other commands.

It is used in an assignment statement to create a variable from various sources.

If it is not used in an assignment statement, then the result will not be saved, so the command will have no effect in this case.

The value contents will mirror the subtree within the NETCONF database indicated by the target parameter. If not completely provided, then missing descendant nodes will be filled in interactively, by prompting for each missing node.

+---x fill
   +---w input
   |  +---w (target-parm)?
   |  |  +--:(target)
   |  |  |  +---w target           yang:xpath1.0
   |  |  +--:(urltarget-case)
   |  |     +---w urltarget        ywt:UrlPath
   |  |     +---w match-names?     ywt:NameMatchMode
   |  |     +---w alt-names?       ywt:AltNameMode
   |  |     +---w wildcard-keys?   boolean
   |  +---w optional?              empty
   |  +---w value?                 <anyxml>
   +--ro output
      +--ro data?   <anyxml>

Command type:

local

Default parameter:

target

Min parameters:

2

Max parameters:

3

Return type:

data

YANG file:

yangcli-pro.yang

Command Parameters:

  • optional

    • type: empty

    • usage: optional

    • default: controlled by $$optional system variable

    • This parameter controls whether optional nodes within the target will be filled in. It can be used to override the $$optional system variable, when it is set to 'false'.

  • target

    • type: string

    • usage: mandatory

    • default: none

    • This parameter specifies the database target node of the create operation. This is an ncx:schema-instance string, so any instance identifier, or absolute path expression, or something in between, is accepted.

  • value

    • type: anyxml

    • usage: mandatory

    • default: none

    • This parameter specifies the content to use for the filled variable.

      • If this parameter is not entered, then the user will be prompted interactively to fill in the 'target' data structure.

      • If a string is entered, then the target value being filled must be a leaf or leaf-list.

      • If a variable reference is entered, then it will be used as the content, if the target value being filled is a leaf or a leaf-list.

      • If the target value is a complex object, then the referenced variable must also be a complex object of the same type.

      • An error will be reported if the global or local variable does not reference the same object type as the target parameter.

System Variables:

  • $$optional

    • Controls whether optional descendant nodes will be filled into the 'target' parameter contents

Positive Response:

  • OK

Negative Response:

  • An error message will be printed if errors are detected.

Output:

  • data

    • type: anyxml

    • The data structure will mirror the requested target object.

    • The variable (if any) will retain the target object name and namespace so it can be used in other operations more easily. In the example below, the '$my_interface' local variable will have the module name 'interfaces' and name 'interface', when used in other commands such as create or merge.

Usage:

> $my-interface = fill target=/interfaces/interface optional

(user will be prompted to fill in all fields of the <interface> element)

OK

>

get

The 'get' command is used to retrieve data from the server. This command is provided by the NETCONF server, not yangcli-pro.

The 'module-tag' parameter is only supported if netconfd-pro is the server used.

This command is provided by the NETCONF server, not yangcli-pro. Refer to the <get> operation for parameter details.

Usage:

session1> get

RPC Data Reply 20 for session 10:

rpc-reply {
    data {
       …. data returned by the server
    }
}

session1> get filter=@myfilter.xml

RPC Data Reply 21 for session 10:

rpc-reply {
    data {
    }
}

(the previous response will occur if the filter did not
 match anything or the server access control filtered the
 entire response)

session1>

Reference:

get-bulk

The 'get-bulk' command is used to retrieve YANG list data one or more entries at a time.

This command is provided by the NETCONF server, not yangcli-pro. Refer to the <get-bulk> operation for parameter details.

Usage:

Reference:

  • none

get-config

The 'get-config' command is used to retrieve configuration data from the server.

The 'module-tag' parameter is only supported if netconfd-pro is the server used.

This command is provided by the NETCONF server, not yangcli-pro. Refer to the <get-config> operation for parameter details.

Usage:

session1>  $my-config = get-config target=running

RPC Data Reply 22 for session 10:

rpc-reply {
    data {
       …. entire database returned by the server
    }
}

yangcli-pro andy@myserver[d]> @saved-config.xml = get-config \
        [email protected]  \
        target=candidate

rpc-reply {
    data {
        … data requested by the filter
    }
}

session1>

Reference:

get-data

The get-data command is used to retrieve configuration or operational NMDA datastores from the server. The server must have NMDA enabled for this operation to be present.

This command is provided by the NETCONF server, not yangcli-pro. Refer to the <get-data> operation for parameter details.

Usage:

Reference:

get-locks

The 'get-locks' command is a high-level wrapper for the <lock> operation. It is used to lock all the databases (<running> plus <candidate> and/or <startup> if they exist). If all the locks cannot be obtained, then release all the locks that were obtained (all-or-nothing).

The entire time to wait for a lock in use is set with the lock-timeout parameter.

The retry-interval parameter is used when the <lock> operation fails with a 'lock-denied' error-tag, because some other session has the lock.

If the <candidate> cannot be locked for another reason, a <discard-changes> operation will be attempted to clear any leftover edits.

Normally, the errors received while attempting to acquire locks are not printed to the log, like normal commands. Instead, if $$log-level system parameter is set to 'debug2' or 'debug3', then these messages will be printed.

+---x get-locks
    +---w input
       +---w lock-timeout?     nt:Timeout
       +---w retry-interval?   uint32
       +---w cleanup?          boolean

Command type:

remote

Default parameter:

none

Min parameters:

0

Max parameters:

3

Return type:

status

YANG file:

yangcli-pro.yang

Command Parameters:

  • lock-timeout

    • type: uint32 (seconds)

    • usage: optional

    • default: 120 seconds (2 minutes)

    • This parameter specifies how long to wait for a lock that is in use by another session.

  • retry-interval

    • type: uint32 (seconds)

    • usage: optional

    • default: 2 seconds

    • This parameter specifies how long to wait to retry for a lock.

  • cleanup

    • type:boolean

    • usage: optional

    • default: true

    • This parameter controls whether the 'release-locks' command will be called automatically if the entire set of required locks cannot be granted.

Positive Response:

  • the server returns <ok/>

Negative Response:

  • An error message will be printed if errors are detected locally.

  • An <rpc-error> message will be printed if the server detected an error.

Usage:

session1> get-locks lock-timeout=0

Sending <lock> operations for get-locks...

RPC OK Reply 6 for session 23:

RPC OK Reply 7 for session 23:

get-locks finished OK

session1>

get-my-session

The 'get-my-session' command is used to retrieve the session customization parameters from the server. It is only supported by the netconfd-pro server.

The session indent amount, session line size, and default behavior for the with-defaults parameter can be controlled at this time.

This command is provided by the NETCONF server, not yangcli-pro. Refer to the <get-my-session> operation for parameter details.

get-schema

The 'get-schema' command is used to retrieve data model definition files from the server. This is part of the NETCONF monitoring draft. The server must support the :schema-retrieval capability to use this command.

If the server reports a module or module version that yangcli-pro cannot find in its local module library, then an error message will be printed. The get-schema command can then be used to retrieve the missing module from the server.

The ietf-netconf-monitoring.yang module includes a list of the schema supported by the server, which can be retrieved from a server that supports this module, such as netconfd-pro.

This command is provided by the NETCONF server, not yangcli-pro. Refer to the <get-schema> operation for parameter details.

Usage:

session1> @notifications.yang = get-schema \
        identifier=notifications \
        version=2009-06-04 \
        format=YANG

RPC Data Reply 24 for session 10:

rpc-reply {
    data {
       …. entire notifications.yang contents
    }
}

(after retrieval, the module can be loaded locally
 with the mgrload command)

session1> mgrload notifications.yang

   OK

session1>

Reference:

get-walk

This command walks the entries of a YANG list using the netconfd-pro <get-bulk> operation. This command will send <get-bulk> requests to the server until the entire list has been retrieved or the user quits the walk.

If the yumaworks-getbulk.yang module is not supported by the server then this command will not be attempted.

If the program is in interactive mode, then after each retrieval, the user will be prompted to continue or quit the walk. In batch mode the entries will be displayed until the walk terminates.

The server will wait the normal 'timeout' period after each request. It will display each response and check it for 'last-keys' data. If present, these values will be used for the 'last-keys' parameter in the next request If not present, then the walk will end.

The walk will be done on the YANG list specified by the 'list-target' parameter. Each retrieval will request 1 or more entries, based on the 'count' parameter. The data returned can be filtered according to the 'content', 'depth', 'with-defaults', and 'list-test' parameters, which as passed to the <get-bulk> operation each time.

The 'list-target' parameter is used to specify that YANG list that will be retrieved.

The 'list-test' parameter allows an XPath boolean expression to be used to test each list-target entry. It is used to select only a subset of the list entries to reduce the number of entries returned.

If a portion of the requested data is not available due to access control restrictions, then that data is silently dropped from the <rpc-reply> message. It is implicitly understood that the client is only requesting data for which it is authorized to receive, in the event such data is selected in the request.

+---x get-walk
   +---w input
      +---w datastore?       enumeration
      +---w list-target      string
      +---w count?           uint32
      +---w content?         enumeration
      +---w depth?           union
      +---w with-defaults?   with-defaults-mode
      +---w list-test?       yang:xpath1.0
      +---w fixed-keys?      <anydata>

Command type:

remote

Default parameter:

none

Min parameters:

1

Max parameters:

7

Return type:

data

YANG file:

yangcli-pro.yang

Capabilities needed:

none

Mandatory Parameters:

  • list-target

    • type: string (RESTCONF path URI)

    • usage: mandatory

    • This parameter identifies the list object that is being retrieved. This must be a path expression used to represent a list data node. It is formatted like a RESTCONF path expression, except module names are not mandatory if they are unique.

Optional Parameters:

  • datastore

    • type: enumeration (candidate running startup)

    • usage: optional

    • default: running

    • This parameter specifies the name of the source database for the retrieval operation. It is ignored if the 'list-target' specifies a non-configuration data node.

    • enum: candidate

    • enum : running

      • capabilities needed: none

    • enum: startup

  • count

    • type: unint32

    • usage: optional

    • default: 1

    • The maximum number of list entries to return.

  • content

    • type: enumeration

    • usage: optional

    • default: all

    • This parameter specifies which type of content to include, exactly the same as the RESTCONF “content” query parameter

      • enum: config

        • Include only config=true descendant data nodes

      • enum: nonconfig

        • include only config=false descendant data nodes

      • enum: all

        • include all descendant data nodes

  • depth

    • type: uint16 or “unbounded”

    • usage: optional

    • default: unbounded

    • This parameter is used as defined in the RESTCONF protocol. The value '1' is associated with the list-object node itself. This value can be used to simply test for the existence of any instances of the list-object.

  • with-defaults

    • type: enumeration (none report-all report-all-tagged trim explicit)

    • usage: --default-style configuration parameter used as the default if no value is provided

    • This parameter controls how default leaf and leaf-list nodes are returned by the server.

  • list-test

    • type: leaf containing an XPath expression

    • usage: optional

    • default: return all selected list-target entries

    • This parameter contains an XPath expression. The document root and the context node are set to the list instance being tested.

Example to continue walk.

andy@server> get-walk count=5 list-target=/modules-state/module \
        list-test="starts-with(name, 'ietf-netconf')" \
        content=all datastore=running depth=unbounded

rpc-reply {
  bulk {
    data {
      module {
        conformance-type implement
        feature candidate
        feature confirmed-commit
        feature rollback-on-error
        feature validate
        feature url
        feature xpath
        name ietf-netconf
        namespace urn:ietf:params:xml:ns:netconf:base:1.0
        revision 2011-06-01
      }
      module {
        conformance-type implement
        name ietf-netconf-acm
        namespace urn:ietf:params:xml:ns:yang:ietf-netconf-acm
        revision 2018-02-14
        schema http://localhost/restconf/yang/ietf-netconf-acm/2018-02-14
      }
      module {
        conformance-type implement
        name ietf-netconf-monitoring
        namespace urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring
        revision 2010-10-04
        schema http://localhost/restconf/yang/ietf-netconf-monitoring/2010-10-04
      }
      module {
        conformance-type implement
        name ietf-netconf-notifications
        namespace urn:ietf:params:xml:ns:yang:ietf-netconf-notifications
        revision 2012-02-06
        schema http://localhost/restconf/yang/ietf-netconf-notifications/2012-02-06
      }
      module {
        conformance-type implement
        name ietf-netconf-partial-lock
        namespace urn:ietf:params:xml:ns:netconf:partial-lock:1.0
        revision 2009-10-19
        schema http://localhost/restconf/yang/ietf-netconf-partial-lock/2009-10-19
      }
    }
    last-keys {
      name ietf-netconf-partial-lock
      revision 2009-10-19
    }
  }
}

Press Enter to continue, q to quit get-walk:

rpc-reply {
  bulk {
    data {
      module {
        conformance-type implement
        name ietf-netconf-with-defaults
        namespace urn:ietf:params:xml:ns:yang:ietf-netconf-with-defaults
        revision 2011-06-01
        schema http://localhost/restconf/yang/ietf-netconf-with-defaults/2011-06-01
      }
      module {
        conformance-type implement
        name ietf-restconf
        namespace urn:ietf:params:xml:ns:yang:ietf-restconf
        revision 2017-01-26
        schema http://localhost/restconf/yang/ietf-restconf/2017-01-26
      }
      module {
        conformance-type implement
        name ietf-restconf-monitoring
        namespace urn:ietf:params:xml:ns:yang:ietf-restconf-monitoring
        revision 2017-01-26
        schema http://localhost/restconf/yang/ietf-restconf-monitoring/2017-01-26
      }
      module {
        conformance-type implement
        name ietf-yang-library
        namespace urn:ietf:params:xml:ns:yang:ietf-yang-library
        revision 2016-06-21
        schema http://localhost/restconf/yang/ietf-yang-library/2016-06-21
      }
      module {
        conformance-type implement
        name ietf-yang-patch
        namespace urn:ietf:params:xml:ns:yang:ietf-yang-patch
        revision 2017-02-22
        schema http://localhost/restconf/yang/ietf-yang-patch/2017-02-22
      }
    }
    last-keys {
      name ietf-yang-patch
      revision 2017-02-22
    }
  }
}

Press Enter to continue, q to quit get-walk:

rpc-reply {
  bulk {
    data {
      module {
        conformance-type import
        name ietf-yang-types
        namespace urn:ietf:params:xml:ns:yang:ietf-yang-types
        revision 2013-07-15
        schema http://localhost/restconf/yang/ietf-yang-types/2013-07-15
      }
      module {
        conformance-type implement
        name nc-notifications
        namespace urn:ietf:params:xml:ns:netmod:notification
        revision 2008-07-14
        schema http://localhost/restconf/yang/nc-notifications/2008-07-14
      }
      module {
        conformance-type implement
        name notifications
        namespace urn:ietf:params:xml:ns:netconf:notification:1.0
        revision 2013-03-15
        schema http://localhost/restconf/yang/notifications/2013-03-15
      }
      module {
        conformance-type implement
        name yang-data-ext
        namespace urn:ietf:params:xml:ns:yang:yang-data-ext
        revision 2017-07-03
        schema http://localhost/restconf/yang/yang-data-ext/2017-07-03
      }
      module {
        conformance-type import
        name yuma-app-common
        namespace http://netconfcentral.org/ns/yuma-app-common
        revision 2017-07-25
        schema http://localhost/restconf/yang/yuma-app-common/2017-07-25
      }
    }
    last-keys {
      name yuma-app-common
      revision 2017-07-25
    }
  }
}
Press Enter to continue, q to quit get-walk:

rpc-reply {
  bulk {
    data {
      module {
        conformance-type implement
        name yuma-ncx
        namespace http://netconfcentral.org/ns/yuma-ncx
        revision 2015-10-16
        schema http://localhost/restconf/yang/yuma-ncx/2015-10-16
      }
      module {
        conformance-type implement
        name yuma-system
        namespace http://netconfcentral.org/ns/yuma-system
        revision 2013-07-15
        schema http://localhost/restconf/yang/yuma-system/2013-07-15
      }
      module {
        conformance-type implement
        name yuma-time-filter
        namespace http://netconfcentral.org/ns/yuma-time-filter
        revision 2012-11-15
        schema http://localhost/restconf/yang/yuma-time-filter/2012-11-15
      }
      module {
        conformance-type import
        name yuma-types
        namespace http://netconfcentral.org/ns/yuma-types
        revision 2015-09-25
        schema http://localhost/restconf/yang/yuma-types/2015-09-25
      }
      module {
        conformance-type import
        name yumaworks-app-common
        namespace http://yumaworks.com/ns/yumaworks-app-common
        revision 2018-06-26
        schema http://localhost/restconf/yang/yumaworks-app-common/2018-06-26
      }
    }
    last-keys {
      name yumaworks-app-common
      revision 2018-06-26
    }

Press Enter to continue, q to quit get-walk:

rpc-reply {
  bulk {
    data {
      module {
        conformance-type implement
        name yumaworks-event-filter
        namespace http://yumaworks.com/ns/yumaworks-event-filter
        revision 2014-02-09
        schema http://localhost/restconf/yang/yumaworks-event-filter/2014-02-09
      }
      module {
        conformance-type implement
        name yumaworks-getbulk
        namespace http://yumaworks.com/ns/yumaworks-getbulk
        revision 2018-04-06
        schema http://localhost/restconf/yang/yumaworks-getbulk/2018-04-06
      }
      module {
        conformance-type implement
        name yumaworks-ids
        namespace http://yumaworks.com/ns/yumaworks-ids
        revision 2014-07-12
        schema http://localhost/restconf/yang/yumaworks-ids/2014-07-12
      }
      module {
        conformance-type implement
        name yumaworks-restconf
        namespace urn:ietf:params:xml:ns:yang:yumaworks-restconf
        revision 2017-07-03
        schema http://localhost/restconf/yang/yumaworks-restconf/2017-07-03
      }
      module {
        conformance-type implement
        name yumaworks-support-save
        namespace urn:ietf:params:xml:ns:yang:yumaworks-support-save
        revision 2017-07-27
        schema http://localhost/restconf/yang/yumaworks-support-save/2017-07-27
      }
    }
    last-keys {
      name yumaworks-support-save
      revision 2017-07-27
    }
  }
}

Press Enter to continue, q to quit get-walk:

rpc-reply {
  bulk {
    data {
      module {
        conformance-type implement
        name yumaworks-system
        namespace http://yumaworks.com/ns/yumaworks-system
        revision 2019-01-22
        schema http://localhost/restconf/yang/yumaworks-system/2019-01-22
      }
      module {
        conformance-type implement
        name yumaworks-templates
        namespace http://yumaworks.com/ns/yumaworks-templates
        revision 2017-02-20
        schema http://localhost/restconf/yang/yumaworks-templates/2017-02-20
      }
      module {
        conformance-type import
        name yumaworks-types
        namespace http://yumaworks.com/ns/yumaworks-types
        revision 2018-05-03
        schema http://localhost/restconf/yang/yumaworks-types/2018-05-03
      }
    }
    last-keys {
      name yumaworks-types
      revision 2018-05-03
    }
  }
}

Press Enter to continue, q to quit get-walk:

rpc-reply {
  bulk {
    data
  }
}

get-walk has completed.
andy@server>

Example to quit walk.

andy@server> get-walk count=5 list-target=/modules-state/module \
        list-test="starts-with(name, 'ietf-netconf')" \
        content=all datastore=running   depth=unbounded

rpc-reply {
  bulk {
    data {
      module {
        conformance-type implement
        feature candidate
        feature confirmed-commit
        feature rollback-on-error
        feature validate
        feature url
        feature xpath
        name ietf-netconf
        namespace urn:ietf:params:xml:ns:netconf:base:1.0
        revision 2011-06-01
      }
      module {
        conformance-type implement
        name ietf-netconf-acm
        namespace urn:ietf:params:xml:ns:yang:ietf-netconf-acm
        revision 2018-02-14
        schema http://localhost/restconf/yang/ietf-netconf-acm/2018-02-14
      }
      module {
        conformance-type implement
        name ietf-netconf-monitoring
        namespace urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring
        revision 2010-10-04
        schema http://localhost/restconf/yang/ietf-netconf-monitoring/2010-10-04
      }
      module {
        conformance-type implement
        name ietf-netconf-notifications
        namespace urn:ietf:params:xml:ns:yang:ietf-netconf-notifications
        revision 2012-02-06
        schema http://localhost/restconf/yang/ietf-netconf-notifications/2012-02-06
      }
      module {
        conformance-type implement
        name ietf-netconf-partial-lock
        namespace urn:ietf:params:xml:ns:netconf:partial-lock:1.0
        revision 2009-10-19
        schema http://localhost/restconf/yang/ietf-netconf-partial-lock/2009-10-19
      }
    }
    last-keys {
      name ietf-netconf-partial-lock
      revision 2009-10-19
    }
  }
}

Press Enter to continue, q to quit get-walk:q

andy@server>

gotop

This command is available in configuration mode only.

Note

This command is available starting in the 22.10T-4 release

The 'gotop' command is used to exit the current editing sub-mode and return to the top-level, remaining in configuration mode. If the context already is the top-level then this command has no affect.

If the $$config-edit-mode system parameter is set to 'level', then returning to the top-level from a sub-mode mode will cause any pending edits to be applied to the current session.

There are no parameters for this command.

+---x gotop

Command type:

local

Default parameter:

none

Min parameters:

0

Max parameters:

0

Return type:

none (prompt is changed)

YANG file:

yangcli-pro.yang

Command Parameters:

  • none

System Variables:

  • none

Positive Response:

  • the prompt is changed to indicate the new level. If edits are applied a message will be displayed indicating edits were applied to the session.

Negative Response:

  • An error message will be printed if errors are detected.

Usage:

Example: no edits pending

mysession(interface)# gotop
mysession#

Example: 1 edit pending

mysession(interface)# gotop

Applying 1 edit

mysession#

group

The 'group' command is used to manage the session groups. Refer to the NETCONF Group Configuration section for details on the format of this file.

There are 7 sub-commands:

  • create

  • add

  • delete

  • remove

  • list

  • show

  • connect

+---x group
   +---w input
      +---w (groupcmd)
      |  +--:(connect)
      |  |  +---w connect?              nt:NcxIdentifier
      |  |  +---w missing-ok?           boolean
      |  |  +---w missing-connect-ok?   boolean
      |  |  +---w lost-ok?              boolean
      |  |  +---w reconnect-tries?      uint32
      |  |  +---w reconnect-interval?   uint32
      |  +--:(create-case)
      |  |  +---w create?               nt:NcxIdentifier
      |  +--:(delete-case)
      |  |  +---w delete?               nt:NcxIdentifier
      |  +--:(add-case)
      |  |  +---w add?                  nt:NcxIdentifier
      |  +--:(remove-case)
      |  |  +---w remove?               nt:NcxIdentifier
      |  +--:(show-case)
      |  |  +---w show?                 nt:NcxIdentifier
      |  +--:(list-case)
      |     +---w list?                 empty
      +---w session*                    nt:NcxIdentifier

Command type:

local

Default parameter:

none

Min parameters:

1

Max parameters:

6

Return type:

status

YANG file:

yangcli-pro.yang

Capabilities needed:

none

Command Parameters:

  • create

    • type: group name string

    • This parameter indicates the name of the group to create. The 'session' parameter must also be present. The session cannot be currently active.

  • add

    • type: group name string

    • This parameter indicates the name of the group to add specified sessions. The 'session' parameter must also be present. The session cannot be currently active.

  • delete

    • type: group name string

    • An active group cannot be deleted.

  • remove

    • type: group name string

    • This parameter specifies the name of the session to delete from the group in memory. An active session cannot be deleted.

  • show

    • type: group name string

    • This parameter specifies the name of the group to show.

  • list

    • type: empty

    • List the names of all the groups.

  • connect

    • type: name string

    • This parameter specifies the name of the group to connect.

  • missing-ok

    • type: boolean

    • If true, then it is OK to manage this group if 1 or more sessions identified in the session leaf-list are not found in the session list. The default is to require all session names to exist in the session list for the group to be used.

  • missing-connect-ok

    • type: boolean

    • If true, then it is OK to manage this group if 1 or more sessions identified in the session leaf-list are not found in the session list. The default is to require all sessions to connect OK for the group to be used.

  • lost-ok

    • type: boolean

    • If true, then it is OK to manage this group if 1 or more sessions are lost after connection is made. The default is to require all sessions to remain connected for the group to be used.

  • reconnect-tries

    • type: uint32

    • This parameter Indicates the number of times yangcli will attempt to reconnect to a session if the server becomes unreachable. The default is 5 tries.

  • reconnect-interval

    • type: uint32

    • This parameter indicates the number of seconds yangcli will wait to re-establish a connection if a session is dropped and the server becomes unreachable. The default is 10 seconds. units: seconds

Positive Response:

  • An group is started and the prompt changes to >AB

Negative Response:

  • One or more error messages will be printed.

Example 'group' commands:

> group list
No groups found

> group create=AB session-A

> group list

Group 'AB'
   This group is not connected.
   missing-ok: false
   missing-connect-ok: false
   lost-ok: false
   reconnect-interval: 30
   reconnect-tries: 5
   connected_cnt: 0
   number_of_sessions: 1
   Session 'session-A' connected:false >

> group add=AB session-B

> group list

Group 'AB'
   This group is not connected.
   missing-ok: false
   missing-connect-ok: false
   lost-ok: false
   reconnect-interval: 30
   reconnect-tries: 5
   connected_cnt: 0
   number_of_sessions: 2
   Session 'session-A' connected:false
   Session 'session-B' connected:false

> group remove=AB session=session-A

> group list

Group 'AB'
   This group is not connected.
   missing-ok: false
   missing-connect-ok: false
   lost-ok: false
   reconnect-interval: 30
   reconnect-tries: 5
   connected_cnt: 0
   number_of_sessions: 1
   Session 'session-B' connected:false

> group delete=AB

> group list
No groups found

>group connect=AB
Error: group 'AB' not found

> group create=AB session=session-A session=session-B

> group list

Group 'AB'
   This group is not connected.
   missing-ok: false
   missing-connect-ok: false
   lost-ok: false
   reconnect-interval: 30
   reconnect-tries: 5
   connected_cnt: 0
   number_of_sessions: 2
   Session 'session-A' connected:false
   Session 'session-B' connected:false

> group connect=AB

yangcli-pro: Starting NETCONF session for trshue on localhost over ssh on port 830

NETCONF session established for trshue on localhost

Client Session Id: 1
Server Session Id: 13
Server Protocol Capabilities
   base:1.0
   candidate:1.0
   confirmed-commit:1.0
   rollback-on-error:1.0
------
------
about to send <get>:on Group of 'AB' Session of 'session-A'
yangcli-pro: Starting NETCONF session for trshue on localhost over ssh on port 830

NETCONF session established for trshue on localhost
Client Session Id: 2
Server Session Id: 14
Server Protocol Capabilities
base:1.0
candidate:1.0
------

AB> get-my-session
about to send <get-my-session>:on Group of 'AB' Session of 'session-A'
about to send <get-my-session>:on Group of 'AB' Session of 'session-B'

RPC Data Reply 3 for session 13 [session-A]:
rpc-reply {
  indent 2
  linesize 72
  with-defaults explicit
  message-indent -1
}

RPC Data Reply 2 for session 14 [session-B]:
rpc-reply {
  indent 2
  linesize 72
  with-defaults explicit
  message-indent -1
}
AB>

AB> set-my-session indent=8 linesize=68 with-defaults=report-all message-indent=-1

about to send <set-my-session>:on Group of 'AB' Session of 'session-A'
about to send <set-my-session>:on Group of 'AB' Session of 'session-B'
RPC OK Reply 4 for session 13 [session-A]:
RPC OK Reply 5 for session 14 [session-B]:

AB> get-my-session
about to send <get-my-session>:on Group of 'AB' Session of 'session-A'
about to send <get-my-session>:on Group of 'AB' Session of 'session-B'

RPC Data Reply 3 for session 13 [session-A]:
rpc-reply {
  indent 8
  linesize 68
  with-defaults repo
  message-indent -1
}

RPC Data Reply 2 for session 14 [session-B]:
rpc-reply {
  indent 8
  linesize 68
  with-defaults repo
  message-indent -1
}

AB>

help

The help command is used to print documentation to STDOUT.

If no session is active, then only help for the local commands and the standard NETCONF commands will be available.

If a NETCONF session is active, then the documentation shown will attempt to exactly match the capabilities of the server.

If additional (i.e., augment generated) parameters are available, then they will be shown in the command output. If the server does not implement some parameters (e.g., feature not supported) then these parameters will not be shown in the command output.

If the server has modified an object with deviation statements, then the altered object will be shown.

The ncx:hidden extension suppresses the 'help' command. If this extension is present in the YANG definition associated with the request, then no help will be available for that object or command.

+---x help
    +---w input
       +---w (helptype)?
       |  +--:(command)
       |  |  +---w command?        nt:NcxIdentifier
       |  +--:(commands)
       |  |  +---w commands?       empty
       |  +--:(notification)
       |  |  +---w notification?   nt:NcxIdentifier
       |  +--:(object)
       |  |  +---w object?         union
       |  +--:(type)
       |     +---w type?           nt:NcxIdentifier
       +---w (help-mode)?
          +--:(brief)
          |  +---w brief?          empty
          +--:(normal)
          |  +---w normal?         empty
          +--:(full)
             +---w full?           empty

Command type:

local

Default parameter:

command

Min parameters:

3

Max parameters:

3

Return type:

data

YANG file:

ietf-netconf-monitoring.yang

Capabilities needed:

:schema-retrieval

Command Parameters:

  • choice helptype (not entered)

    • command

      • type: string

      • usage: mandatory

      • default: none

      • This parameter specifies the name of the command for which documentation is requested

    • commands

      • type: empty

      • usage: mandatory

      • default: none

      • This parameter will request documentation for all available commands

    • notification

      • type: string

      • usage: mandatory

      • default: none

      • This parameter specifies the name of the notification for which documentation is requested

    • object

      • type: string

      • usage: mandatory

      • Only top-level typedefs are supported by this command. Local typedefs within groupings, containers, or lists are not exportable in YANG.

      • default: none

      • This parameter specifies the name of the NETCONF database object for which documentation is requested.

        • Only top level objects are supported by this command.

        • Documentation for the entire object subtree will be printed, if the object is a container, choice, or list.

        • Documentation for nested objects is only available in parameter mode, using the escape commands for help ('?') and full help ('??')

    • type

      • type: string

      • usage: mandatory

      • default: none

      • This parameter specifies the name of the YANG typedef for which documentation is requested

  • choice help-mode (not entered) (default choice is 'normal')

    • brief

      • type: empty

      • usage: optional

      • default: none

      • This parameter specifies that brief documentation mode should be used.

    • normal

      • type: empty

      • usage: optional

      • default: none

      • This parameter specifies that normal documentation mode should be used.

    • full

      • type: empty

      • usage: optional

      • default: none

      • This parameter specifies that full documentation mode should be used.

Positive Response:

  • the server prints the requested help text

Negative Response:

  • An error message will be printed if errors are detected.

Usage:

> help help full

help
   Print the yangcli-pro help text
   input
      default parameter: command
      choice helptype
         leaf command [NcxIdentifier]
            Show help for the specified command,
            also called an RPC method

         leaf commands [empty]
            Show info for all local commands

         leaf notification [NcxIdentifier]
            Show help for the specified notification

         leaf object [NcxIdentifier]
            Show help for the specified object

         leaf type [NcxIdentifier]
            Show help for the specified type

      choice help-mode
         leaf brief [empty]
            Show brief help text

         leaf normal [empty]
            Show normal help text

         leaf full [empty]
            Show full help text

andy@myserver> help notification sysConfigChange

notification sysConfigChange
   Generated when the <running> configuration is changed.
   leaf userName [string]

   leaf sessionId [SessionId]
      range: 1..max

   leaf remoteHost [ip-address]

   leaf target [string]

   leaf operation [EditOperationType] [d:merge]
      enum values: merge replace create delete

andy@svnserver>

history

The 'history' command is used to show, clear, load, or save the command line history buffer.

Use the recall command to recall a previously executed command line, after getting the line number from the 'history show' command.

All lines entered will be saved in the history buffer except an ncx:password value entered in parameter mode.

When yangcli-pro starts, the command line history buffer is empty. If a history file was previously stored with the 'history save' command, then it can be recalled into the buffer with the 'history load' command. This is done automatically if the --autohistory parameter is set to 'true'.

The 'history clear' command is used to delete the entire command line history buffer.

The 'history save' command is used to save the history to the history file. This is done automatically when yangcli-pro exits, if the --autohistory parameter is set to 'true'.

The numbering sequence for commands, starts from zero and keeps incremented until the program exits. If the history buffer is cleared, then the number sequence will continue, not start over at zero.

+---x history
   +---w input
      +---w (history-action)?
         +--:(show-case)
         |  +---w show?           LogCount
         |  +---w (help-mode)?
         |     +--:(brief)
         |     |  +---w brief?    empty
         |     +--:(normal)
         |     |  +---w normal?   empty
         |     +--:(full)
         |        +---w full?     empty
         +--:(clear)
         |  +---w clear?          empty
         +--:(load)
         |  +---w load?           string
         +--:(save)
            +---w save?           string

Command type:

local

Default parameter:

show

Min parameters:

0

Max parameters:

2

Return type:

data

YANG file:

yangcli-pro.yang

Command Parameters:

  • choice history-action (not entered)

    • clear

      • type: empty

      • usage: optional

      • default: none

      • This parameter specifies that the history buffer should be cleared. Unless the contents have been saved with the history save command, there is no way to recover the cleared buffer contents after this command is executed.

    • load

      • type: string

      • usage: optional

      • default: $HOME/.yangcli-pro_history

      • This parameter specifies a command history file, and causes the current command line history contents to be loaded from that file.

      • Special processing for this command allows the history file to be omitted in idle mode, even though the load parameter is not type 'empty'.

        > history load
        
        same as:
        
        > history load=$HOME/.yangcli-pro_history
        
    • save

      • type: string

      • usage: optional

      • default: $HOME/.yangcli-pro_history

      • This parameter specifies a command history file, and causes the current command line history contents to be saved to that file.

      • Special processing for this command allows the history file to be omitted in idle mode, even though the save parameter is not type 'empty'.

        > history save
        
        same as:
        
        > history save=$HOME/.yangcli-pro_history
        
    • show

      • type: int32 (-1 for all entries; 1..max for N entries)

      • usage: optional

      • default: -1

      • This parameter specifies the maximum number of history entries to show.

        • If no case is selected from this choice, then the command 'history show=-1' will be used by default.

        • The help-mode choice parameter is only used with the 'history show' command.

          • If the --brief or --normal modes are selected the the format will include the command number and the command line.

          • If the --full mode is selected, then the command data and time will also be printed.

Positive Response:

  • the requested history entries will be printed for the 'history show' command

  • all other commands will return OK

Negative Response:

  • An error message will be printed if errors are detected.

Usage:

> history show=3 full
  [27]  2009-07-04 09:25:34 sget /system --nofill
  [28]  2009-07-04 09:34:17 @myconfig = get-config source=running
  [29]  2009-07-04 09:43:54 history show=3 full

> history save=~/my-temp-history-file
   OK
>

if

The 'if' command is used to start a conditional command block.

The 'expr' parameter is used to specify the XPath expression to test if the if conditional block is true or false. A false block will be skipped and a true block will be executed. The command prompt will contain the string '[F]' while inside a false conditional block in interactive mode. This expression string should be entered with quotes to avoid misinterpreting any whitespace or special characters.

The 'docroot' parameter (if present) specifies the XML document that the 'expr' parameter should be evaluated against. This is optional, since only XPath path expressions need to refer to a document.

If the 'expr' expression is true, the conditional block will be executed, and no further conditional blocks within the same if command sequence will be executed.

if command

  ....

[elif command]

  ....

[elif-command]

  ...

[else command]

  ...

end

The 'if' command must be paired with a matching end command. It can also be continued with consecutive elif statements or one else statement.

+---x if
   +---w input
      +---w expr       yang:xpath1.0
      +---w docroot?   <anyxml>

Command type:

local

Default parameter:

expr

Min parameters:

1

Max parameters:

2

Return type:

status

YANG file:

yangcli-pro.yang

Command Parameters:

  • expr

    • type: XPath expression string

    • usage: mandatory

    • default: none

    • This parameter specifies the XPath expression to determine if the following commands are within a true or false conditional block.

  • docroot

    • type: anyxml

    • usage: optional (typically a variable reference is used)

    • default: none

    • This parameter specifies the XML document that should be used if the expr XPath expression references any path nodes.

Positive Response:

  • the server returns <ok/>

Negative Response:

  • An error message will be printed if errors are detected locally.

    • invalid XPath expression or invalid docroot reference will cause an error

Usage:

andy@myserver> if "$sysname = 'localhost'"

andy@myserver>

insert

The 'insert' command is used to insert or move YANG list or leaf-list data into a NETCONF database. It is a high level command with utilizes the YANG 'insert' extensions to the NETCONF <edit-config> operation.

+---x insert
   +---w input
      +---w (from)
      |  +--:(varref)
      |  |  +---w varref?                string
      |  +--:(from-cli)
      |     +---w (target-parm)?
      |     |  +--:(target)
      |     |  |  +---w target           yang:xpath1.0
      |     |  +--:(urltarget-case)
      |     |     +---w urltarget        ywt:UrlPath
      |     |     +---w match-names?     ywt:NameMatchMode
      |     |     +---w alt-names?       ywt:AltNameMode
      |     |     +---w wildcard-keys?   boolean
      |     +---w optional?              empty
      |     +---w value?                 <anyxml>
      +---w timeout?                     nt:Timeout
      +---w order?                       enumeration
      +---w operation?                   enumeration
      +---w edit-target?                 string

Command type:

remote

Default parameter:

target

Min parameters:

2

Max parameters:

7

Return type:

status

YANG file:

yangcli-pro.yang

Command Parameters:

  • choice 'from' (not entered)

    • type: choice of case 'varref' or case 'from-cli'

    • usage: mandatory

    • default: none

    • This parameter specifies the where yangcli-pro should get the data from, for the insert operation. It is either a user variable or from interactive input at the command line.

      • varref

        • type: string

        • usage: mandatory

        • default: none

        • This parameter specifies the name of the user variable to use for the target of the insert operation. The parameter must exist (e.g., created with the fill command) or an error message will be printed.

      • case from-cli (not entered)

        • target

          • type: string

          • usage: mandatory

          • default: none

          • This parameter specifies the database target node of the insert operation. This is an ncx:schema-instance string, so any instance identifier, or absolute path expression, or something in between, is accepted.

        • optional

          • type: empty

          • usage: optional

          • default: controlled by $$optional system variable

          • This parameter controls whether optional nodes within the target will be filled in. It can be used to override the $$optional system variable, when it is set to 'false'.

        • value

          • type: anyxml

          • usage: mandatory

          • default: none

          • This parameter specifies the value that should be used for the contents of the 'target' parameter. If it is entered, then the interactive mode prompting for missing parameters will be skipped, if this parameter is complete (or all mandatory nodes present if the $$optional system variable is 'false'). For example, if the target is a leaf, then specifying this parameter will always cause the interactive prompt mode to be skipped.

  • edit-target

    • type: string

    • usage: optional (must be present if the order parameter is set to 'before' or 'after').

    • default: none

    • This parameter specifies the value or key clause that should be used, as the list or leaf-list insertion point. It identifies the existing entry that the new entry will be inserted before or after, depending on the 'order' parameter.

      • For a leaf-list, the edit-target contains the value of the target leaf-list node within the configuration being edited. E.g., edit-target='fred'.

      • For a list, the edit-target contains the key values of the target list node within the configuration being edited. E.g., edit-target=[name='fred'][zipcode=90210].

  • order

    • type: enumeration (first last before after)

    • usage: optional

    • default: last

    • The insert order that should be used. If the value 'before' or 'after' is selected, then the 'edit-target' parameter must also be present.

  • operation

    • type: enumeration (create merge replace)

    • usage: optional

    • default: merge

    • This parameter specifies the 'nc:operation' attribute value for the NETCONF <edit-config> operation. The insert operation is secondary to the NETCONF operation attribute.

  • timeout

    • type: uint32 (0 = no timeout, otherwise the number of seconds to wait)

    • usage: optional

    • default: set to the $$timeout system variable, default 30 seconds

    • This parameter specifies the number of seconds to wait for a response from the server before giving up. The session will not be dropped if a remote command times out, but any late response will be dropped. A value of zero means no timeout should be used, and yangcli-pro will wait forever for a response.

System Variables:

  • $$default-operation

    • The <default-operation> parameter for the <edit-config> operation will be derived from this variable.

  • $$error-option

    • The <error-option> parameter for the <edit-config> operation will be derived from this variable

  • $$test-option

    • The <test-option> parameter for the <edit-config> operation will be derived from this variable

Positive Response:

  • the server returns <ok/>

Negative Response:

  • An error message will be printed if errors are detected locally.

  • An <rpc-error> message will be printed if the server detected an error.

Usage:

andy@myserver> insert varref=myvar order=first

RPC OK Reply 25 for session 10:

andy@myserver> insert /nacm/rules/data-rule order=after edit-target=[name='test-rule'](user will be prompted to fill in the data-rule contents)

RPC OK Reply 26 for session 10:

andy@myserver>

Reference:

kill-session

The 'kill-session' command is used to terminate a NETCONF session (other than the current session). All NETCONF implementations must support this command. It is needed sometimes to unlock a NETCONF database locked by a session that is idle or stuck.

If the lock command returns a 'lock-denied' <error-tag>, it will also include an <error-info> field called <session-id>. This is the session number that currently holds the requested lock. The same value should be used for the 'session-id' parameter in this command, to terminate the session will the lock.

Note

Use of the kill-session operation is an extreme measure, which should be used with caution.

This command is provided by the NETCONF server, not yangcli-pro. Refer to the <kill-session> operation for parameter details.

Usage:

andy@myserver>  kill-session session-id=11

RPC OK Reply 27 for session 10:

andy@myserver>

Reference:

kill-subscription

The 'kill-subscription' command is used to terminate the notification subscription for another session on the connected NETCONF server. The netconfd-pro server must have the yang-push bundle enabled for this operation to be available.

The subscription-id returned in the establish-subscription command must be used as the parameter, since a session can have multiple subscriptions active at once.

The server should also send a "subscription-terminated" notification as a result of the operation.

Note

The nacm:default-deny-all access restriction applies to this operation.

This command is provided by the NETCONF server, not yangcli-pro. Refer to the <kill-subscription> operation for parameter details.

Usage:

fred@server1> kill-subscription id=2

RPC OK Reply 3 for session 4 [default]:

fred@server1>

The session that has the subscription (possibly on another client) will get the "subscription-terminated" event.

andy@server1>

Incoming notification for session 2 [default]:
notification {
  eventTime 2022-01-13T03:04:48Z
  subscription-terminated {
    id 2
    reason sn:no-such-subscription
  }
}

andy@server1>

list

This 'list' command is used to display the commands, objects, and oids (object identifiers) that are available at the time.

  • The 'list commands' command will display the local commands and the remote commands that are available in the current NETCONF session, or which have been loaded with the mgrload command.

  • The 'list files command will display the data files that are in the current data search path. The module parameter has no affect in this mode.

  • The 'list modules' command will display the YANG files that are in the current YANG module search path. The module parameter has no affect in this mode.

  • The 'list objects' command will display the top-level objects that are currently available in the current NETCONF session, or which have been loaded with the mgrload command.

  • The 'list oids' command will display the object identifiers of the top-level objects that are currently available in the current NETCONF session, or which have been loaded with the mgrload command.

  • The 'list scripts' command will display the script files that are in the current script search path. The module parameter has no affect in this mode.

+---x list
   +---w input
      +---w (listtype)
      |  +--:(commands)
      |  |  +---w commands?   empty
      |  +--:(files)
      |  |  +---w files?      empty
      |  +--:(objects)
      |  |  +---w objects?    empty
      |  +--:(oids)
      |  |  +---w oids?       empty
      |  +--:(modules)
      |  |  +---w modules?    empty
      |  +--:(scripts)
      |     +---w scripts?    empty
      +---w module?           nt:NcxIdentifier
      +---w (help-mode)?
         +--:(brief)
         |  +---w brief?      empty
         +--:(normal)
         |  +---w normal?     empty
         +--:(full)
            +---w full?       empty

Command type:

local

Default parameter:

none

Min parameters:

1

Max parameters:

6

Return type:

data

YANG file:

yangcli-pro.yang

Command Parameters:

  • choice help-mode (not entered)

    • brief

      • type: empty

      • usage: optional

      • default: none

      • This parameter specifies that brief documentation mode should be used.

    • normal

      • type: empty

      • usage: optional

      • default: none

      • This parameter specifies that normal documentation mode should be used.

    • full

      • type: empty

      • usage: optional

      • default: none

      • This parameter specifies that full documentation mode should be used.

  • choice 'listtype' (not entered)

    • usage: mandatory

    • default: none

    • This parameter specifies the what type of data should be listed.

    • commands

      • type: empty

      • usage: mandatory

      • default: none

      • This parameter specifies that the available commands should be listed.

        • If the help-mode is set to 'brief', then only the command names will be listed.

        • If the help-mode is set to 'normal', then the XML prefix and the command name will be listed.

        • If the help-mode is set to 'full', then the module name and the command name will be listed.

    • files

      • type: empty

      • usage: mandatory

      • default: none

      • This parameter specifies that all the data files in the current data search path should be listed.

    • modules

      • type: empty

      • usage: mandatory

      • default: none

      • This parameter specifies that all the YANG files in the current module search path should be listed.

    • objects

      • type: empty

      • usage: mandatory

      • default: none

      • This parameter specifies that the available top-level objects should be listed.

        • If the help-mode is set to 'brief', then only the object names will be listed.

        • If the help-mode is set to 'normal', then the XML prefix and the object name will be listed.

        • If the help-mode is set to 'full', then the module name and the object name will be listed.

    • oids

      • type: empty

      • usage: mandatory

      • default: none

      • This parameter specifies that the available top-level object identifiers should be listed.

      • The help-mode parameter has no effect

    • scripts

      • type: empty

      • usage: mandatory

      • default: none

      • This parameter specifies that all the script files in the current script search path should be listed.

  • module

    • type: string

    • usage: optional

    • default: none

    • This parameter specifies a module name. If present then only information for the specified YANG module will be displayed.

Positive Response:

  • the requested information will be printed

Negative Response:

  • An error message will be printed if errors are detected.

Usage:

andy@myserver>  list objects full module=test

   test:instance1
   test:instance2
   test:leafref1
   test:leafref2
   test:test1
   test:test2
   test:test3
   test:idtest
   test:musttest
   test:anyxml.1
   test:binary.1
   test:bits.1
   test:boolean.1
   test:empty.1
   test:enumeration.1
   test:identityref.1
   test:instance-identifier.1
   test:instance-identifier.2
   test:int8.1
   test:int16.1
   test:int32.1
   test:int64.1
   test:leafref.1
   test:leafref.2
   test:string.1
   test:uint8.1
   test:uint16.1
   test:uint32.1
   test:uint64.1
   test:dec64.1
   test:dec64.2
   test:dec64.3
   test:union.1
   test:container.1
   test:container.2
   test:list.1
   test:choice.1
   test:xpath.1

andy@myserver>

load

The load command is used to load a YANG module into the server.

This command is only supported by the netconfd-pro server.

The YANG files must be available in the module search path for the server.

This command is provided by the NETCONF server, not yangcli-pro. Refer to the <load> operation for parameter details.

Usage:

andy@myserver> load toaster revision=2009-06-23

RPC Data Reply 27 for session 10:

rpc-reply {
  mod-revision 2009-06-23
}

andy@myserver>

lock

The 'lock' command is used to request a global lock on a NETCONF database. It is used, along with the unlock command, to obtain exclusive write access to the NETCONF server.

The scope of a lock command is the lifetime of the session that requested the lock. This means that if the session that owns the lock is dropped for any reason, all the locks it holds will be released immediately by the server.

The use of database locks is optional in NETCONF, but it must be implemented by every server. It is strongly suggested that locks be used if multiple managers are likely to log into the particular NETCONF server.

One or more locks may be needed to execute a transaction safely:

  • If the :writable-running capability is supported, then a lock on the <running> database is needed. This database can be locked at any time.

  • If the :startup capability is supported, then a lock on the <startup> database is needed. This database can be locked at any time.

  • If the :candidate capability is supported, then a lock on the <candidate> database is needed. A lock on the <running> database is also needed.

    • The <candidate> database can only be locked if there are no active edits in it.

    • The discard-changes command may be needed to clear a <candidate> database that has been left edited by a session that terminated unexpectedly.

    • Note: There is no way in NETCONF to tell the difference between an actively edited <candidate> database and an 'abandoned' <candidate> database. The server will almost never clear the <candidate> database. It will only clear any locks held. Use the discard-changes command (for other session's edits) with extreme caution.

This command is provided by the NETCONF server, not yangcli-pro. Refer to the <lock> operation for parameter details.

Usage:

andy@myserver> lock target=candidate

RPC OK Reply 29 for session 10:

andy@myserver>

log-debug

The 'log-debug' command prints a message to the program log, if the $$log-level system variable is set to 'debug' or a higher enumeration (e.g., 'debug2').

The 'msg' parameter is used to provide the message string to print.

+---x log-debug
   +---w input
      +---w msg    string

Command type:

local

Default parameter:

msg

Min parameters:

1

Max parameters:

1

Return type:

status

YANG file:

yangcli-pro.yang

Command Parameters:

  • msg

    • type: string

    • usage: mandatory

    • default: none

    • This parameter specifies the string to print to the program log.

Positive Response:

  • the server returns <ok/>

Negative Response:

  • An error message will be printed if the 'msg' parameter contains errors.

Usage:

andy@myserver> log-debug 'starting strict foo'

Debug: starting script foo

andy@myserver>

log-error

The 'log-error' command prints a message to the program log, if the $$log-level system variable is set to 'error' or a higher enumeration (e.g., 'info').

The 'msg' parameter is used to provide the message string to print.

+---x log-error
   +---w input
      +---w msg    string

Command type:

local

Default parameter:

msg

Min parameters:

1

Max parameters:

1

Return type:

status

YANG file:

yangcli-pro.yang

Command Parameters:

  • msg

    • type: string

    • usage: mandatory

    • default: none

    • This parameter specifies the string to print to the program log.

Positive Response:

  • the server returns <ok/>

Negative Response:

  • An error message will be printed if the 'msg' parameter contains errors.

Usage:

andy@myserver> log-error 'sysName not correct'

Error: sysName not correct

andy@myserver>

log-info

The 'log-info' command prints a message to the program log, if the $$log-level system variable is set to 'info' or a higher enumeration (e.g., 'debug').

The 'msg' parameter is used to provide the message string to print.

+---x log-info
   +---w input
      +---w msg    string

Command type:

local

Default parameter:

msg

Min parameters:

1

Max parameters:

1

Return type:

status

YANG file:

yangcli-pro.yang

Command Parameters:

  • msg

    • type: string

    • usage: mandatory

    • default: none

    • This parameter specifies the string to print to the program log.

Positive Response:

  • the server returns <ok/>

Negative Response:

  • An error message will be printed if the 'msg' parameter contains errors.

Usage:

andy@myserver> log-info 'sysName is correct'

Info: sysName is correct

andy@myserver>

log-warn

The 'log-warn' command prints a message to the program log, if the $$log-level system variable is set to 'warn' or a higher enumeration (e.g., 'debug').

The 'msg' parameter is used to provide the message string to print.

+---x log-warn
   +---w input
      +---w msg    string

Command type:

local

Default parameter:

msg

Min parameters:

1

Max parameters:

1

Return type:

status

YANG file:

yangcli-pro.yang

Command Parameters:

  • msg

    • type: string

    • usage: mandatory

    • default: none

    • This parameter specifies the string to print to the program log.

Positive Response:

  • the server returns <ok/>

Negative Response:

  • An error message will be printed if the 'msg' parameter contains errors.

Usage:

andy@myserver> log-warn 'sysName object not found'

Warning: sysName object not found

andy@myserver>

merge

The 'merge' command is a high-level <edit-config> operation. It is used to merge some new nodes into the default target database.

A target node is specified (in 1 of 2 ways), and then the data structure is filled in. Only mandatory nodes will be filled in unless the $$optional system variable is set to 'true'.

Refer to the fill command for more details on interactive mode data structure completion.

+---x merge
   +---w input
      +---w (from)
      |  +--:(varref)
      |  |  +---w varref?                string
      |  +--:(from-cli)
      |     +---w (target-parm)?
      |     |  +--:(target)
      |     |  |  +---w target           yang:xpath1.0
      |     |  +--:(urltarget-case)
      |     |     +---w urltarget        ywt:UrlPath
      |     |     +---w match-names?     ywt:NameMatchMode
      |     |     +---w alt-names?       ywt:AltNameMode
      |     |     +---w wildcard-keys?   boolean
      |     +---w optional?              empty
      |     +---w value?                 <anyxml>
      +---w timeout?                     nt:Timeout

Command type:

remote

Default parameter:

target

Min parameters:

1

Max parameters:

5

Return type:

status

YANG file:

yangcli-pro.yang

Capabilities needed:

:candidate or :writable-running

Command Parameters:

  • choice 'from' (not entered)

    • type: choice of case 'varref' or case 'from-cli'

    • usage: mandatory

    • default: none

    • This parameter specifies the where yangcli-pro should get the data from, for the merge operation. It is either a user variable or from interactive input at the command line.

      • varref

        • type: string

        • usage: mandatory

        • default: none

        • This parameter specifies the name of the user variable to use for the target of the merge operation. The parameter must exist (e.g., created with the fill command) or an error message will be printed.

      • case from-cli (not entered)

        • target

          • type: string

          • usage: optional (target or urltarget must be entered)

          • default: none

          • This parameter specifies the database target node of the merge operation. This is an ncx:schema-instance string, so any instance identifier, or absolute path expression, or something in between, is accepted.

        • urltarget

          • type: string

          • usage: optional

          • default: none

          • This parameter specifies the database target node of the merge operation. This is an UrlPath string.

        • optional

          • type: empty

          • usage: optional

          • default: controlled by $$optional system variable

          • This parameter controls whether optional nodes within the target will be filled in. It can be used to override the $$optional system variable, when it is set to 'false'.

        • value

          • type: anyxml

          • usage: mandatory

          • default: none

          • This parameter specifies the value that should be used for the contents of the 'target' parameter. If it is entered, then the interactive mode prompting for missing parameters will be skipped, if this parameter is complete (or all mandatory nodes present if the $$optional system variable is 'false'). For example, if the target is a leaf, then specifying this parameter will always cause the interactive prompt mode to be skipped.

  • timeout

    • type: uint32 (0 = no timeout, otherwise the number of seconds to wait)

    • usage: optional

    • default: set to the $$timeout system variable, default 30 seconds

    • This parameter specifies the number of seconds to wait for a response from the server before giving up. The session will not be dropped if a remote command times out, but any late response will be dropped. A value of zero means no timeout should be used, and yangcli-pro will wait forever for a response.

System Variables:

  • $$default-operation

    • The <default-operation> parameter for the <edit-config> operation will be derived from this variable.

  • $$error-option

    • The <error-option> parameter for the <edit-config> operation will be derived from this variable

  • $$test-option

    • The <test-option> parameter for the <edit-config> operation will be derived from this variable

Positive Response:

  • the server returns <ok/>

Negative Response:

  • An error message will be printed if errors are detected locally.

  • An <rpc-error> message will be printed if the server detected an error.

Usage:

andy@myserver>  merge \
        target=/nacm/rules/moduleRule[moduleName='netconf']\
        [allowed-rights='read write']/allowed-group \
        value=ncx:guest

Reference:

modify-subscription

The 'modify-subscription' command is used to modify a notification subscription on the connected NETCONF server. The netconfd-pro server must have the yang-push bundle enabled for this operation to be available.

The subscription-id that was returned in the establish-subscription operation must be used in this operation.

This command is provided by the NETCONF server, not yangcli-pro. Refer to the <modify-subscription> operation for parameter details.

Usage:

session1> modify-subscription id=2 stream-filter-name=alarms-stream

RPC OK Reply 37 for session 10:

session1>

mgrload

The 'mgrload' command is used to load a YANG module into yangcli-pro. The YANG files must be available in the module search path for yangcli-pro.

+---x mgrload
   +---w input
      +---w module       nt:NcxName
      +---w revision?    nt:Date
      +---w deviation*   yt:NcModuleSpec

Command type:

local

Default parameter:

module

Min parameters:

1

Max parameters:

3

Return type:

status

YANG file:

yangcli-pro.yang

Command Parameters:

  • module

    • type: string (length 1 .. 63)

    • usage: mandatory

    • default: none

    • This parameter specifies the name of the module to load.

  • revision

    • type: date string (YYYY-MM-DD)

    • usage: optional

    • default: none

    • This parameter specifies the revision date of the module to load.

  • deviation:

    • type: leaf-list of deviation module names

    • usage: optional (0 or more instances)

    • default: none

    • This parameter specifies a deviation module to load prior to loading the requested module.

Positive Response:

  • OK

Negative Response:

  • An error message will be printed if errors are detected.

Usage:

> mgrload toaster

Load module toaster OK

>

no

This command is available in configuration mode only.

The 'no' command is available in config mode to start a delete operation.

  • A normal config-mode command line is expected.

  • The specified node is deleted

  • A sub-mode is not-expected and not entered if the 'no' keyword is used

  • A complete node specification to deleted is expected

Command type:

config mode

Default parameter:

none

Min parameters:

1

Max parameters:

1

Return type:

none

YANG file:

none

Command Parameters:

  • A complete command specifying the node to delete is expected

Positive Response:

  • A message indicated action performed will be printed if --log-level is info or above.

Negative Response:

  • An error message will be printed

Usage:

session1> conf t

session1# no nacm groups group mygroup

Applying 1 edit

session1#

no-op

The 'no-op' command is used to test server message processing response times, by providing a baseline response time to do nothing except return <ok/>.

  • It can also be used as an application-level keep-alive to prevent proxy idle timeout or server idle timeout problems from occurring.

  • This command is only supported by the netconfd-pro server. The server will simply respond 'OK', if the request is well-formed.

  • This command is only available if the yuma-system.yang module is loaded in the server.

This command is provided by the NETCONF server, not yangcli-pro. Refer to the <no-op> operation for parameter details.

Usage:

andy@myserver> no-op

RPC OK Reply 31 for session 10:

andy@myserver>

nvsave

The 'nvsave' command is used to save the running datastore to the startup datastore on the current session.

If the server does not support the :startup capability then this command will fail. It has the save purpose as “copy-config source=running target=startup”.

+---x nvsave

Command type:

local

Default parameter:

none

Min parameters:

0

Max parameters:

0

Return type:

status

YANG file:

yangcli-pro.yang

Positive Response:

  • the server returns <ok/>

Negative Response:

  • An error message will be printed if errors are detected locally.

  • An <rpc-error> message will be printed if the server detected an error.

Usage:

andy@myserver> nvsave

RPC OK Reply 32 for session 10:

andy@myserver>

pwd

The 'pwd' command is used to print the current working directory.

+---x pwd

Command type:

local

Default parameter:

none

Min parameters:

0

Max parameters:

0

Return type:

status

YANG file:

yangcli-pro.yang

Positive Response:

  • the current working directory is printed to the log or STDOUT

Negative Response:

  • An error message will be printed if errors are detected.

Usage:

> pwd

Current working directory is /home/andy

>

quit

The 'quit' command is used to terminate the yangcli-pro program.

If a NETCONF session is in progress, it will be dropped without sending a close-session command first. This should be taken into account if the server reports dropped TCP connections as an error.

+---x quit

Command type:

local

Default parameter:

none

Min parameters:

0

Max parameters:

0

Return type:

none

YANG file:

yangcli-pro.yang

Positive Response:

  • The program terminates; no response will be printed.

Negative Response:

  • An error message will be printed if errors are detected.

Usage:

> quit

andy@myworkstation>

rawrpc

  • Added 22.10-7

The 'rawrpc' command is used to send a complete RPC request to the current NETCONF session.

  • This can be useful for automated testing and other tasks.

  • The YANG 'action' operation can be sent all at once. There is no YANG 'rpc' definition possible for this operation.

  • Negative testing can be performed more precisely because the exact XML is specified. Invalid XML or YANG data can be sent to a server.

Warning

  • The raw XML contents are not checked in any way.

  • It is possible to send invalid values and invalid XML.

  • The server will drop the NETCONF session if invalid XML is received.

Usage

There are 3 forms of this command allowed:

In each case the exact same contents are expected:

  • Do not include the XML preamble, just the "rpc" element. This is an example of an XML preamble:

    <?xml version="1.0" encoding="UTF-8"?>
    
  • The complete "rpc" element must be provided or the server will reject the RPC operation request:

    • The correct namespace must be used

    • A message-id attribute must be present

    • The entire message must be a valid XML instance document

    This is an example of a valid "rpc" element (contents removed)

    <rpc message-id="6"
      xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
      <!-- contents removed -->
    </rpc>
    
  • The --use-rawxml setting is forced to 'true' for processing of the mandatory input parameter. The rawrpc operation is special because no attempt to parse the XML is attempted.

  • In this example, the XML file 'foo.xml' contains the "rpc" element:

    > rawrpc @foo.xml
    

    Normally this input form expects the XML file to match the command. In this example, the "edit-config" element is expected in the "editcmd.xml" file:

    > edit-config @editcmd.xml
    

Negative Testing

It is possible to use the rawrpc command to send incorrect NETCONF messages to the server to test error handling. In this case the server is expected to either drop the session or return an "rpc-error" response.

The NETCONF requests and replies generated from the rawrpc command do not have the usual validation tests done.

  • RPC request validation is skipped. The --check-output and --check-output-error parameters are ignored if the rawrpc command is used.

  • RPC output validation imay be done incorrectly. It is possible that RPC methods with output may cause a warning when the response is received because "data" was received instead of "ok".

+---x rawrpc
   +---w input
      +---w rpc    anydata

Command type:

remote

Default parameter:

rpc

Min parameters:

1

Max parameters:

1

Return type:

ok or data

YANG file:

yangcli-pro.yang

Capabilities needed:

none

Capabilities optional:

none

Response:

  • Any response from the server can be expected since the actual RPC operation is not known to the client.

Mandatory Parameters:

  • rpc

    • type: anydata

    • usage: mandatory

    • This parameter identifies the entire "rpc" element

      • The entire 'rpc' container is expected, not the children.

      • The message will be sent to the server as-is.

      • No usual logging and processing will be possible for this operation.

      • The XML (from file or inline XML) is sent to the server 'as-is', without converting it to an internal data structure first.

File Example:

The file variants expect a data file to be found in the $YUMAPRO_DATAPATH, such as the $HOME/data directory.

Both these commands are treated the same:

> rawrpc @rawtoast.xml
> rawrpc rpc=@rawtoast.xml

The file 'rawtoast.xml' is shown.

<rpc message-id="17"
 xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
 <action xmlns="urn:ietf:params:xml:ns:yang:1">
  <vtoasters xmlns="urn:yumaworks:params:xml:ns:vtoaster">
   <vtoaster>
    <id>3</id>
    <make-toast xmlns="http://netconfcentral.org/ns/toaster">
     <toasterDoneness>5</toasterDoneness>
     <toasterToastType
       xmlns:toast="http://netconfcentral.org/ns/toaster">toast:wheat-bread</toasterToastType>
    </make-toast>
   </vtoaster>
  </vtoasters>
 </action>
</rpc>

Inline XML Example

The inline XML variant is intended for use in scripts without requiring additional XML data files. Scripts are found in the $YUMAPRO_RUNPATH, such as the $HOME/scripts directory.

The following example shows the rawrpc command for 'sget /system':

rawrpc rpc="""
<rpc message-id="2"
 xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
 <get>
  <filter type="subtree">
   <system xmlns="http://netconfcentral.org/ns/yuma-system"/>
  </filter>
 </get>
</rpc>
"""

recall

The 'recall' command is used to recall a previously entered command line from the command line history buffer. It is used together with the history command.

  • A command is recalled by its command ID number. Use the 'history show` command to see the contents of the command line history buffer.

  • The command is not executed (like in bash). Instead the command is available for editing.

  • The 'bang' command character '!' can be used instead of this command to recall a command by searching the most recent commands for a match.

    Example: search for most recent 'sget' command

    server1> !sget
    
    server1> sget /proc
    
+---x recall
   +---w input
      +---w index    LogIndex

Command type:

local

Default parameter:

index

Min parameters:

1

Max parameters:

1

Return type:

data

YANG file:

yangcli-pro.yang

Positive Response:

  • The specified command line is recalled into the current command line.

Negative Response:

  • An error message will be printed if errors are detected.

Usage:

> recall 7

> sget /system

record-test

The 'record-test' command is used to automatically record commands into a test script that is compatible with the test-suite command.

  • The 'start' sub-command is used to start recording a test. Once recording starts, all the commands entered are recorded for the test.

  • The 'finish' sub-command is used to finish recording a test. The recorded commands will be saved in the default or configured test suite file.

  • The 'cancel' sub-command is used to cancel recording a test. The recorded commands will be discarded.

  • The 'pause' sub-command is used to pause recording a test. The commands entered after this command will not be recorded.

  • The 'resume' sub-command is used to resume recording a paused test. The commands entered after this command will be recorded.

+---x record-test
    +---w input
       +---w (record-test-action)
          +--:(cancel)
          |  +---w cancel?       empty
          +--:(start-case)
          |  +---w start         empty
          |  +---w suite-name    nt:NcxIdentifier
          |  +---w test-name     nt:NcxIdentifier
          +--:(finish)
          |  +---w finish?       empty
          +--:(pause)
          |  +---w pause?        empty
          +--:(resume)
             +---w resume?       empty

Command type:

local

Default parameter:

suite-name

Min parameters:

1

Max parameters:

3

Return type:

status

YANG file:

yangcli-pro.yang

Command Parameters:

  • choice record-test-action (not entered)

    • choice usage: mandatory

    • default: case: none

    • start-case

      • start

        • type: empty

        • Start recording a new test or replace an existing test. Only one test can be recorded at a time.

      • suite-name

        • type: NcxIdentifier

        • usage: mandatory

        • default: none

        • This parameter specifies the name of the test suite to use.

      • test-name

        • type: NcxIdentifier

        • usage: mandatory

        • default: none

        • This parameter specifies the name of the test to use.

    • finish

      • type: empty

      • default: none

      • Finish recording of the test in progress

    • cancel

      • type: empty

      • default: none

      • Cancel recording of the test in progress

    • pause

      • type: empty

      • default: none

      • Pause recording of the test in progress

    • resume

      • type: empty

      • default: none

      • Resume recording of the paused test in progress

Positive Response:

  • The requested action is performed for the specified test-suite and test.

Negative Response:

  • An error message will be printed if errors are detected locally.

Usage:

andy@myserver> record-test start suite1 test-name=test1

Start recording:  suite=suite1 test=test1

andy@myserver>

refresh-library

The 'refresh-library' is used to force yangcli-pro to re-scan for YANG modules.

If the YANG modules available on disk changes while the program is running, then this command can be used to refresh the module version list used to determine the 'best-match' for imports.

+---x refresh-library

Command type:

local

Default parameter:

none

Min parameters:

0

Max parameters:

0

Return type:

status

YANG file:

yangcli-pro.yang

Positive Response:

  • The specified command refreshes the module version list available for “best-match” imports revision tracking.

Negative Response:

  • An error message will be printed if errors are detected.

Usage:

> help refresh-library

rpc refresh-library
  If the YANG modules available on disk changes while
  the program is running, then this command can be
  used to refresh the module version list used
  to determine the 'best-match' for imports.

> refresh-library

   OK

> show search-path-module

YANG Module Search Path

Current dir only: /home/username/swdev/ypwork/netconf/target/bin
HOME/modules: /home/username/modules
Default YUMAPRO_INSTALL: /usr/share/yumapro/modules
Start Dir: /home/username/swdev/ypwork/netconf/target/bin/modules
yangcli Cache: /home/username/.yumapro/.yangcli_cache

release-locks

The 'release-locks' command is used to release all the locks that were previously granted with the get-locks command.

If the get-locks command was not used, then this command will fail with an error message that no locks are active to unlock.

+---x release-locks

Command type:

remote

Default parameter:

none

Min parameters:

0

Max parameters:

0

Return type:

status

YANG file:

yangcli-pro.yang

Positive Response:

  • The previously granted locks are released.

Negative Response:

  • An error message will be printed if errors are detected locally.

  • An <rpc-error> message will be printed if the server detected an error.

Usage: (showing 2 locks being released)

andy@myserver> release-locks

RPC OK Reply 8 for session 23:
RPC OK Reply 9 for session 23:

andy@myserver>

remove

The 'remove' command is a high-level <edit-config> operation. It is used to remove an existing subtree in the default target database, using the remove” operation, defined in RFC 6241,

  • This command will only work on NETCONF servers that support the RFC 6241 :base:1.1 capability

  • This command does not generate an error if the entry to delete does not exist.

  • A target node is specified, and then any missing key leafs (if any) within the data structure are filled in. If the target is a leaf-list, then the user will be prompted for the value of the leaf-list node to be removed.

Refer to the fill command for more details on interactive mode data structure completion.

+---x remove
   +---w input
      +---w target    string
      +---w value?    <anyxml>

Command type:

remote

Default parameter:

target

Min parameters:

1

Max parameters:

1

Return type:

status

YANG file:

yangcli-pro.yang

Capabilities needed:

:base:1.1 :candidate or :writable-running

Command Parameters:

  • target

    • type: string

    • usage: optional (urltarget or target must be present)

    • default: none

    • This parameter specifies the database target node of the delete operation. This is an ncx:schema-instance string, so any instance identifier, or absolute path expression, or something in between, is accepted.

System Variables:

  • $$default-operation

    • The <default-operation> parameter for the <edit-config> operation will be derived from this variable.

  • $$error-option

    • The <error-option> parameter for the <edit-config> operation will be derived from this variable

  • $$optional

    • Controls whether optional descendant nodes will be filled into the target parameter contents

  • $$test-option

    • The <test-option> parameter for the <edit-config> operation will be derived from this variable

Positive Response:

  • the server returns <ok/>

Negative Response:

  • An error message will be printed if errors are detected locally.

  • An <rpc-error> message will be printed if the server detected an error.

Usage:

andy@myserver>  remove /nacm/rules/data-rule
(user will be prompted to fill in the data-rule 'name' key leaf)

RPC OK Reply 15 for session 10:

andy@myserver> remove target=/nacm/rules/data-rule[name='test rule']/comment
(no user prompting; <edit-config> request sent right away)

RPC OK Reply 16 for session 10:

andy@myserver>

Reference:

remove-all

The 'remove-all' command is a high-level <edit-config> operation. It is used to remove all instances of a list or leaf-list.

  • This is only supported for the netconfd-pro server.

  • The --allow-leaflist-delete-all parameter must be set to 'true' to use this operation on a leaf-list.

  • The --allow-list-delete-all parameter must be set to 'true' to use this operation on a list.

  • This command does not generate an error if the entry to delete does not exist.

  • The same restrictions as the remove command apply to this command.

Refer to the fill command for more details on interactive mode data structure completion.

+---x remove-all
   +---w input
      +---w (delete-target)
         +--:(target)
         |  +---w target?      string
         +--:(urltarget)
            +---w urltarget?   ywt:UrlPath

Command type:

remote

Default parameter:

target

Min parameters:

1

Max parameters:

1

Return type:

status

YANG file:

yangcli-pro.yang

Capabilities needed:

:base:1.1 :candidate or :writable-running

Command Parameters:

Choice of:

  • target

    • type: string

    • usage: optional (urltarget or target must be present)

    • default: none

    • This parameter specifies the database target node of the delete operation. This is an ncx:schema-instance string, so any instance identifier, or absolute path expression, or something in between, is accepted.

  • urltarget

    • type: string

    • usage: optional

    • default: none

    • This parameter specifies the database target node of the replace operation. This is an UrlPath string.

System Variables:

  • $$default-operation

    • The <default-operation> parameter for the <edit-config> operation will be derived from this variable.

  • $$error-option

    • The <error-option> parameter for the <edit-config> operation will be derived from this variable

  • $$optional

    • Controls whether optional descendant nodes will be filled into the target parameter contents

  • $$test-option

    • The <test-option> parameter for the <edit-config> operation will be derived from this variable

Positive Response:

  • the server returns <ok/>

Negative Response:

  • An error message will be printed if errors are detected locally.

  • An <rpc-error> message will be printed if the server detected an error.

Usage:

andy@myserver>  remove-all /nacm/rules/data-rule
(user will be prompted to fill in the data-rule 'name' key leaf)

RPC OK Reply 15 for session 10:

andy@myserver>

Reference:

  • none

replace

The 'replace' command is a high-level <edit-config> operation. It is used to replace an existing subtree with some new nodes, in the default target database.

Only the subtree indicated by the 'target' or 'varref' parameter will be replaced.

A target node is specified (in 1 of 2 ways), and then the data structure is filled in. Only mandatory nodes will be filled in unless the $$optional system variable is set to 'true'.

Refer to the fill command for more details on interactive mode data structure completion.

+---x replace
    +---w input
       +---w (from)
       |  +--:(varref)
       |  |  +---w varref?                string
       |  +--:(from-cli)
       |     +---w (target-parm)?
       |     |  +--:(target)
       |     |  |  +---w target           yang:xpath1.0
       |     |  +--:(urltarget-case)
       |     |     +---w urltarget        ywt:UrlPath
       |     |     +---w match-names?     ywt:NameMatchMode
       |     |     +---w alt-names?       ywt:AltNameMode
       |     |     +---w wildcard-keys?   boolean
       |     +---w optional?              empty
       |     +---w value?                 <anyxml>
       +---w timeout?                     nt:Timeout

Command type:

remote

Default parameter:

target

Min parameters:

1

Max parameters:

5

Return type:

status

YANG file:

yangcli-pro.yang

Capabilities needed:

:candidate or :writable-running

Command Parameters:

  • choice 'from' (not entered)

    • type: choice of case 'varref' or case 'from-cli'

    • usage: mandatory

    • default: none

    • This parameter specifies the where yangcli-pro should get the data from, for the replace operation. It is either a user variable or from interactive input at the command line.

      • varref

        • type: string

        • usage: mandatory

        • default: none

        • This parameter specifies the name of the user variable to use for the target of the replace operation. The parameter must exist (e.g., created with the fill command) or an error message will be printed.

      • case from-cli (not entered)

        • target

          • type: string

          • usage: optional (target or urltarget must be present)

          • default: none

          • This parameter specifies the database target node of the replace operation. This is an ncx:schema-instance string, so any instance identifier, or absolute path expression, or something in between, is accepted.

        • urltarget

          • type: string

          • usage: optional

          • default: none

          • This parameter specifies the database target node of the replace operation. This is an UrlPath string.

        • optional

          • type: empty

          • usage: optional

          • default: controlled by $$optional system variable

          • This parameter controls whether optional nodes within the target will be filled in. It can be used to override the $$optional system variable, when it is set to 'false'.

        • value

          • type: anyxml

          • usage: mandatory

          • default: none

          • This parameter specifies the value that should be used for the contents of the 'target' parameter. If it is entered, then the interactive mode prompting for missing parameters will be skipped, if this parameter is complete (or all mandatory nodes present if the $$optional system variable is 'false'). For example, if the target is a leaf, then specifying this parameter will always cause the interactive prompt mode to be skipped.

  • timeout

    • type: uint32 (0 = no timeout, otherwise the number of seconds to wait)

    • usage: optional

    • default: set to the $$timeout system variable, default 30 seconds

    • This parameter specifies the number of seconds to wait for a response from the server before giving up. The session will not be dropped if a remote command times out, but any late response will be dropped. A value of zero means no timeout should be used, and yangcli-pro will wait forever for a response.

System Variables:

  • $$default-operation

    • The <default-operation> parameter for the <edit-config> operation will be derived from this variable.

  • $$error-option

    • The <error-option> parameter for the <edit-config> operation will be derived from this variable

  • $$test-option

    • The <test-option> parameter for the <edit-config> operation will be derived from this variable

Positive Response:

  • the server returns <ok/>

Negative Response:

  • An error message will be printed if errors are detected locally.

  • An <rpc-error> message will be printed if the server detected an error.

Usage:

andy@myserver> replace \
        target=/nacm/rules/moduleRule[moduleName='yuma-system']\
        [allowed-rights='exec']

(user prompted to fill in specified <moduleRule> element)

RPC OK Reply 31 for session 10:

andy@myserver>

Reference:

return

This command is available in configuration mode only.

The 'return' command is used to cancel and discard all edits and exit configuration mode.

Command type:

config mode

Default parameter:

none

Min parameters:

0

Max parameters:

0

Return type:

none

YANG file:

none

Command Parameters:

  • none

Positive Response:

  • The command prompt will change back to a normal session prompt

Negative Response:

  • An error message will be printed (e.g. invoked outside config mode)

Usage:

session1> conf t

session1# nacm groups group mygroup

session1(group)# user-name fred

session1(group)# user-name barney

session1(group)# return

session1>

restart

The 'restart' command is used to restart the NETCONF server.

  • This command is only supported by the netconfd-pro server.

  • The default access control configuration for netconfd-pro will not allow any user except the designated 'superuser' account to invoke this command.

  • The yuma-system.yang module must be loaded in the server for this command to be available.

This command is provided by the NETCONF server, not yangcli-pro. Refer to the <restart> operation for parameter details.

Usage:

andy@myserver> restart

ses: session 10 shut by remote peer

>

resync-subscription

The 'resync-subscription' command is used to request a full Push Update from the server. The netconfd-pro server must have the yang-push bundle enabled for this operation to be available.

The subscription-id that was returned in the establish-subscription operation must be used in this operation.

This command is provided by the NETCONF server, not yangcli-pro. Refer to the <resync-subscription> operation for parameter details.

Usage:

session1> resync-subscription id=2

RPC OK Reply 37 for session 10:

session1>

run

The 'run' command is used to invoke a yangcli-pro script.

Note

  • Use the run-shell command for bash scripts. This command is for yangcli-pro scripts only.

  • For the 'yp-shell' program, the --ypshell-exec-ok parameter must also be set to 'true' for this command to be allowed.

Refer to the section on Scripts for details on how to write a script.

  • The script name is the only mandatory parameter.

  • There are 9 generic parameters (named P1 to P9) that can be used to pass string parameters to scripts.

  • Within a script, these are referenced with local variables ($1 to $9).

  • The run command can be used within a script.

  • Scripts do not return any status or data.

  • The run command can appear inside a script, starting a new run level. An error will occur if a loop occurs or too many nest levels are used. Up to 64 run levels are supported in yangcli-pro.

+---x run
    +---w input
       +---w script    string
       +---w P1?       string
       +---w P2?       string
       +---w P3?       string
       +---w P4?       string
       +---w P5?       string
       +---w P6?       string
       +---w P7?       string
       +---w P8?       string
       +---w P9?       string

Command type:

local

Default parameter:

script

Min parameters:

1

Max parameters:

10

Return type:

status

YANG file:

yangcli-pro.yang

Command Parameters:

  • P1, P2, P3, P4, P5, P6, P7, P8, P9

    • type: string

    • usage: optional

    • default: none

    • These parameters provide a generic string parameter passing mechanism for each script invocation, similar to unix shell scripts. Within the script, the parameters $1, $2, $3, $4, $5, $6, $7, $8 and $9 will be non-NULL only if the corresponding 'Pn' parameter was set in the script invocation.

  • script

    • type: string

    • usage: mandatory

    • default: none

    • This parameter specifies the name of the script to be run. If a path specification is included, then it will be used. Otherwise the current script search path will be used to find the script.

System Variables:

  • $$runpath

    • Controls where yangcli-pro will look for files specified in the 'script' parameter.

Positive Response:

  • the specified script will be executed

Negative Response:

  • An error message will be printed if errors are detected locally.

  • An <rpc-error> message will be printed if the server detected an error, if any remote commands are contained in the script.

Usage:

> run connect P1=yangrocks

(commands and responses are printed as if they were typed)

andy@myserver>

run-shell

The 'run-shell' command is an internal command to run a shell script.

Note

  • The --allow-shell parameter must be set to 'true' for this command to be present.

  • For the 'yp-shell' program, the --ypshell-exec-ok parameter must be set to 'true' for this command to be allowed.

  • The script name is the only mandatory parameter.

  • There are 9 generic parameters (named P1 to P9) that can be used to pass string parameters to scripts.

  • Within a script, these are referenced with local variables ($1 to $9).

  • Scripts do not return any status or data at this time.

  • The parameters P1 .. P9 will be converted to dollar parameters $0 to $N, where N is the number of 'Pn' parameters provided.

  • The parameters will be added to the command line in named order P1 through P9.

  • Environment variables are not used for script parameters since they could have naming conflicts, especially for recursive scripts.

Example:

server1> run-script test1.sh P3=foo P6=bar P1=baz

This script will be invoked with parameters $1=baz $2=foo $3=bar

+---x run-shell
   +---w input
      +---w script    string
      +---w P1?       string
      +---w P2?       string
      +---w P3?       string
      +---w P4?       string
      +---w P5?       string
      +---w P6?       string
      +---w P7?       string
      +---w P8?       string
      +---w P9?       string

Command type:

local

Default parameter:

script

Min parameters:

1

Max parameters:

10

Return type:

status

YANG file:

yangcli-pro.yang

Command Parameters:

  • P1, P2, P3, P4, P5, P6, P7, P8, P9

    • type: string

    • usage: optional

    • default: none

    • These parameters provide a generic string parameter passing mechanism for each script invocation, similar to unix shell scripts. Within the script, the parameters $1, $2, $3, $4, $5, $6, $7, $8 and $9 will be non-NULL only if the corresponding 'Pn' parameter was set in the script invocation.

  • script

    • type: string

    • usage: mandatory

    • default: none

    • This parameter specifies the name of the script to be run. If a path specification is included, then it will be used. Otherwise the current script search path will be used to find the script.

System Variables:

  • $$runpath

    • Controls where yangcli-pro will look for files specified in the 'script' parameter.

Positive Response:

  • the specified script will be executed

Negative Response:

  • An error message will be printed if errors are detected locally.

Usage:

> run-script test1.sh P3=foo P6=bar P1=baz

andy@myserver>

save

The 'save' command is used to save NETCONF database edits to non-volatile storage, on the server. It is a pseudo-command, mapped to other remote commands depending on which database target is supported by the server (<candidate> or <running>).

The 'save' command usually maps to either the commit or the copy-config command. Refer to the Using NETCONF Sessions section for more details.

+---x save

Command type:

remote

Default parameter:

none

Min parameters:

0

Max parameters:

0

Return type:

none

YANG file:

yangcli-pro.yang

Positive Response:

  • The server returns one or two <ok/> responses.

Negative Response:

  • An error message will be printed if errors are detected locally.

  • An <rpc-error> message will be printed if the server detected an error.

Usage:

andy@myserver> save

RPC OK Reply 34 on session 10

andy@myserver>

schema-server-cfg

The 'schema-server-cfg' command is used to access a named schema server.

There are 3 sub-commands:

  • create

  • show

  • delete

+---x schema-server-cfg
   +---w input
      +---w (schema-server-action)?
         +--:(show-case)
         |  +---w show?           IdentifierOrZero
         |  +---w (help-mode)?
         |     +--:(brief)
         |     |  +---w brief?    empty
         |     +--:(normal)
         |     |  +---w normal?   empty
         |     +--:(full)
         |        +---w full?     empty
         +--:(delete)
         |  +---w delete?         nt:NcxIdentifier
         +--:(create)
            +---w create          nt:NcxName
            +---w user-id         nt:NcxName
            +---w device-id?      nt:NcxName

Command type:

local

Default parameter:

none

Min parameters:

1

Max parameters:

3

Return type:

status

YANG file:

yangcli-pro.yang

Capabilities needed:

none

Command Parameters:

  • create

    • type: name string

    • This parameter specifies a new schema server to create.

  • show

    • type: name string.

    • This parameter specifies the name of the schema server to show.

    • The --brief, --normal, or --full parameter can be used for this sub-command.

  • delete

    • type: name string

      This parameter specifies the name of the schema server to delete from the saved schema server in memory. An active schema server cannot be deleted.

Positive Response

  • A message indicating the create or delete was done will be printed. The show command will generate some formatted output showing information on the requested schema server.

Negative Response:

  • An error message will be printed if errors are detected.

Usage:

> schema-server-cfg create=schema-server-B user-id=userB device-id=deviceB

A new schema_server is created:
schema_server-id=schema-server-B name=schema-server-B device=deviceB user=userB

> schema-server-cfg show=schema-server-B

Schema Server: schema-server-B
Device Id: deviceB
User Id: userB
Connected: false

> schema-server-cfg delete=schema-server-B

Deleting saved schema_server 'schema-server-B'

schema-servers-cfg

The 'schema-servers-cfg' command is used to access the named schema server files.

There are 4 sub-commands:

  • clear

  • load

  • save

  • show (default)

+---x schema-servers-cfg
   +---w input
      +---w (schema-servers-action)?
         +--:(show-case)
         |  +---w show?           empty
         |  +---w (help-mode)?
         |     +--:(brief)
         |     |  +---w brief?    empty
         |     +--:(normal)
         |     |  +---w normal?   empty
         |     +--:(full)
         |        +---w full?     empty
         +--:(clear)
         |  +---w clear?          empty
         +--:(load)
         |  +---w load?           string
         +--:(save)
            +---w save?           string

Command type:

local

Default parameter:

show

Min parameters:

1

Max parameters:

2

Return type:

status

YANG file:

yangcli-pro.yang

Capabilities needed:

none

Command Parameters:

  • clear

    • type: empty

    • This parameter indicates that all saved schema servers in memory be deleted. This cannot be done if any of the schema servers are currently active. Use 'schema-servers-cfg load' to restore the saved schema servers.

  • load

    • type: string

    • This parameter identifies the file specification for the saved chema servers to load. Any new named schema servers will be added to the named schema servers in memory.

  • save

    • type: name string

    • This parameter identifies the file specification for the saved schema servers config file to load. The saved chema servers in memory will be saved to this file.

  • show

    • type: name string; default: empty string == all schema servers

    • The --brief, --normal, or --full parameter can be used for this sub-command.

Positive Response:

  • A message indicating the load, save or clear was done will be printed. The show command will generate some formatted output showing information on the requested schema servers.

Negative Response:

  • An error message will be printed if errors are detected locally.

Usage:

 > schema-servers-cfg clear

 Deleting 3 saved schema_servers


 > schema-servers-cfg load=~/.yumapro/.yangcli_pro_schema_servers.conf-save

 Loaded saved schema_servers OK from '~/.yumapro/.yangcli_pro_schema_servers.conf-save'

 > schema-servers-cfg save

 Saved 3 schema_servers OK to '~/.yumapro/.yangcli_pro_schema_servers.conf'


 > schema-servers-cfg show

 Saved schema_servers source: '~/.yumapro/.yangcli_pro_schema_servers.conf'
 Schema Server: schema-serverA
Device Id: deviceB
User Id: userA
Connected: false
 Schema Server: schema-server-ACER
Device Id: device-ACER
User Id: user-ACER
Connected: false
 Schema Server: schema-server-asus2
Device Id: asus2-device
User Id: asus2
Connected: false

session

The 'session' command is used to set the current named session, if named sessions are used. The current session is used by yangcli-pro to decide where to send remote commands. Changing the current session allows commands typed at the CLI to be sent to the desired server session.

The only sub-command at this time is 'set-current', and the name of the session to be used as the new current session is the only parameter.

Refer to the section on “NETCONF Session Configuration” for more details on using saved sessions.

+---x session
   +---w input
      +---w set-current    nt:NcxIdentifier

Command type:

local

Default parameter:

set-current

Min parameters:

1

Max parameters:

1

Return type:

status

YANG file:

yangcli-pro.yang

Capabilities needed:

none

Command Parameters:

  • set-default

    • type: name string

    • This mandatory parameter specifies the name of the session to set as the current session. The special session name 'default' is reserved for the session that can be activated with the 'connect' command.

Positive Response:

  • The session prompt should change to indicate the new current session.

Negative Response:

  • An error message will be printed if errors are detected locally.

andy@myserver>  session set-current session-A

session-A>

session-cfg

The 'session-cfg' command is used to access a named session.

There are 3 sub-commands:

  • delete

  • save

  • show (default)

Refer to the NETCONF Session Configuration section for more details on using saved sessions.

+---x session-cfg
   +---w input
      +---w (session-action)?
         +--:(show-case)
         |  +---w show?                IdentifierOrZero
         |  +---w (help-mode)?
         |     +--:(brief)
         |     |  +---w brief?         empty
         |     +--:(normal)
         |     |  +---w normal?        empty
         |     +--:(full)
         |        +---w full?          empty
         +--:(delete)
         |  +---w delete?              nt:NcxIdentifier
         +--:(save)
         |  +---w save?                nt:NcxIdentifier
         +--:(use-event-handler)
            +---w use-event-handler*   nt:NcxIdentifier

Command type:

local

Default parameter:

show

Min parameters:

1

Max parameters:

2

Return type:

status

YANG file:

yangcli-pro.yang

Capabilities needed:

none

Command Parameters:

  • delete

    • type: name string

    • This parameter specifies the name of the session to delete from the saved sessions in memory. An active session cannot be deleted.

  • save

    • type: name string

    • This parameter specifies the name of the session to save in the saved sessions in memory.

  • show

    • type: name string; default: empty string == current session

    • This parameter specifies the name of the session to show. An empty string indicates that the current session should be used.

    • The --brief, --normal, or --full parameter can be used for this sub-command.

Positive Response:

  • A message indicating the save or delete was done will be printed. The show command will generate some formatted output showing information on the requested session.

Negative Response:

  • An error message will be printed if errors are detected locally.

Usage:

andy@myserver> session-cfg save session-A

Saving current session as 'session-A'

andy@myserver>

sessions-cfg

The 'sessions-cfg' command is used to access the named session files.

There are 4 sub-commands:

  • clear

  • load

  • save

  • show (default)

Refer to the NETCONF Session Configuration section for more details on using saved sessions.

+---x sessions-cfg
    +---w input
       +---w (sessions-action)?
          +--:(show-case)
          |  +---w show?           empty
          |  +---w (help-mode)?
          |     +--:(brief)
          |     |  +---w brief?    empty
          |     +--:(normal)
          |     |  +---w normal?   empty
          |     +--:(full)
          |        +---w full?     empty
          +--:(clear)
          |  +---w clear?          empty
          +--:(load)
          |  +---w load?           string
          +--:(save)
             +---w save?           string

Command type:

local

Default parameter:

show

Min parameters:

1

Max parameters:

2

Return type:

status

YANG file:

yangcli-pro.yang

Capabilities needed:

none

Command Parameters:

  • clear

    • type: empty

    • This parameter indicates that all saved sessions in memory be deleted. This cannot be done if any of the sessions are currently active. Use 'session-cfg load' to restore the saved sessions.

  • load

    • type: string

    • This parameter identifies the file specification for the saved sessions to load. Any new named sessions will be added to the named sessions in memory.

  • save

    • type: name string

    • This parameter identifies the file specification for the saved sessions config file to load. The saved sessions in memory will be saved to this file.

  • show

    • type: name string; default: empty string == all sessions

    • This parameter specifies the name of the session to show.

    • The --brief, --normal, or --full parameter can be used for this sub-command.

Positive Response:

  • A message indicating the load, save or clear was done will be printed. The show command will generate some formatted output showing information on the requested sessions.

Negative Response:

  • An error message will be printed if errors are detected locally.

Usage:

session-A> sessions-cfg load ~/more-sessions.conf

Loading saved sessions from '/home/andy/more-sessions.conf'
Loaded saved sessions OK from '~/more-sessions.conf'

session-A>

set-log-level

The 'set-log-level' command is used to configure the server logging verbosity level. It is only supported by the netconfd-pro server.

This operation is defined as nacm:default-deny-all, so only a system superuser account can invoke this command by default.

This operation is defined in the yuma-system.yang and yumaworks-system.yang module so a prefix may be needed to use this command, depending on the server configuration. Both commands are the same.

This command is provided by the NETCONF server, not yangcli-pro. Refer to the <set-log-level> operation for parameter details.

Usage:

andy@myserver> set-log-level log-level=debug2

RPC OK Reply 29 for session 10:

andy@myserver>

set-my-session

The 'set-my-session' command is used to configure the session customization parameters on the server. It is only supported by the netconfd-pro server.

Since all parameters are optional, they need to be entered in the same command line as the command name. Otherwise the $$optional system variable needs to be set to 'true'. If not, then no parameters will be sent to the server, and no session parameters will be changed.

The yuma-mysession.yang module must be loaded in the server for this command to be available.

This command is provided by the NETCONF server, not yangcli-pro. Refer to the <set-my-session> operation for parameter details.

Usage:

andy@myserver>  set-my-session --linesize=64 --with-defaults=trim --message-indent=1

RPC OK Reply 25 for session 10:

andy@myserver>

sget

The 'sget' command is used to invoke a NETCONF <get> operation with a subtree filter.

A target node is specified (in 1 of 2 ways), and then the data structure is filled in. Only mandatory nodes will be filled in unless the $$optional system variable is set to 'true'. This step can be skipped completely with the 'nofill' parameter.

Refer to the fill command for more details on interactive mode data structure completion.

+---x sget
    +---w input
    |  +---w (from)
    |  |  +--:(varref)
    |  |  |  +---w varref?                string
    |  |  +--:(from-cli)
    |  |     +---w (target-parm)?
    |  |     |  +--:(target)
    |  |     |  |  +---w target           yang:xpath1.0
    |  |     |  +--:(urltarget-case)
    |  |     |     +---w urltarget        ywt:UrlPath
    |  |     |     +---w match-names?     ywt:NameMatchMode
    |  |     |     +---w alt-names?       ywt:AltNameMode
    |  |     |     +---w wildcard-keys?   boolean
    |  |     +---w optional?              empty
    |  |     +---w value?                 <anyxml>
    |  +---w nofill?                      empty
    |  +---w with-defaults?               CliWithDefaultsType
    |  +---w depth?                       union
    |  +---w module-tag*                  string
    +--ro output
       +--ro data?   <anyxml>

Command type:

remote

Default parameter:

target

Min parameters:

1

Max parameters:

6

Return type:

data

YANG file:

yangcli-pro.yang

Capabilities needed:

none

Capabilities optional:

:with-defaults

Command Parameters:

  • choice 'from' (not entered)

    • type: choice of case 'varref' or case 'from-cli'

    • usage: mandatory

    • default: none

    • This parameter specifies the where yangcli-pro should get the data from, for the subtree filter target of the <get> operation. It is either a user variable or from interactive input at the command line.

      • varref

        • type: string

        • usage: mandatory

        • default: none

        • This parameter specifies the name of the user variable to use for the subtree filter target of the <get> operation. The parameter must exist (e.g., created with the fill command) or an error message will be printed.

      • case from-cli (not entered)

        • target

          • type: string

          • usage: optional (target or urltarget must be present)

          • default: none

          • This parameter specifies the database target node of the <get> operation. This is an ncx:schema-instance string, so any instance identifier, or absolute path expression, or something in between, is accepted.

            • The escape command ('?s') can be used in parameter mode to skip a parameter completely.

            • Entering the empty string for a parameter will cause a subtree selection node to be created instead of a content match node

        • urltarget

          • type: string

          • usage: optional

          • default: none

          • This parameter specifies the database target node of the get operation. This is an UrlPath string.

        • optional

          • type: empty

          • usage: optional

          • default: controlled by $$optional system variable

          • This parameter controls whether optional nodes within the target will be filled in. It can be used to override the $$optional system variable, when it is set to 'false'.

        • value

          • type: anyxml

          • usage: mandatory

          • default: none

          • This parameter specifies the value that should be used for the contents of the 'target' parameter. If it is entered, then the interactive mode prompting for missing parameters will be skipped, if this parameter is complete (or all mandatory nodes present if the $$optional system variable is 'false'). For example, if the target is a leaf, then specifying this parameter will always cause the interactive prompt mode to be skipped.

  • nofill

    • type: empty

    • usage: optional

    • default: none

    • This parameter specifies the that no interactive prompting to fill in the contents of the specified subtree filter target will be done.

      • This causes the entire selected subtree to be requested in the filter.

      • yangcli-pro will attempt to figure out if there can be multiple instances of the requested subtree. If not, then 'nofill' will be the default for that target parameter.

  • with-defaults

    • type: enumeration (none report-all report-all-tagged trim explicit)

    • usage: optional

    • default: none

    • capabilities needed: with-defaults

    • This parameter controls how nodes containing only default values are returned in the <rpc-reply>.

  • depth

    • type: uint16 or “unbounded”

    • usage: optional

    • default: unbounded

    • capabilities needed: none: netconfd-pro NETCONF extension

    • This parameter controls how many levels of subtrees should be returned in the <rpc-reply>.

  • module-tag:

    • type: string

    • default: none

    • capabilities needed: none

    • This parameter is used as a filter to include only data nodes from modules that match the module-tag value. Multiple module-tag parameters can be used, combined to form a logical OR expression. At least one module-tag must match or no data will be returned. This filter is combined with the XPath or subtree filter, if present.

System Variables:

  • $$timeout

    • The response timeout interval will be derived from this system variable.

  • $$with-defaults

    • The <with-defaults> parameter for the <get> operation will be derived from this system variable.

Positive Response:

  • the server returns <data>

Negative Response:

  • An error message will be printed if errors are detected locally.

  • An <rpc-error> message will be printed if the server detected an error.

Output:

  • data

    • type: anyxml

    • This element will contain the requested data from the <running> database or non-config data structures.

Usage:

andy@myserver> sget system

Filling container /system:
RPC Data Reply 32 for session 10:

rpc-reply {
   data {
      system {
         sysName myserver.localdomain
         sysCurrentDateTime 2009-07-06T02:24:19Z
         sysBootDateTime 2009-07-05T19:22:28Z
      }
   }
}

andy@myserver>

Reference:

sget-config

The 'sget-config' command is used to invoke a NETCONF <get-config> operation with a subtree filter.

A target node is specified (in 1 of 2 ways), and then the data structure is filled in. Only mandatory nodes will be filled in unless the $$optional system variable is set to 'true'. This step can be skipped completely with the 'nofill' parameter.

Refer to the fill command for more details on interactive mode data structure completion.

+---x sget-config
   +---w input
   |  +---w (from)
   |  |  +--:(varref)
   |  |  |  +---w varref?                string
   |  |  +--:(from-cli)
   |  |     +---w (target-parm)?
   |  |     |  +--:(target)
   |  |     |  |  +---w target           yang:xpath1.0
   |  |     |  +--:(urltarget-case)
   |  |     |     +---w urltarget        ywt:UrlPath
   |  |     |     +---w match-names?     ywt:NameMatchMode
   |  |     |     +---w alt-names?       ywt:AltNameMode
   |  |     |     +---w wildcard-keys?   boolean
   |  |     +---w optional?              empty
   |  |     +---w value?                 <anyxml>
   |  +---w nofill?                      empty
   |  +---w with-defaults?               CliWithDefaultsType
   |  +---w depth?                       union
   |  +---w module-tag*                  string
   |  +---w source
   |     +---w (config-source)
   |        +--:(candidate)
   |        |  +---w candidate?   empty {nc:candidate}?
   |        +--:(running)
   |        |  +---w running?     empty
   |        +--:(startup)
   |        |  +---w startup?     empty {nc:startup}?
   |        +--:(url)
   |           +---w url?         nc:ConfigURIType {nc:url}?
   +--ro output
      +--ro data?   <anyxml>

Command type:

remote

Default parameter:

target

Min parameters:

2

Max parameters:

7

Return type:

data

YANG file:

yangcli-pro.yang

Capabilities needed:

none

Capabilities optional:

:candidate :startup :url :with-defaults

Command Parameters:

  • choice 'from' (not entered)

    • type: choice of case 'varref' or case 'from-cli'

    • usage: mandatory

    • default: none

    • This parameter specifies the where yangcli-pro should get the data from, for the subtree filter target of the <get> operation. It is either a user variable or from interactive input at the command line.

      • varref

        • type: string

        • usage: mandatory

        • default: none

        • This parameter specifies the name of the user variable to use for the subtree filter target of the <get> operation. The parameter must exist (e.g., created with the fill command) or an error message will be printed.

      • case from-cli (not entered)

        • target

          • type: string

          • usage: optional (target or urltarget must be present)

          • default: none

          • This parameter specifies the database target node of the <get> operation. This is an ncx:schema-instance string, so any instance identifier, or absolute path expression, or something in between, is accepted.

            • The escape command ('?s') can be used in parameter mode to skip a parameter completely.

            • Entering the empty string for a parameter will cause a subtree selection node to be created instead of a content match node

        • urltarget

          • type: string

          • usage: optional

          • default: none

          • This parameter specifies the database target node of the get-config operation. This is an UrlPath string.

        • optional

          • type: empty

          • usage: optional

          • default: controlled by $$optional system variable

          • This parameter controls whether optional nodes within the target will be filled in. It can be used to override the $$optional system variable, when it is set to 'false'.

        • value

          • type: anyxml

          • usage: mandatory

          • default: none

          • This parameter specifies the value that should be used for the contents of the 'target' parameter. If it is entered, then the interactive mode prompting for missing parameters will be skipped, if this parameter is complete (or all mandatory nodes present if the $$optional system variable is 'false'). For example, if the target is a leaf, then specifying this parameter will always cause the interactive prompt mode to be skipped.

  • nofill

    • type: empty

    • usage: optional

    • default: none

    • This parameter specifies the that no interactive prompting to fill in the contents of the specified subtree filter target will be done.

      • This causes the entire selected subtree to be requested in the filter.

      • yangcli-pro will attempt to figure out if there can be multiple instances of the requested subtree. If not, then nofill will be the default for that target parameter.

  • source

    • type: container with 1 of N choice of leafs

    • usage: mandatory

    • default: none

    • This parameter specifies the name of the source database for the retrieval operation.

    • container contents: 1 of N:

      • candidate

      • running

        • type: empty

        • capabilities needed: none

      • startup

        • type: empty

        • capabilities needed: startup

      • url

        • type: yang:uri

        • capabilities needed: :url, and the scheme used in the URL must be specified in the :url capability 'schemes' parameter

        • To enter this parameter, the interactive mode must be used. The shorthand mode (source=url) cannot be used, since this parameter contains a string.

  • with-defaults

    • type: enumeration (none report-all report-all-tagged trim explicit)

    • usage: optional

    • default: none

    • capabilities needed: with-defaults

    • This parameter controls how nodes containing only default values are returned in the <rpc-reply>.

  • depth

    • type: uint16 or “unbounded”

    • usage: optional

    • default: unbounded

    • capabilities needed: none: netconfd-pro NETCONF extension

    • This parameter controls how many levels of subtrees should be returned in the <rpc-reply>.

  • module-tag:

    • type: string

    • default: none

    • capabilities needed: none

    • This parameter is used as a filter to include only data nodes from modules that match the module-tag value. Multiple module-tag parameters can be used, combined to form a logical OR expression. At least one module-tag must match or no data will be returned. This filter is combined with the XPath or subtree filter, if present.

System Variables:

  • $$timeout

    • The response timeout interval will be derived from this system variable.

  • $$with-defaults

    • The <with-defaults> parameter for the <get-config> operation will be derived from this system variable.

Positive Response:

  • the server returns <data>

Negative Response:

  • An error message will be printed if errors are detected locally.

  • An <rpc-error> message will be printed if the server detected an error.

Output:

  • data

    • type: anyxml

    • This element will contain the requested data from the database indicated by the 'source' parameter.

Usage:

andy@myserver> sget-config /nacm/rules/data-rule \
        source=candidate \
        nofill

RPC Data Reply 35 for session 10:

rpc-reply {
   data {
     nacm {
         rules {
            data-rule nacm-tree {
               name nacm-tree
               path /nacm:nacm
               allowed-rights {
                  read
                  write
               }
               allowed-group nacm:admin
               comment 'access to nacm config'
            }
         }
      }
   }
}

andy@myserver>

sget-data

The 'sget-data' command is used to invoke a NETCONF NMDA <get-data> operation with a subtree filter.

  • This command will not work unless the server supports the <get-data> operation from RFC 8526, in ietf-netconf-nmda.yang.

  • A target node is specified (in 1 of 2 ways), and then the data structure is filled in. Only mandatory nodes will be filled in unless the $$optional system variable is set to 'true'. This step can be skipped completely with the 'nofill' parameter.

  • Refer to the fill command for more details on interactive mode data structure completion.

  • The ietf-netconf-nmda.yang module must be loaded in the server for this command to be available.

+---x sget-data
   +---w input
   |  +---w datastore?                     enumeration
   |  +---w (from)
   |  |  +--:(varref)
   |  |  |  +---w varref?                  string
   |  |  +--:(from-cli)
   |  |     +---w (target-parm)?
   |  |     |  +--:(target)
   |  |     |  |  +---w target             yang:xpath1.0
   |  |     |  +--:(urltarget-case)
   |  |     |     +---w urltarget          ywt:UrlPath
   |  |     |     +---w match-names?       ywt:NameMatchMode
   |  |     |     +---w alt-names?         ywt:AltNameMode
   |  |     |     +---w wildcard-keys?     boolean
   |  |     +---w optional?                empty
   |  |     +---w value?                   <anyxml>
   |  +---w nofill?                        empty
   |  +---w with-defaults?                 CliWithDefaultsType
   |  +---w depth?                         union
   |  +---w module-tag*                    string
   |  +---w config-filter?                 boolean
   |  +---w (origin-filters)?
   |  |  +--:(origin-filter)
   |  |  |  +---w origin-filter*           or:origin-ref
   |  |  +--:(negated-origin-filter)
   |  |     +---w negated-origin-filter*   or:origin-ref
   |  +---w with-origin?                   empty
   +--ro output
      +--ro data?   <anyxml>

Command type:

remote

Default parameter:

target

Min parameters:

2

Max parameters:

8

Return type:

data

YANG file:

yangcli-pro.yang

Capabilities needed:

none

Capabilities optional:

:candidate :startup :url :with-defaults

Command Parameters:

  • choice 'from' (not entered)

    • type: choice of case 'varref' or case 'from-cli'

    • usage: mandatory

    • default: none

    • This parameter specifies the where yangcli-pro should get the data from, for the subtree filter target of the <get> operation. It is either a user variable or from interactive input at the command line.

      • varref

        • type: string

        • usage: mandatory

        • default: none

        • This parameter specifies the name of the user variable to use for the subtree filter target of the <get> operation. The parameter must exist (e.g., created with the fill command) or an error message will be printed.

      • case from-cli (not entered)

        • target

          • type: string

          • usage: optional (target or urltarget must be present)

          • default: none

          • This parameter specifies the database target node of the <get> operation. This is an ncx:schema-instance string, so any instance identifier, or absolute path expression, or something in between, is accepted.

            • The escape command ('?s') can be used in parameter mode to skip a parameter completely.

            • Entering the empty string for a parameter will cause a subtree selection node to be created instead of a content match node

        • urltarget

          • type: string

          • usage: optional

          • default: none

          • This parameter specifies the database target node of the get-config operation. This is an UrlPath string.

        • optional

          • type: empty

          • usage: optional

          • default: controlled by $$optional system variable

          • This parameter controls whether optional nodes within the target will be filled in. It can be used to override the $$optional system variable, when it is set to 'false'.

        • value

          • type: anyxml

          • usage: mandatory

          • default: none

          • This parameter specifies the value that should be used for the contents of the 'target' parameter. If it is entered, then the interactive mode prompting for missing parameters will be skipped, if this parameter is complete (or all mandatory nodes present if the $$optional system variable is 'false'). For example, if the target is a leaf, then specifying this parameter will always cause the interactive prompt mode to be skipped.

  • nofill

    • type: empty

    • usage: optional

    • default: none

    • This parameter specifies the that no interactive prompting to fill in the contents of the specified subtree filter target will be done.

      • This causes the entire selected subtree to be requested in the filter.

      • yangcli-pro will attempt to figure out if there can be multiple instances of the requested subtree. If not, then nofill will be the default for that target parameter.

  • datastore

    • type: leaf containing a datastore-ref

    • usage: mandatory

    • This parameter specifies the name of the source NMDA datastore for the retrieval operation.

    • enumeration:

      • candidate

      • running

        • capabilities needed: none

      • startup

        • capabilities needed: startup

      • operational

        • capabilities needed: none

  • with-defaults

    • type: enumeration (none report-all report-all-tagged trim explicit)

    • usage: optional

    • default: none

    • capabilities needed: with-defaults

    • This parameter controls how nodes containing only default values are returned in the <rpc-reply>.

  • depth

    • type: uint16 or “unbounded”

    • usage: optional

    • default: unbounded

    • capabilities needed: none

    • This parameter controls how many levels of subtrees should be returned in the <rpc-reply>. This is called the <max-depth> parameter in the <get-data> operations.

  • config-filter:

    • type boolean

    • Specifies the type of data based on config-stmt. Retrieve all data if this parameter is not present. This is a top-down filter. It will not select nodes within a subtree if the ancestor nodes do not match the filter.

    • Only relevant if the datastore parameter is ‘operational’.

    • If set to ‘false’ for any datastore other than ‘operational’ then an empty <data> element will be returned.

  • origin-filter:

    • type: leaf-list of type origin-ref..

    • This parameter will select data nodes with the specified origin. This is a top-down filter. It will not select nodes within a subtree if the ancestor nodes do not match the filter.

    • Cannot be used if negated-origin-filter present

    • Can only be used if the datastore parameter is ‘operational’

  • negated-origin-filter:

    • type: leaf-list of type origin-ref..

    • This parameter will select data nodes if they do not have the specified origin. This is a top-down filter. It will not select nodes within a subtree if the ancestor nodes do not match the filter.

    • Cannot be used if origin-filter present

    • Can only be used if the datastore parameter is ‘operational’

  • with-origin

    • type: empty

    • This parameter will cause the origin attribute to be added to data nodes returned by the server.

    • Can only be used if the datastore parameter is ‘operational’

System Variables:

  • $$timeout

    • The response timeout interval will be derived from this system variable.

  • $$with-defaults

    • The <with-defaults> parameter for the <get-config> operation will be derived from this system variable.

Positive Response:

  • the server returns <data>

Negative Response:

  • An error message will be printed if errors are detected locally.

  • An <rpc-error> message will be printed if the server detected an error.

Output:

  • data

    • type: anyxml

    • This element will contain the requested data from the database indicated by the 'source' parameter.

Usage:

Reference:

show

The 'show' command is used to show program status and YANG details that may be needed during management of a NETCONF server.

There are several variants of the 'show' command:

  • The show cache command prints the yangcli-pro YANG module cache.

  • The show callhome command prints the Call Home server status.

  • The show cli command prints the contents of the yangcli-pro CLI and config file parameters.

  • The show connected command prints the all connected sessions.

  • The show diff command prints the differences between current config and the edits that have not been applied yet.

  • The show edit command prints subtree that is the current node which is from the current edit, not the stored config.

  • The show global command prints the contents of one global user variable.

  • The show globals command prints a summary or the contents of all the global user variables.

  • The show local command prints the contents of one local user variable.

  • The show locals command prints a summary or the contents of all the local user variables.

  • The show module command prints meta information or help text for one YANG module.

  • The show modules command prints meta information for all the currently available YANG modules. If a session is active, this will be the list of modules the server reported, plus any modules loaded with the mgrload command.

  • The show modules-state command prints cached modules-state for each server.

  • The show objects command prints the available objects or help text for the available objects.

  • The show running command prints the entire config for the current session , error if there is no current session.

  • The show session command prints the session startup screen information for the current session.

  • The show search-path-module command prints the YANG module search path in use.

  • The server-commands prints the server commands (not in config mode). It is top-level only and only relevant if session is connected.

  • The show subscriptions command prints the status of the NETCONF notification subscriptions for the current session.

  • The show system command prints the contents of the yangcli-pro system variables.

  • The show terminal command prints the terminal length

  • The show var command prints the contents of the specified variable.

  • The show vars command prints a summary or the contents of all the program variables.

  • The show version command prints the yangcli-pro version number

+---x show
|  +---w input
|     +---w (showtype)
|     |  +--:(cache)
|     |  |  +---w cache?                empty
|     |  +--:(callhome)
|     |  |  +---w callhome?             empty
|     |  +--:(cli)
|     |  |  +---w cli?                  empty
|     |  +--:(diff)
|     |  |  +---w diff?                 empty
|     |  +--:(edit)
|     |  |  +---w edit?                 empty
|     |  +--:(connected)
|     |  |  +---w connected?            empty
|     |  +--:(module)
|     |  |  +---w module?               nt:NcxIdentifier
|     |  +--:(modules)
|     |  |  +---w modules?              empty
|     |  +--:(modules-state)
|     |  |  +---w modules-state?        empty
|     |  +--:(local)
|     |  |  +---w local?                nt:NcxName
|     |  +--:(locals)
|     |  |  +---w locals?               empty
|     |  +--:(global)
|     |  |  +---w global?               nt:NcxName
|     |  +--:(globals)
|     |  |  +---w globals?              empty
|     |  +--:(group-vars)
|     |  |  +---w group-vars?           IdentifierOrZero
|     |  +--:(objects)
|     |  |  +---w objects?              empty
|     |  +--:(running)
|     |  |  +---w running               empty
|     |  |  +---w select?               string
|     |  +--:(search-path-module)
|     |  |  +---w search-path-module?   empty
|     |  +--:(server-commands)
|     |  |  +---w server-commands?      empty
|     |  +--:(session)
|     |  |  +---w session?              empty
|     |  +--:(session-vars)
|     |  |  +---w session-vars?         IdentifierOrZero
|     |  +--:(subscriptions)
|     |  |  +---w subscriptions?        empty
|     |  +--:(system)
|     |  |  +---w system?               empty
|     |  +--:(terminal)
|     |  |  +---w terminal?             empty
|     |  +--:(var)
|     |  |  +---w var?                  nt:NcxName
|     |  +--:(vars)
|     |  |  +---w vars?                 empty
|     |  +--:(version)
|     |     +---w version?              empty
|     +---w (help-mode)?
|        +--:(brief)
|        |  +---w brief?                empty
|        +--:(normal)
|        |  +---w normal?               empty
|        +--:(full)
|           +---w full?                 empty

Command type:

local

Default parameter:

none

Min parameters:

1

Max parameters:

2

Return type:

data

YANG file:

yangcli-pro.yang

Command Parameters:

  • choice help-mode (not entered) (default choice is 'normal')

    • brief

      • type: empty

      • usage: optional

      • default: none

      • This parameter specifies that brief documentation mode should be used.

    • normal

      • type: empty

      • usage: optional

      • default: none

      • This parameter specifies that normal documentation mode should be used.

    • full

      • type: empty

      • usage: optional

      • default: none

      • This parameter specifies that full documentation mode should be used.

  • choice showtype (not entered)

    • mandatory 1 of N choice for the sub-command for the 'show' command

      • cache

        • type: empty

        • usage: mandatory

        • default: none

        • This parameter selects the yangcli-pro module cache information.

      • callhome

        • type: empty

        • usage: mandatory

        • default: none

        • This parameter selects the Call Home server information.

      • cli

        • type: empty

        • usage: mandatory

        • default: none

        • This parameter selects the yangcli-pro CLI and configuration variables.

      • connected

        • type: empty

        • usage: mandatory

        • default: none

        • This parameter prints a summary of the currently connected sessions.

      • diff

        • type: empty

        • usage: mandatory

        • default: none

        • The parameter prints the differences between current config and the edits that have not been applied yet.

      • edit

        • type: empty

        • usage: mandatory

        • default: none

        • The parameter prints subtree that is the current node which is from the current edit, not the stored config.

      • global

        • type: string

        • usage: mandatory

        • default: none

        • This parameter specifies the name of the global variable to show information for.

        • If help-mode is 'brief', then the name, variable object, and type of the global variable object will be printed.

        • If help-mode is 'normal' or 'full', then the contents of the specified global variable will be printed.

      • globals

        • type: empty

        • usage: mandatory

        • default: none

        • This parameter specifies that information for all global variables should be printed.

        • If help-mode is 'brief', then the name, variable object, and type of each global variable object will be printed.

        • If help-mode is 'normal' or 'full', then the contents of each global variable will be printed.

      • local

        • type: string

        • usage: mandatory

        • default: none

        • This parameter specifies the name of the local variable to show information for.

        • If help-mode is 'brief', then the name, variable object, and type of the local variable object will be printed.

        • If help-mode is 'normal' or 'full', then the contents of the specified local variable will be printed.

      • locals

        • type: empty

        • usage: mandatory

        • default: none

        • This parameter specifies that information for all local variables should be printed.

        • If help-mode is 'brief', then the name, variable object, and type of each local variable object will be printed.

        • If help-mode is 'normal' or 'full', then the contents of each local variable will be printed.

      • module

        • type: string

        • usage: mandatory

        • default: none

        • This parameter specifies the name of the module to show information for.

        • If help-mode is 'brief' or 'normal', then the name, version, namespace, and source of the module will be printed.

        • If help-mode is 'full', then the module level help text for the specified module will be printed.

      • modules

        • type: empty

        • usage: mandatory

        • default: none

        • This parameter specifies that information for all available modules should be printed:

        • If help-mode is 'brief', then the name of each module will be printed.

        • If help-mode is 'normal', then the XML prefix, name, and revision date of each module will be printed.

        • If help-mode is 'full', then the name, revision date, prefix, namespace, and source of each module will be printed.

      • objects

        • type: empty

        • usage: mandatory

        • default: none

        • This parameter specifies that information for all available database objects should be printed:

        • If help-mode is 'brief', then the module name and name of each object will be printed.

        • If help-mode is 'normal', then the YANG object type, object name, and YANG base type will be printed.

        • If help-mode is 'full', then brief help text will be printed for every object.

      • running

        • type: empty

        • usage: mandatory

        • default: none

        • This parameter prints the entire config for the current session , error if there is no current session.

      • search-path-module

        • type: empty

        • usage: mandatory

        • default: none

        • This parameter specifies that the YANG module search path should be printed.

      • server-commands

        • type: empty

        • usage: mandatory

        • default: none

        • This parameter display server commands (not in config mode).

      • subscriptions

        • type: empty

        • usage: mandatory

        • default: none

        • This parameter specifies that information for all subscriptions should be printed.

        • Introduced: 23.10T-11

      • system

        • type: empty

        • usage: mandatory

        • default: none

        • This parameter specifies that information for all system variables should be printed.

      • terminal

        • type: empty

        • usage: mandatory

        • default: none

        • This parameter specifies that information about the terminal settings should be printed.

      • var

        • type: string

        • usage: mandatory

        • default: none

        • This parameter specifies the name of any variable to show information for.

        • If help-mode is 'brief', then the name, variable object, and type of the variable object will be printed.

        • If help-mode is 'normal' or 'full', then the contents of the specified variable will be printed.

      • vars

        • type: empty

        • usage: mandatory

        • default: none

        • This parameter specifies that information for all variables should be printed. This includes all CLI, read-only system, read-write system, global user, and local user variables.

        • If help-mode is 'brief', then the name, variable object, and type of each variable object will be printed.

        • If help-mode is 'normal' or 'full', then the contents of each variable will be printed.

      • version

        • type: empty

        • usage: mandatory

        • default: none

        • This parameter specifies that the yangcli-pro program version string should be printed.

Positive Response:

  • the server prints the requested information

Negative Response:

  • An error message will be printed if errors are detected.

Usage:

andy@myserver> show modules

          nc:netconf/2009-04-10
          inet:ietf-inet-types/2009-05-13
          ns:ietf-netconf-monitoring/2009-03-03
          wd:ietf-with-defaults/2009-04-10
          yang:ietf-yang-types/2009-05-13
          nacm:nacm/2009-05-13
          manageEvent:nc-notifications/2008-07-14
          ncx:ncx/2009-06-12
          ncxapp:ncx-app-common/2009-04-10
          nt:ncxtypes/2008-07-20
          nd:netconfd-pro/2009-05-28
          ncEvent:notifications/2008-07-14
          sys:system/2009-06-04
          t:test/2009-06-10

        andy@myserver>

andy@myserver> show running
  data {
    nacm {
      groups {
        group  aa {
          name aa
          user-name a1
          user-name a2
        }
      }
    }
  }


andy@myserver> sho edit
Only available in config mode.

andy@myserver> sho diff
Only available in config mode.

andy@myserver> conf t
andy@myserver# nacm groups
andy@myserver(groups)# group bb
andy@myserver(group)# user-name b1
andy@myserver(group)# user-name b2

andy@myserver(group)# do show edit
nacm {
  groups {
    group  bb {
      name bb
      user-name b1
      user-name b2
    }
  }
}

andy@myserver(group)# do show diff
Edited to merge:
nacm {
  groups {
    group  bb {
      name bb
      user-name b1
      user-name b2
    }
  }
}

Configured:
nacm {
  groups {
    group  aa {
      name aa
      user-name a1
      user-name a2
    }
  }
}

andy@myserver(group)# apply
Applying 1 edit to session 'default'
andy@myserver(group)# do sho running
data {
  nacm {
    groups {
      group  aa {
        name aa
        user-name a1
        user-name a2
      }
      group  bb {
        name bb
        user-name b1
        user-name b2
      }
    }
  }
}
andy@myserver(group)#

shutdown

The 'shutdown' command is used to shut down the NETCONF server. This command is only supported by the netconfd-pro server.

The default access control configuration for netconfd-pro will not allow any user except the designated 'superuser' account to invoke this command. Refer to the Access Control section for details.

The yuma-system.yang module must be loaded in the server for this command to be available.

This command is provided by the NETCONF server, not yangcli-pro. Refer to the <shutdown> operation for parameter details.

Usage:

andy@myserver> shutdown

ses: session 10 shut by remote peer

>

sleep

The 'sleep' command is used to pause for a number of seconds. It is intended to be used within a script.

Example script:

# send 20 get-config requests, 1 per second
while 1 maxloops=20
get-config source=running
sleep 1
end
+---x sleep
   +---w input
      +---w seconds    uint16

Command type:

local

Default parameter:

seconds

Min parameters:

1

Max parameters:

1

Return type:

none

YANG file:

yangcli-pro.yang

Capabilities needed:

none

Capabilities optional:

none

Command Parameters:

  • seconds

    • type: uint16 (1 .. 3600)

    • usage: mandatory

    • This parameter specifies the number of seconds to sleep

Positive Response:

  • none

Negative Response:

  • An error message will be printed if errors are detected locally.

Usage:

session-B> sleep 1

session-B>

start-rpc-timing

The 'start-rpc-timing' command is used to start remote operation timing mode, except that statistics can be saved to a text file for plotting or for data entry into a database program. It is used to do simple roundtrip performance measurements. It is used along with the stop-rpc-timing command.

This command automatically sets the following variables to temporary values, which are restored when the stop-rpc-timing command is invoked.

  • $$echo-replies = false

  • $$rpc-timing = true

  • $$rpc-timing-stats = true

+---x start-rpc-timing
   +---w input
      +---w statfile?   string

Command type:

local

Default parameter:

statfile

Min parameters:

1

Max parameters:

1

Return type:

status

YANG file:

yangcli-pro.yang

Capabilities needed:

none

Capabilities optional:

none

Command Parameters:

  • statfile

    • type: file specification

    • usage: mandatory

    • This parameter specifies the file specification for saving the timing statistics.

Positive Response:

  • the client prints OK

Negative Response:

  • An error message will be printed if errors are detected locally.

Usage:

session-B> start-rpc-timing

OK

session-B>

start-session

The 'start-session' command is used to start a session with a NETCONF server. It is similar to the connect command except the parameters are derived from a saved session in memory instead of entered explicitly.

+---x start-session
   +---w input
      +---w name?   nt:NcxIdentifier

Command type:

local

Default parameter:

name

Min parameters:

1

Max parameters:

1

Return type:

status

YANG file:

yangcli-pro.yang

Command Parameters:

  • name

    • type: session name string

    • usage: mandatory

    • This parameter specifies the name of the session to start.

Positive Response:

  • The startup screen for the session should be generated and the prompt should change, indicating the new named session is now the current session.

Negative Response:

  • An error message will be printed if errors are detected locally.

Usage:

session-A> start-session session-B

yangcli: Starting NETCONF session for user on myserver

NETCONF session established for user on myserver

Client Session Id: 2
Server Session Id: 4

Server Protocol Capabilities
   base:1.0
   candidate:1.0
   confirmed-commit:1.0
   rollback-on-error:1.0
   validate:1.0
   url:1.0
   xpath:1.0
   notification:1.0
   interleave:1.0
   partial-lock:1.0
   with-defaults:1.0
   base:1.1
   validate:1.1
   confirmed-commit:1.1
   yang-library:1.0

Server Module Capabilities
   ietf-inet-types@2010-09-24
   ietf-netconf-acm@2012-02-22
   ietf-netconf-monitoring@2010-10-04
   ietf-netconf-partial-lock@2009-10-19
   ietf-netconf-with-defaults@2011-06-01
   ietf-yang-library@2016-06-21
   ietf-yang-types@2010-09-24
   nc-notifications@2008-07-14
   notifications@2008-07-14
   yuma-app-common@2012-08-16
   yuma-arp@2012-01-13
   yuma-interfaces@2012-01-13
   yuma-mysession@2010-05-10
   yuma-ncx@2012-01-13
   yuma-proc@2010-06-01
   yuma-system@2012-01-15
   yuma-time-filter@2011-08-13
   yuma-types@2012-06-01
   yumaworks-app-common@2012-08-16
   yumaworks-extensions@2012-06-28

Server Enterprise Capabilities
   None

Protocol version set to: RFC 6241 (base:1.1)
Default target set to: <candidate>
Save operation mapped to: commit
Default with-defaults behavior: explicit
Additional with-defaults behavior: trim,report-all,report-all-tagged
Yang-Library set to: RFC 7895
module-set-id: 6765

Checking Server Modules...

session-B>

start-timer

The 'start-timer' command is used to start a timer to do simple performance measurements. It is used along with the stop-timer command.

+---x start-timer
   +---w input
      +---w id?           TimerId
      +---w restart-ok?   boolean

Command type:

local

Default parameter:

id

Min parameters:

1

Max parameters:

2

Return type:

status

YANG file:

yangcli-pro.yang

Capabilities needed:

none

Capabilities optional:

none

Command Parameters:

  • id

    • type: number

    • usage: mandatory

    • default: 0

    • This parameter specifies the numeric ID of the timer. It is a number in the range 0 to 15.

  • restart-ok

    • type: boolean

    • usage: optional

    • default: true

    • Indicates whether the timer will be used if it is already running. If 'true', the timer will be restarted if it is already running. If 'false', an error will occur if the timer is already running.

Positive Response:

  • the client prints OK

Negative Response:

  • An error message will be printed if errors are detected locally.

Usage:

andy@myserver> start-timer 1

OK

andy@myserver>

stop-rpc-timing

The 'stop-rpc-timing' command is used to stop remote operation timing mode. It is used with the start-rpc-timing command. This command automatically sets the following variables to the specified values:

  • $$echo-replies = <previous value before start-rpc-timing>

  • $$rpc-timing = false

  • $$rpc-timing-stats = false

+---x stop-rpc-timing

Command type:

local

Default parameter:

none

Min parameters:

0

Max parameters:

0

Return type:

status

YANG file:

yangcli-pro.yang

Capabilities needed:

none

Capabilities optional:

none

Positive Response:

  • the client prints OK

Negative Response:

  • An error message will be printed if errors are detected locally.

Usage:

session-B> stop-rpc-timing

OK

session-B>

stop-session

The 'stop-session' command is used to stop a session with a NETCONF server. It will invoke the close-session command for the specified session. It is used with the start-session command.

+---x stop-session
   +---w input
      +---w name    nt:NcxIdentifier

Command type:

local

Default parameter:

name

Min parameters:

1

Max parameters:

1

Return type:

status

YANG file:

yangcli-pro.yang

Command Parameters:

  • name

    • type: session name string

    • usage: mandatory

    • This parameter specifies the name of the session to stop. The string 'default' is used to identify the default session, if that was started with the start-session or connect command.

Positive Response:

  • The prompt should change if the current session is stopped

Negative Response:

  • An error message will be printed if errors are detected locally.

Usage:

session-B> stop-session session-B

RPC OK Reply 4 for session 4 [session-B]:

ses: session 2 shut by remote peer

>

stop-timer

The 'stop-timer' command is used to stop a timer to do simple performance measurements. It is used along with the start-timer command.

+---x stop-timer
   +---w input
   |  +---w id?     TimerId
   |  +---w echo?   boolean
   +--ro output
      +--ro delta?   decimal64

Command type:

local

Default parameter:

id

Min parameters:

1

Max parameters:

2

Return type:

data

YANG file:

yangcli-pro.yang

Capabilities needed:

none

Capabilities optional:

none

Command Parameters:

  • id

    • type: number

    • usage: mandatory

    • default: 0

    • This parameter specifies the numeric ID of the timer. It is a number in the range 0 to 15.

  • echo

    • type: boolean

    • usage: optional

    • default: true

    • Indicates whether the delta result should be printed to the log.

Positive Response:

  • data: the elapsed time is returned and can be used in assignment statements

Negative Response:

  • An error message will be printed if errors are detected locally.

Usage:

andy@myserver> $time = stop-timer 1

Elapsed time: 2.003345 seconds

andy@myserver>

subscribe

The 'subscribe' command is used to start a NETCONF notification subscription. Refer to the Using Notifications section for an introduction to NETCONF notifications.

  • This command is available starting in the 23.10T-11 release

  • The WITH_YANG_PUSH compiler flag must be used to build yangcli-pro

  • This command is not available in 'yp-shell'

> subscribe stream NETCONF
> subscribe stream my-stream1
> subscribe data /interfaces-state
> subscribe data /interfaces-state refresh-rate=500
+---x subscribe
|  +---w input
|     +---w (subscribe-choice)
|     |  +--:(stream)
|     |  |  +---w stream          ywt:admin-string
|     |  |  +---w filter?         string
|     |  +--:(datastore)
|     |     +---w data            string
|     |     +---w datastore?      string
|     |     +---w refresh-rate?   uint16
|     |     +---w on-change?      boolean
|     +---w description?          string

Command type:

local

Default parameter:

none

Min parameters:

1

Max parameters:

4

Return type:

ok

YANG file:

yangcli-pro.yang

Capabilities needed:

none

Capabilities optional:

none

Introduced:

23.10T-11

Command Parameters:

  • description (common)

    • type: string

    • usage: optional

    • default: none

    • This parameter specifies a description to save with the parameters.

      • This value is shown in the 'show subscriptions' command output

subscribe stream

  • stream

    • type: string (size 1 .. 1024)

    • usage: mandatory

    • default: none

    • This parameter specifies the name of the event stream.

    • The standard NETCONF event stream should be supported by the server.

    • Additional event streams may be present on the server.

    • Retrieve the /streams subtree from the server to determine the available event streams.

  • filter

    • type: string

    • usage: optional

    • default: none

    • Specifies the filter to use for the subscription

      • If the string begins with a '/' character then it is treated as an XPath expression.

      • Otherwise the filter it treated as a 'filter ref' and is the name of a stored filter on the server in the /filters subtree.

    • A notification subscription is not the same as a retrieval filter.

      • It is used to select event-types and it processed as a boolean filter.

      • A filter failure does not prune data; it prunes the entire event.

subscribe data

  • data

    • type: string

    • usage: mandatory

    • default: none

    • Specifies the XPath filter or filter name to use for the datastore subscription.

      • If the string begins with a '/' character then it is treated as an XPath expression.

      • Otherwise the filter it treated as a 'filter ref' and is the name of a stored filter on the server in the /filters subtree.

  • datastore

    • type: string

    • usage: optional

    • default: operational

    • This parameter specifies the name of the datastore for the subscription.

  • refresh-rate

    • type: number (CentiSeconds)

    • usage: mandatory

    • default: none

    • Specifies the 'period' or the 'dampening-period' for the subscription.

    • The server should publish its /system-capabilities/notification-capabilities subtree from RFC 9196.

      • The 'minimum-dampening-period' leaf should be inspected to determine the minimum value for this parameter.

  • on-change

    • type: boolean

    • usage: optional

    • default: 'true'

    • Specifies if an 'on-change' subscription should be attempted.

      • If true, then use an on-change subscription, if available on the server. If not available, then use a periodic subscription instead.

      • If false, then do not use an on-change subscription, even if it is available on the server. Use 'periodic' instead.

Positive Response:

  • ok: the subscription is started on the server

Negative Response:

  • An error message will be printed if errors are detected locally or returned from the server.

terminal

The 'terminal' command is used to change the terminal settings.

It is used along with the 'show terminal' command.

+---x terminal
   +---w input
      +---w length    uint16

Command type:

local

Default parameter:

length

Min parameters:

1

Max parameters:

1

Return type:

none

YANG file:

yangcli-pro.yang

Capabilities needed:

none

Capabilities optional:

none

Command Parameters:

  • length

    • type: number

    • usage: mandatory

    • default: 0

    • This parameter specifies the length of the terminal to use for page mode output with the -More- prompt. This parameter is ignored in batch mode. It is only used if the output session is operating in interactive mode.

  • If the value 0 is used then the 'More' prompt will be disabled. Otherwise this value represents the number of lines to output for each screen in pagination output mode.

Positive Response:

  • OK

Negative Response:

  • An error message will be printed if errors are detected locally.

Usage:

andy@myserver> terminal length 20

OK

andy@myserver>

test-suite

The 'test-suite' command is used to access yangcli-pro regression test scripts. Refer to the section on Automated Testing for more details.

This command has 5 sub-commands:

  • load

  • run-all

  • show (default)

  • start ('log' parameter also allowed in this mode)

  • save

+---x test-suite
   +---w input
      +---w suite-name?           nt:NcxIdentifier
      +---w log?                  string
      +---w (test-suite-action)?
         +--:(delete)
         |  +---w delete?         empty
         +--:(delete-test-case)
         |  +---w delete-test?    empty
         |  +---w test-name       nt:NcxIdentifier
         +--:(show-case)
         |  +---w show?           IdentifierOrZero
         |  +---w (help-mode)?
         |     +--:(brief)
         |     |  +---w brief?    empty
         |     +--:(normal)
         |     |  +---w normal?   empty
         |     +--:(full)
         |        +---w full?     empty
         +--:(load)
         |  +---w load?           string
         +--:(run-all)
         |  +---w run-all?        empty
         +--:(start)
         |  +---w start?          nt:NcxIdentifier
         +--:(save)
            +---w save?           string

Command type:

local

Default parameter:

show

Min parameters:

0

Max parameters:

2

Return type:

status

YANG file:

yangcli-pro.yang

Capabilities needed:

none

Capabilities optional:

none

Command Parameters:

  • suite-name:

    • type: identifier string

    • usage: mandatory if 'delete' or 'delete-test' used.

    • This parameter identifies the test suite to delete for use with the delete and delete-test sub-commands.

  • test-name:

    • type: identifier string

    • usage: mandatory if 'delete-test' used.

    • This parameter identifies the test to delete for use with the delete-test sub-command.

  • choice test-suite-action (default show)

    • delete

      • type: empty

      • usage: optional

      • This parameter is used to delete a test-suite from memory. The 'suite-name' parameter must also be present.

    • delete-test

      • type: empty

      • usage: optional

      • This parameter is used to delete a test-suite from memory. The 'suite-name' and 'test-name' parameters must also be present.

    • load

      • type: string

      • usage: optional

      • This parameter specifies the name of the test-suite configuration file to load.

    • run-all

      • type: empty

      • usage: optional

      • Run all the test-suites defined in the test suite config files. The 'log' parameter may also be present if this parameter is used.

    • save

      • type: string

      • usage: optional

      • This parameter identifies the file specification of the test-suite configuration file where the test-suites in memory should be saved.

    • show

      • type: string

      • usage: optional

      • This parameter specifies the name of the test-suite in memory to show.

      • The --brief, --normal, or --full parameters can be used with this sub-command.

    • start

      • type: name string

      • usage: optional

      • This parameter specifies the name of the test-suite to start. This sub-command can only be used if a test-suite is not already in progress.

      • log (available only if 'start' or 'run-all' is present)

        • type: filespec string

        • usage: optional

        • This parameter specifies the name of the log file for the test-suite test run and results. If no parameter is specified, then STDOUT will be used instead.

Positive Response:

  • The appropriate data will be shown for a 'show' sub-command.

Negative Response:

  • An error message will be printed if errors are detected locally.

Usage:

andy@myserver> test-suite start ~/mytests.conf

... commands from test executed

andy@myserver>

unlock

The 'unlock' command is used to request a global lock on a NETCONF database. It is used, along with the lock command, to obtain exclusive write access to the NETCONF server.

This command is provided by the NETCONF server, not yangcli-pro. Refer to the <unlock> operation for parameter details.

Usage:

andy@myserver> unlock target=candidate

RPC OK Reply 38 for session 10:

andy@myserver>

unset

The 'unset' command is used to delete a command alias from memory.

+---x unset
   +---w input
      +---w name    nt:NcxName

Command type:

local

Default parameter:

name

Min parameters:

1

Max parameters:

1

Return type:

status

YANG file:

yangcli-pro.yang

Command Parameters:

  • name

    • type: string

    • usage: mandatory

    • default: none

    • This parameter specifies the name of the command alias to delete.

Positive Response:

  • Deleted alias 'foo' is printed, where 'foo' is the name parameter string

Negative Response:

  • An error message will be printed.

  • An <rpc-error> message will be printed if the server detected an error.

Usage:

> unset get-running

Deleted alias 'get-running'

>

unsubscribe

The 'unsubscribe' command is used to stop a NETCONF notification subscription. Refer to the Using Notifications section for an introduction to NETCONF notifications.

  • This command is available starting in the 23.10T-11 release

  • The WITH_YANG_PUSH compiler flag must be used to build yangcli-pro

  • This command is not available in 'yp-shell'

> unsubscribe stream NETCONF
> unsubscribe stream my-stream1
> unsubscribe data /interfaces-state
> unsubscribe data /interfaces-state
+---x unsubscribe
|  +---w input
|     +---w (unsubscribe-choice)
|        +--:(stream)
|        |  +---w stream       ywt:admin-string
|        |  +---w filter?      string
|        +--:(datastore)
|        |  +---w datastore?   string
|        |  +---w data         string
|        +--:(id)
|           +---w id           uint32

Command type:

local

Default parameter:

none

Min parameters:

1

Max parameters:

2

Return type:

ok

YANG file:

yangcli-pro.yang

Capabilities needed:

none

Capabilities optional:

none

Introduced:

23.10T-11

Command Parameters:

unsubscribe stream

  • stream

    • type: string (size 1 .. 1024)

    • usage: mandatory

    • default: none

    • This parameter specifies the name of the event stream.

  • filter

    • type: string

    • usage: optional

    • default: none

    • Specifies the filter to use for the subscription.

unsubscribe data

  • data

    • type: string

    • usage: mandatory

    • default: none

    • Specifies the XPath filter or filter name to use for the datastore subscription.

  • datastore

    • type: string

    • usage: optional

    • default: operational

    • This parameter specifies the name of the datastore for the subscription.

unsubscribe id

  • id

    • type: uint32

    • usage: mandatory

    • default: none

    • Specifies the subscription ID assigned by the server.

Positive Response:

  • ok: the subscription is started on the server

Negative Response:

  • An error message will be printed if errors are detected locally or returned from the server.

update-config

The 'update-config' command is used to force an update of the configuration cache for the current session. The current session must be connected and the $$autoconfig system variable must be true, or an error will be returned.

+---x update-config

Command type:

local

Default parameter:

none

Min parameters:

0

Max parameters:

0

Return type:

none

YANG file:

yangcli-pro.yang

Capabilities needed:

none

Command Parameters: none

Positive Response:

  • Nothing will be printed unless the log-level is set to debug or higher.

andy@myserver> update-config

andy@myserver>

Negative Response:

  • An error message will be printed if the current content is not an active session or the --autoconfig CLI parameter and $$autoconfig variable is set to true.

andy@myserver> update-config

Error: auto-configure mode disabled for session 'default'

andy@myserver>

user-cfg

The 'user-cfg' command is used to access a named user.

There are 4 sub-commands:

  • delete

  • save

  • show (default)

  • create

Refer to the section on NETCONF User Configuration for more details on using saved users.

+---x user-cfg
   +---w input
      +---w (user-action)?
         +--:(show-case)
         |  +---w show?           IdentifierOrZero
         |  +---w (help-mode)?
         |     +--:(brief)
         |     |  +---w brief?    empty
         |     +--:(normal)
         |     |  +---w normal?   empty
         |     +--:(full)
         |        +---w full?     empty
         +--:(delete)
         |  +---w delete?         nt:NcxIdentifier
         +--:(save)
         |  +---w save?           nt:NcxIdentifier
         +--:(create)
            +---w create          nt:NcxName
            +---w user-name       nt:NcxName
            +---w password        string

Command type:

local

Default parameter:

show

Min parameters:

1

Max parameters:

3

Return type:

status

YANG file:

yangcli-pro.yang

Capabilities needed:

none

Command Parameters:

  • delete

    • type: name string

    • This parameter specifies the name of the user to delete from the saved users in memory. An active user cannot be deleted.

  • save

    • type: name string

    • This parameter specifies the name of the user to save in the saved users in memory.

  • show

    • type: name string; default: empty string == current user

    • This parameter specifies the name of the user to show. An empty string indicates that the current user should be used.

    • The --brief, --normal, or --full parameter can be used for this sub-command.

  • create

    • type: name string

    • This parameter specifies a new user to create.

Positive Response:

  • A message indicating the save or delete was done will be printed. The show command will generate some formatted output showing information on the requested user.

Negative Response:

  • An error message will be printed if errors are detected locally.

andy@myserver> user-cfg save user-A

Saving current user as 'user-A'

andy@myserver>

> user-cfg create=usr1 user-name=admin password=password

A new user is created: user-id=usr1 name=admin password=password

users-cfg

The 'users-cfg' command is used to access the named user files.

There are 4 sub-commands:

  • clear

  • load

  • save

  • show (default)

Refer to the section on NETCONF User Configuration for more details on using saved users.

+---x users-cfg
    +---w input
       +---w (users-action)?
          +--:(show-case)
          |  +---w show?           empty
          |  +---w (help-mode)?
          |     +--:(brief)
          |     |  +---w brief?    empty
          |     +--:(normal)
          |     |  +---w normal?   empty
          |     +--:(full)
          |        +---w full?     empty
          +--:(clear)
          |  +---w clear?          empty
          +--:(load)
          |  +---w load?           string
          +--:(save)
             +---w save?           string

Command type:

local

Default parameter:

show

Min parameters:

1

Max parameters:

2

Return type:

status

YANG file:

yangcli-pro.yang

Capabilities needed:

none

Command Parameters:

  • clear

    • type: empty

    • This parameter indicates that all saved users in memory be deleted. This cannot be done if any of the users are currently active. Use 'user-cfg load' to restore the saved users.

  • load

    • type: string

    • This parameter identifies the file specification for the saved users to load. Any new named users will be added to the named users in memory.

  • save

    • type: name string

    • This parameter identifies the file specification for the saved users config file to load. The saved users in memory will be saved to this file.

  • show

    • type: name string; default: empty string == all devices

    • This parameter specifies the name of the user to show.

    • The --brief, --normal, or --full parameter can be used for this sub-command.

Positive Response:

  • A message indicating the load, save or clear was done will be printed. The show command will generate some formatted output showing information on the requested users.

Negative Response:

  • An error message will be printed if errors are detected locally.

Usage:

session-A> users-cfg load ~/more-users.conf

Loading saved users from '/home/andy/more-users.conf'

Loaded saved users OK from '~/more-users.conf'

uservars

The uservars command is used to clear, load, or save the global user variables.

+---x uservars
   +---w input
      +---w (uservars-action)
         +--:(clear)
         |  +---w clear?   empty
         +--:(load)
         |  +---w load?    string
         +--:(save)
            +---w save?    string

Command type:

local

Default parameter:

none

Min parameters:

1

Max parameters:

1

Return type:

status

YANG file:

yangcli-pro.yang

Command Parameters:

  • uservars-action

    • type: choice

    • usage: mandatory

    • default: none

    • clear:

      • Delete all global user variables from memory

    • load [uservars-filespec]

      • Load global user variables into memory from an XML file. If the 'uservars-filespec' parameter is missing, then the default file ($HOME/.yumapro/yangcli_pro_uservars.xml) will be used.

    • save [uservars-filespec]

      • Save the global user variables from memory into an XML file. If the 'uservars-filespec' parameter is missing, then the default file ($HOME/.yumapro/yangcli_pro_uservars.xml) will be used.

Positive Response:

  • A status message is printed.

Negative Response:

  • An error message will be printed.

Usage:

> uservars clear

Deleted all global user variables from memory

>

validate

The 'validate' command is used to check if a complete NETCONF database is valid or not. The :validate capability must be supported by the server to use this command.

This command is provided by the NETCONF server, not yangcli-pro. Refer to the <validate> operation for parameter details.

Usage:

andy@myserver> validate source=candidate

RPC OK Reply 36 for session 10:

andy@myserver>

while

The 'while' command is used to start a conditional loop command block.

The 'expr' parameter is used to specify the XPath expression to test if the while conditional loop block is true or false. A false block will be skipped and a true block will be executed. The command prompt will contain the string '[F]' while inside a false conditional block in interactive mode. This expression string should be entered with quotes to avoid misinterpreting any whitespace or special characters.

The 'docroot' parameter (if present) specifies the XML document that the 'expr' parameter should be evaluated against. This is optional, since only XPath path expressions need to refer to a document.

If the 'expr' expression is true, the conditional block will be executed, and no further conditional blocks within the same if command sequence will be executed.

The maxloops parameter specifies the maximum number of iterations that should be allowed, even if the expression continues to evaluate to 'true'. This allows constant expressions to be used to construct a simple 'for' loop.

while command

   ...

end command

The 'while' command must be paired with a matching end command.

+---x while
   +---w input
      +---w expr        yang:xpath1.0
      +---w docroot?    <anyxml>
      +---w maxloops?   uint32

Command type:

local

Default parameter:

expr

Min parameters:

1

Max parameters:

3

Return type:

status

YANG file:

yangcli-pro.yang

Command Parameters:

  • expr

    • type: XPath expression string

    • usage: mandatory

    • default: none

    • This parameter specifies the XPath expression to determine if the following commands are within a true or false conditional block.

  • docroot

    • type: anyxml

    • usage: optional (typically a variable reference is used)

    • default: none

    • This parameter specifies the XML document that should be used if the expr XPath expression references any path nodes.

  • maxloops

    • type: uint32

    • usage: optional

    • default: 65535

    • Set a maximum number of loops that can be iterated for this while command. The value zero means that no maximum will be enforced. Use this mode with caution.

Positive Response:

  • the server returns <ok/>

Negative Response:

  • An error message will be printed if errors are detected locally.

    • invalid XPath expression or invalid docroot reference will cause an error

Usage:

andy@myserver> while 1 --maxloops=10

SAME AS:

andy@myserver> while '$x < 10'

andy@myserver>

xget

The 'xget' command is used to invoke a NETCONF <get> operation with an XPath filter.

+---x xget
   +---w input
   |  +---w (from)
   |  |  +--:(varref)
   |  |  |  +---w varref?      string
   |  |  +--:(select)
   |  |  |  +---w select?      string
   |  |  +--:(urltarget)
   |  |     +---w urltarget?   ywt:UrlPath
   |  +---w timeout?           nt:Timeout
   |  +---w with-defaults?     CliWithDefaultsType
   |  +---w depth?             union
   |  +---w module-tag*        string
   |  +---w match-names?       ywt:NameMatchMode
   |  +---w alt-names?         ywt:AltNameMode
   |  +---w wildcard-keys?     boolean
   +--ro output
      +--ro data?   <anyxml>

Command type:

remote

Default parameter:

select

Min parameters:

1

Max parameters:

5

Return type:

data

YANG file:

yangcli-pro.yang

Capabilities needed:

:xpath

Capabilities optional:

none

Command Parameters:

  • choice 'from' (not entered)

    • type: choice of case 'varref' or case 'select'

    • usage: mandatory

    • default: none

    • This parameter specifies the where yangcli-pro should get the data from, for the XPath filter target of the <get> operation. It is an XPath expression, either contained in a user variable or directly from the 'select' parameter.

      • varref

        • type: string

        • usage: mandatory

        • default: none

        • This parameter specifies the name of the user variable the contains the XPath expression for the XPath filter in the <get> operation. The parameter must exist (e.g., created with an assignment statement) or an error message will be printed.

      • select

        • type: string

        • usage: mandatory

        • default: none

        • This parameter specifies the XPath expression to use for the XPath filter in the <get> operation.

        • Refer to the XPath specification for complete XPath syntax.

  • timeout

    • type: uint32 (0 = no timeout, otherwise the number of seconds to wait)

    • usage: optional

    • default: set to the $$timeout system variable, default 30 seconds

    • This parameter specifies the number of seconds to wait for a response from the server before giving up. The session will not be dropped if a remote command times out, but any late response will be dropped. A value of zero means no timeout should be used, and yangcli-pro will wait forever for a response.

  • with-defaults

    • type: enumeration (none report-all report-all-tagged trim explicit)

    • usage: optional

    • default: none

    • capabilities needed: with-defaults

    • This parameter controls how nodes containing only default values are returned in the <rpc-reply>.

  • depth

    • type: uint16 or “unbounded”

    • usage: optional

    • default: unbounded

    • capabilities needed: none: netconfd-pro NETCONF extension

    • This parameter controls how many levels of subtrees should be returned in the <rpc-reply>.

  • module-tag:

    • type: string

    • default: none

    • capabilities needed: none

    • This parameter is used as a filter to include only data nodes from modules that match the module-tag value. Multiple module-tag parameters can be used, combined to form a logical OR expression. At least one module-tag must match or no data will be returned. This filter is combined with the XPath or subtree filter, if present.

System Variables:

  • $$timeout

    • The response timeout interval will be derived from this system variable.

  • $$with-defaults

    • The <with-defaults> parameter for the <get> operation will be derived from this system variable.

Positive Response:

  • the server returns <data>

Negative Response:

  • An error message will be printed if errors are detected locally.

  • An <rpc-error> message will be printed if the server detected an error.

Output:

  • data

    • type: anyxml

    • This element will contain the requested data from the <running> database or non-config data structures.

Usage:

andy@myserver> xget //name

RPC Data Reply 42 for session 10:

rpc-reply {
   data {
      nacm {
         rules {
            data-rule nacm-tree {
               name nacm-tree
            }
         }
      }
      xpath.1 {
         name barney
      }
      netconf-state {
         datastores {
            datastore {
               name {
                  candidate
               }
            }
         }
      }
      netconf {
         streams {
            stream NETCONF {
               name NETCONF
            }
         }
      }
   }
   }
}

andy@myserver>

Complex Example

To include complex predicates, make sure to enclose the entire XPath expression in double-quotes, and use single-quotes for any string literals in the predicates.

In this example the "ietf" YANG library modules that are imported by the server are retrieved.

Note: not all servers support full XPath like 'netconfd-pro' so refer to your server documentation for the actual XPath expressions that will be accepted by the server.

user1@localhost> xget "/modules-state/module[starts-with(name,'ietf') and conformance-type='import']"

Example server response if the --display-mode='json' setting is used:

{
  "yuma-netconf:rpc-reply": {
    "data": {
      "ietf-yang-library:modules-state": {
        "module": [
          {
            "name":"ietf-datastores",
            "revision":"2018-02-14",
            "schema":"http://localhost/restconf/yang/ietf-datastores/2018-02-14",
            "namespace":"urn:ietf:params:xml:ns:yang:ietf-datastores",
            "conformance-type":"import"
          },
          {
            "name":"ietf-inet-types",
            "revision":"2013-07-15",
            "schema":"http://localhost/restconf/yang/ietf-inet-types/2013-07-15",
            "namespace":"urn:ietf:params:xml:ns:yang:ietf-inet-types",
            "conformance-type":"import"
          },
          {
            "name":"ietf-ip",
            "revision":"2018-02-22",
            "schema":"http://localhost/restconf/yang/ietf-ip/2018-02-22",
            "namespace":"urn:ietf:params:xml:ns:yang:ietf-ip",
            "conformance-type":"import"
          },
          {
            "name":"ietf-network-instance",
            "revision":"2019-01-21",
            "schema":"http://localhost/restconf/yang/ietf-network-instance/2019-01-21",
            "namespace":"urn:ietf:params:xml:ns:yang:ietf-network-instance",
            "conformance-type":"import"
          },
          {
            "name":"ietf-yang-metadata",
            "revision":"2016-08-05",
            "schema":"http://localhost/restconf/yang/ietf-yang-metadata/2016-08-05",
            "namespace":"urn:ietf:params:xml:ns:yang:ietf-yang-metadata",
            "conformance-type":"import"
          },
          {
            "name":"ietf-yang-types",
            "revision":"2013-07-15",
            "schema":"http://localhost/restconf/yang/ietf-yang-types/2013-07-15",
            "namespace":"urn:ietf:params:xml:ns:yang:ietf-yang-types",
            "conformance-type":"import"
          }
        ]
      }
    }
  }
}

Reference:

xget-config

The 'xget-config' command is used to invoke a NETCONF <get-config> operation with an XPath filter.

+---x xget-config
   +---w input
   |  +---w (from)
   |  |  +--:(varref)
   |  |  |  +---w varref?      string
   |  |  +--:(select)
   |  |  |  +---w select?      string
   |  |  +--:(urltarget)
   |  |     +---w urltarget?   ywt:UrlPath
   |  +---w timeout?           nt:Timeout
   |  +---w with-defaults?     CliWithDefaultsType
   |  +---w depth?             union
   |  +---w module-tag*        string
   |  +---w match-names?       ywt:NameMatchMode
   |  +---w alt-names?         ywt:AltNameMode
   |  +---w wildcard-keys?     boolean
   |  +---w source
   |     +---w (config-source)
   |        +--:(candidate)
   |        |  +---w candidate?   empty {nc:candidate}?
   |        +--:(running)
   |        |  +---w running?     empty
   |        +--:(startup)
   |        |  +---w startup?     empty {nc:startup}?
   |        +--:(url)
   |           +---w url?         nc:ConfigURIType {nc:url}?
   +--ro output
      +--ro data?   <anyxml>

Command type:

remote

Default parameter:

select

Min parameters:

2

Max parameters:

6

Return type:

data

YANG file:

yangcli-pro.yang

Capabilities needed:

:xpath

Capabilities optional:

:url :with-defaults

Command Parameters:

  • choice 'from' (not entered)

    • type: choice of case 'varref' or case 'select'

    • usage: mandatory

    • default: none

    • This parameter specifies the where yangcli-pro should get the data from, for the XPath filter target of the <get-config> operation. It is an XPath expression, either contained in a user variable or directly from the 'select' parameter.

      • varref

        • type: string

        • usage: mandatory

        • default: none

        • This parameter specifies the name of the user variable the contains the XPath expression for the XPath filter in the <get-config> operation. The parameter must exist (e.g., created with an assignment statement) or an error message will be printed.

      • select

        • type: string

        • usage: mandatory

        • default: none

        • This parameter specifies the XPath expression to use for the XPath filter in the <get-config> operation.

        • Refer to the XPath specification for complete XPath syntax.

  • source

    • type: container with 1 of N choice of leafs

    • usage: mandatory

    • default: none

    • This parameter specifies the name of the source database for the retrieval operation.

    • container contents: 1 of N:

      • candidate

      • running

        • type: empty

        • capabilities needed: none

      • startup

        • type: empty

        • capabilities needed: :startup

      • url

        • type: yang:uri

        • capabilities needed: :url, and the scheme used in the URL must be specified in the :url capability 'schemes' parameter

        • To enter this parameter, the interactive mode must be used. The shorthand mode (source=url) cannot be used, since this parameter contains a string.

  • timeout

    • type: uint32 (0 = no timeout, otherwise the number of seconds to wait)

    • usage: optional

    • default: set to the $$timeout system variable, default 30 seconds

    • This parameter specifies the number of seconds to wait for a response from the server before giving up. The session will not be dropped if a remote command times out, but any late response will be dropped. A value of zero means no timeout should be used, and yangcli-pro will wait forever for a response.

  • with-defaults

    • type: enumeration (none report-all report-all-tagged trim explicit)

    • usage: optional

    • default: none

    • capabilities needed: with-defaults

    • This parameter controls how nodes containing only default values are returned in the <rpc-reply>.

  • depth

    • type: uint16 or “unbounded”

    • usage: optional

    • default: unbounded

    • capabilities needed: none: netconfd-pro NETCONF extension

    • This parameter controls how many levels of subtrees should be returned in the <rpc-reply>.

  • module-tag:

    • type: string

    • default: none

    • capabilities needed: none

    • This parameter is used as a filter to include only data nodes from modules that match the module-tag value. Multiple module-tag parameters can be used, combined to form a logical OR expression. At least one module-tag must match or no data will be returned. This filter is combined with the XPath or subtree filter, if present.

System Variables:

  • $$timeout

    • The response timeout interval will be derived from this system variable.

  • $$with-defaults

    • The <with-defaults> parameter for the <get-config> operation will be derived from this system variable.

Positive Response:

  • the server returns <data>

Negative Response:

  • An error message will be printed if errors are detected locally.

  • An <rpc-error> message will be printed if the server detected an error.

Output:

  • data

    • type: anyxml

    • This element will contain the requested data from the 'source' database.

Usage:

andy@myserver> xget-config /nacm/rules/data-rule source=candidate

RPC Data Reply 35 for session 10:

rpc-reply {
   data {
     nacm {
         rules {
            data-rule nacm-tree {
               name nacm-tree
               path /nacm:nacm
               allowed-rights {
                  read
                  write
               }
               allowed-group nacm:admin
               comment 'access to nacm config'
            }
         }
      }
   }
}

andy@myserver>

xget-data

The 'xget-data' command is used to invoke a NETCONF NMDA <get-data> operation with an XPath filter. This command will not work unless the server supports the <get-data> operation from RFC 8526 in ietf-netconf-nmda.yang.

+---x xget-data
   +---w input
   |  +---w datastore?                     enumeration
   |  +---w (from)
   |  |  +--:(varref)
   |  |  |  +---w varref?                  string
   |  |  +--:(select)
   |  |  |  +---w select?                  string
   |  |  +--:(urltarget)
   |  |     +---w urltarget?               ywt:UrlPath
   |  +---w timeout?                       nt:Timeout
   |  +---w with-defaults?                 CliWithDefaultsType
   |  +---w depth?                         union
   |  +---w module-tag*                    string
   |  +---w match-names?                   ywt:NameMatchMode
   |  +---w alt-names?                     ywt:AltNameMode
   |  +---w wildcard-keys?                 boolean
   |  +---w config-filter?                 boolean
   |  +---w (origin-filters)?
   |  |  +--:(origin-filter)
   |  |  |  +---w origin-filter*           or:origin-ref
   |  |  +--:(negated-origin-filter)
   |  |     +---w negated-origin-filter*   or:origin-ref
   |  +---w with-origin?                   empty
   +--ro output
      +--ro data?   <anyxml>

Command type:

remote

Default parameter:

select

Min parameters:

2

Max parameters:

6

Return type:

data

YANG file:

yangcli-pro.yang

Capabilities needed:

none

Capabilities optional:

:candidate :startup :url :with-defaults

Command Parameters:

  • choice 'from' (not entered)

    • type: choice of case 'varref' or case 'select'

    • usage: mandatory

    • default: none

    • This parameter specifies the where yangcli-pro should get the data from, for the XPath filter target of the <get-config> operation. It is an XPath expression, either contained in a user variable or directly from the 'select' parameter.

      • varref

        • type: string

        • usage: mandatory

        • default: none

        • This parameter specifies the name of the user variable the contains the XPath expression for the XPath filter in the <get-config> operation. The parameter must exist (e.g., created with an assignment statement) or an error message will be printed.

      • select

        • type: string

        • usage: mandatory

        • default: none

        • This parameter specifies the XPath expression to use for the XPath filter in the <get-config> operation.

        • Refer to the XPath specification for complete XPath syntax.

  • datastore

    • type: leaf containing a datastore-ref

    • usage: mandatory

    • This parameter specifies the name of the source NMDA datastore for the retrieval operation.

    • enumeration:

      • candidate

      • running

        • capabilities needed: none

      • startup

      • operational

        • capabilities needed: none

  • timeout

    • type: uint32 (0 = no timeout, otherwise the number of seconds to wait)

    • usage: optional

    • default: set to the $$timeout system variable, default 30 seconds

    • This parameter specifies the number of seconds to wait for a response from the server before giving up. The session will not be dropped if a remote command times out, but any late response will be dropped. A value of zero means no timeout should be used, and yangcli-pro will wait forever for a response.

  • with-defaults

    • type: enumeration (none report-all report-all-tagged trim explicit)

    • usage: optional

    • default: none

    • capabilities needed: with-defaults

    • This parameter controls how nodes containing only default values are returned in the <rpc-reply>.

  • depth

    • type: uint16 or “unbounded”

    • usage: optional

    • default: unbounded

    • capabilities needed: none: netconfd-pro NETCONF extension

    • This parameter controls how many levels of subtrees should be returned in the <rpc-reply>. This is called the <max-depth> parameter in the <get-data> operations.

  • config-filter:

  • type boolean

  • Specifies the type of data based on config-stmt. Retrieve all data if this parameter is not present. This is a top-down filter. It will not select nodes within a subtree if the ancestor nodes do not match the filter.

  • Only relevant if the datastore parameter is ‘operational’.

  • If set to ‘false’ for any datastore other than ‘operational’ then an empty <data> element will be returned.

  • origin-filter:

    • type: leaf-list of type origin-ref..

    • This parameter will select data nodes with the specified origin. This is a top-down filter. It will not select nodes within a subtree if the ancestor nodes do not match the filter.

    • Cannot be used if negated-origin-filter present

    • Can only be used if the datastore parameter is ‘operational’

  • negated-origin-filter:

    • type: leaf-list of type origin-ref..

    • This parameter will select data nodes if they do not have the specified origin. This is a top-down filter. It will not select nodes within a subtree if the ancestor nodes do not match the filter.

    • Cannot be used if origin-filter present

    • Can only be used if the datastore parameter is ‘operational’

  • with-origin

    • type: empty

    • This parameter will cause the origin attribute to be added to data nodes returned by the server.

  • Can only be used if the datastore parameter is ‘operational’

System Variables:

  • $$timeout

    • The response timeout interval will be derived from this system variable.

  • $$with-defaults

    • The <with-defaults> parameter for the <get-data> operation will be derived from this system variable.

Positive Response:

  • the server returns <data>

Negative Response:

  • An error message will be printed if errors are detected locally.

  • An <rpc-error> message will be printed if the server detected an error.

Output:

  • data

    • type: anyxml

    • This element will contain the requested data from the 'source' database.

Usage: